LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

protocol for SetCommState function call

Hello, I was hoping someone could tell me what the protocol is for inputing the DCB information on baudrate, parity, etc into a labview function call. I believe I have the serial port handle part of the call working corrently, and when the GetCommState function is called, the DCB returns "28". I am simply unsure of how to place the setup the data to be read into SetCommState because normally the baudrate, parity, etc. are set individually in either C++ or VB and then the call is made. Unfortunately, I do not know how to set the individual states in labview, nor do I have or have a C++ compiler to set the info outside labview (and I don't have any desire to use external C code).
I have also tried briefly and unsuccessfully to swap out the SetCommState call with labview Visa code. Any help would be much appereciated. I am really stuck here.
Thanks,
JOe P
0 Kudos
Message 1 of 3
(2,516 Views)


@thoj wrote:
Hello, I was hoping someone could tell me what the protocol is for inputing the DCB information on baudrate, parity, etc into a labview function call. I believe I have the serial port handle part of the call working corrently, and when the GetCommState function is called, the DCB returns "28". I am simply unsure of how to place the setup the data to be read into SetCommState because normally the baudrate, parity, etc. are set individually in either C++ or VB and then the call is made. Unfortunately, I do not know how to set the individual states in labview, nor do I have or have a C++ compiler to set the info outside labview (and I don't have any desire to use external C code).
I have also tried briefly and unsuccessfully to swap out the SetCommState call with labview Visa code. Any help would be much appereciated. I am really stuck here.
Thanks,
JOe P

Have you considered using VISA for serial port communication? No need to reinvent the wheel while some great guys at NI have dealt with the serial port access for you already!

Rolf Kalbermatter
Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 3
(2,511 Views)
Hi Joe,
You can use the Configure Serial Port VI to set up those properties. Take a look at the Basic Serial Write and Read shipping example to get you started. You can find it under the browse tab in the Example finder, by navigating to Hardware Input and Output >> Serial. Hope this helps!

Regards,
Ebele O.
National Instruments
0 Kudos
Message 3 of 3
(2,497 Views)