Solved

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

Posted on 2016-09-05
3
14 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 32

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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 …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now