Solved

How to pass this in  Serial port comunication : <SOH><LF> in vb.net

Posted on 2016-09-05
3
22 Views
Last Modified: 2016-10-22
i have some code for serial port comunication.
-----
<SOH><LF>
09_Cobas_Integra_09<LF>
<STX><LF>
10_01<LF>
<EFX><LF>
1<LF>
625<LF>
<EOT><LF>
--
how to pass this code in vb.net for serial port communication.
0
Comment
Question by:rajeshavyas
3 Comments
 
LVL 33

Assisted Solution

by:ste5an
ste5an earned 250 total points
ID: 41784577
Byte by byte. Either as byte array or as string.
0
 
LVL 63

Accepted Solution

by:
Fernando Soto earned 250 total points
ID: 41784762
Hi  rajeshavyas;

What I think you are looking for is first to convert all your control codes such as <SOH>, <LF>, <STX> and so on to their ASCII code values. For example <SOH> is Start Of Heading which has a numeric value of 1 and <LF> which is Line Feed and has a value of 10 and everything else represents itself. Place into a Byte array or a string like this.
Dim sendThis = Chr(1) & Chr(10) & "09_Cobas_Integra_09" & Chr(10) & Chr(2) & "10_01" & Chr(10)

Open in new window

Although I do not know what <EFX> is? It may be a device specific code. Below is the beginning of the ASCII table that has the control codes. You may need to add a reference to Microsoft.VisualBasic.dll and use the Imports Microsoft.VisualBasicASCII Control Codes
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
vb.net and creating a class 5 29
FInd Image Control Gridview 3 35
Code enhancement 4 32
Retrieve Active Directory Groups a User belongs to in VB.NET 3 41
Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question