This topic describes how to use
My.Computer.Ports to receive strings from the computer's serial ports in Visual Basic.
-->
Visual Basic Serial COM Port Tutorial (Visual Studio 2010) - Part 2 Kelvin Le. Unsubscribe from Kelvin Le? Cancel Unsubscribe. Subscribe Subscribed Unsubscribe 4.1K.
To receive strings from the serial port
Example
This code example is also available as an IntelliSense code snippet. In the code snippet picker, it is located in Connectivity and Networking. For more information, see Code Snippets.
Compiling the Code
This example assumes the computer is using
COM1 .
Robust Programming
This example assumes the computer is using
COM1 . For more flexibility, the code should allow the user to select the desired serial port from a list of available ports. For more information, see How to: Show Available Serial Ports.
This example uses a
Try..Catch..Finally block to make sure that the application closes the port and to catch any timeout exceptions. For more information, see Try..Catch..Finally Statement.
See also-->Definition
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |