balance device

bary40

Newcomer
Joined
Nov 9, 2003
Messages
17
Hi



I need to write an application for a balance device using

VB.Net 2005, can anybody provide me of some articles

or code to show me how to do it .

the device has a RS232 output .

thanks in advance
 
Hi,

You can use the SerialPort Component of Net Framework 2.0. or you can use other pretty good classes for Serial Port reading, like in these sites:
http://www.codeworks.it/net/VBNetRs232.htm
http://www.codeproject.com/dotnet/DotNetComPorts.asp
http://www.freevbcode.com/ShowCode.asp?ID=4666

After use one these classes, you define:
-Baud Rate (usually 9600, but u should read the balance manual)
-Parity (usually none)
-Data Bits (usually 8 data bits)
-Number of Start Bits (1 bit)
-Port Number

normally these are the requested parameters.

After that, you should subscribe the event that will handle the received data from you balance, and you got the info received from com port.


Suggestions:
-Use hyperterminal to check correctly the settings of the balance and the com port number.
-If you're using a USB<->RS232 Adapter be sure that this works well with the balance, normally in the industrial equipments these adapters are not fully compatible sometimes.
-Clear allways the buffer, before you read again new info from the serial port, to ensure you're not read garbage.


I hope this can help you.


Best regards,
Tiago Teixeira
 
Back
Top