Solved

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

Posted on 2016-09-05
3
19 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 62

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Gridview selected row 9 46
Get the selected ValueMember of Combobox 5 30
export data table to excel in vb.net 10 26
VB.Net WebRequest Code from JSON curl 9 10
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

773 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