LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

handling multiple serial port (RS232)

Hello

I started using lab Viewlast week and I have an assignment to make a program that handles multiple serial port communication by modifying sample file that comes with lab View (I think the file name is serial.prj at rs232 directory)

The program should be able to handle any number of serial port. (but does not have to handle multiple number of port at one time)

I am assuming that it should be small modification from the sample file but not really sure...

If anyone can give me help or sample code
I would appreciate it!

Thanks
Fran
0 Kudos
Message 1 of 2
(3,424 Views)
serial.prj permits you to open any rs232 port from COM1 to COM8. In the Configure panel you choose the serial port to open and some configuration parameters; when you click on Close, the serial port is opened and you cand write and read to/from it with the control on the main panel.

NOTE: I suppose in the next you are using LabWindows/CVI, NOT LabVIEW!

To handle 'any number of serial port' you must only change the COMPORT control in the CONFIG panel from a ring/vertical slide to a numeric/numeric (delete it and create a new control with the same name), and set these properties for the new control:
default value: 1
data type: int
minimum: 1
maximum: 1000 (those are limit accepted by OpenComConfig function. If you don't have in your system the port you are trying
to open, you will receive an error. You may want to limit the maximum port configurable to the last effectively present in your system)
range checking: I suggest you to put Coerce in your particular environment
Next you can run the project and use it...

I hope to have been clear, if not reply to my answer and specify the item to clarify.

Roberto


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 2
(3,424 Views)