Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Opening and Closing Connections and Data Adapters 10 42
Ajax Panel Not Updating When Triggered By Timer 4 44
Vb. Net application freezes 9 30
Variable Event ? 3 23
This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

867 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

15 Experts available now in Live!

Get 1:1 Help Now