×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Open com port through vb

Open com port through vb

Open com port through vb

(OP)
Hi,
I am relatively new to vb application building so bare with me on this one.
I have captured information being passed to an ink jet printer unit from a vb application which sends its data via ethernet to serial. Now that i can see the information being passed to this unit i want to try and build an application to send the data direct through a serial connection(say locally from a laptop).
The first thing i need to know is how to open a com port from a vb app. Any help with this would be much appreciated.
Dermot

RE: Open com port through vb

Have you tried using the MSComm control?

RE: Open com port through vb

(OP)
Cheers, that looks as though it'll do the job, ill post further if i have problems ...

RE: Open com port through vb

(OP)
Further to the initial post,
i now need to send data to this ink jet printer in a recognisable fashion. I have captured the data(portmon) but dont know how to interpret it! heres a sample of the text i captured if anyone can help me out.
All the data i need is in the text below. Im not sure either how to handshake to this unit before i download? confused ????


<ENQ><ACK>
Ÿ<STX>.<NUL><SOH>     001É<NUL><DLE><NUL><NUL><VT><SOH>ô<NUL><LF><NUL><LF><NUL>d<NUL><NUL><NUL>€00000000099999999901<NUL><NUL><NUL><NUL><NUL>€00000000099999999902<NUL><NUL><NUL><NUL><NUL><NUL><LF>€<HT><DC2><SOH><DLE><RS><RS><RS>448397<DLE><SOH><DC2>€<HT>€<HT><DC2><SOH><DLE><RS>$<RS>25<DLE><SOH><DC2>€<HT>€<HT><DC2><SOH><DLE><RS>$<RS>24AUG2005<RS>f<RS><DLE><SOH><DC2>€<HT><LF>€<LF><CR><SOH><DLE>NO.  <DLE><SOH><CR>€<LF>€<LF><CR><SOH><DLE><RS>H<RS>UNITS <DLE><SOH><CR>€<LF>€<LF><CR><SOH><DLE><RS><CAN><RS>BEFORE<DLE><SOH><CR>€<LF>€<LF><CR><SOH><DLE><RS>l<RS>TEMP   <DLE><SOH><CR>€<LF>€<LF><CR><SOH><DLE>+40F +50F<RS><ACK><RS><DLE><SOH><CR>€<LF><LF>€<DC2><CR><SOH><DLE>BATCH<DLE><SOH><CR>€<DC2>€<DC2><CR><SOH><DLE><RS>H<RS>NO. OF<DLE><SOH><CR>€<DC2>€<DC2><CR><SOH><DLE><RS><CAN><RS>BEST  <DLE><SOH><CR>€<DC2>€<DC2><CR><SOH><DLE><RS>l<RS>STORAGE<DLE><SOH><CR>€<DC2>€<DC2><CR><SOH><DLE>+4C +10C<RS><FF><RS><DLE><SOH><CR>€<DC2><LF>€$<DC2><SOH><DLE><RS><CAN><RS>CH/CL-2.10<DLE><SOH><DC2>€$€$<DC2><SOH><DLE><RS><CAN><RS>2<DLE><SOH><DC2>€$€$<DC2><SOH><DLE><RS>0<RS>1001761<DLE><SOH><DC2>€$€$<DC2><SOH><DLE><RS>$<RS>211.3<DLE><SOH><DC2>€$<LF>€%<CR><SOH><DLE>TYPE<DLE><SOH><CR>€%€%<CR><SOH><DLE><RS>x<RS>NO. <DLE><SOH><CR>€%€%<CR><SOH><DLE><RS><FF><RS>NUMBER  <DLE><SOH><CR>€%€%<CR><SOH><DLE><RS>T<RS>KG.   <RS><<RS><DLE><SOH><CR>€%<LF>€-<CR><SOH><DLE>PROD<DLE><SOH><CR>€-€-<CR><SOH><DLE><RS>x<RS>PART<DLE><SOH><CR>€-€-<CR><SOH><DLE><RS><FF><RS>MATERIAL<DLE><SOH><CR>€-€-<CR><SOH><DLE><RS>T<RS>WEIGHT<RS><<RS><DLE><SOH><CR>€-<CR>µ

RE: Open com port through vb

You will need to use the Chr$() function to send the non-character codes. You can find all the ASCII values at :
http://www.asciitable.com/

Good Luck
johnwm
________________________________________________________
To get the best from these forums read FAQ731-376 before posting

RE: Open com port through vb

(OP)
Thanks for that,
Im going through the string data to make sure all the variables are covered. Then i will try the  Chr$() function to send the non character codes and see what happens. Hopefully success !!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources