info:vb_serial_comm
Differences
This shows you the differences between two versions of the page.
info:vb_serial_comm [2008/07/19 06:17] – created tomgee | info:vb_serial_comm [2008/07/19 06:22] (current) – tomgee | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | Serial Communication with VB.Net | + | {{info: |
- | One of the thing I really miss while using VB.Net is the lack of serial communication support.Yes, | + | {{info:vb_comm2.jpg|}} |
- | Don't forget moreover that if you use that control, you must register it on user machine when you deploy your application, | + | |
- | With this class you can easily use serial communication using native VB.Net and API features. | + | |
- | Before describing you how to use the class, let me point out that I've just written it as a demonstration of VB.Net interface to serial communication, | + | |
- | Initializing and Opening the Com port | + | |
- | Create an instance of CRs232 then set COM parameters before invoking the Open method | + | |
- | Here's an example: | + | |
- | Dim moRS232 as New Rs232() | + | |
- | With moRs232 | + | |
- | .Port = 1 '// Uses COM1 | + | |
- | .BaudRate = 2400 ' // 2400 baud rate | + | |
- | .DataBit = 8 ‘// 8 data bits | + | |
- | .StopBit = Rs232.DataStopBit.StopBit_1 '// 1 Stop bit | + | |
- | .Parity = Rs232.DataParity.Parity_None '// No Parity | + | |
- | .Timeout = 500 '// 500 ms of timeout admitted to get all required bytes | + | |
- | End With | + | |
- | '// Initializes and Open | + | |
- | moRS232.Open () | + | |
- | You can, optionally control the state of DTR/RTS lines after the Port is open | + | |
- | + | ||
- | '// Set state of RTS / DTS | + | |
- | moRS232.Dtr = True | + | |
- | moRS232.Rts = True | + | |
- | In case of an error/ | + | |
info/vb_serial_comm.1216462665.txt.gz · Last modified: 2008/07/19 06:17 by tomgee