From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial i/o driver

Hello, I have the task to interface a device that uses a proprietary serial protocol (uses parity-bit as data bit). While Win98 serial i/o drivers don't care about the parity W2k does.
Q: Does LabViev use W2k drivers for serial communication or is there a chance to use a driver which accepts any serial protocol.
0 Kudos
Message 1 of 8
(3,171 Views)
Sounds like you are trying to perform 9 bit framing using the parity bit settings mark and space. This should be doable under both Win98 and Win2k using the system serial driver. Since both drivers comply with the Win32 API I can not imagine why one "cares about parity" while the other does not. Both should treat parity exactly the same.

LabVIEW (traditional serial vi's) and VISA both make Win32 calls that are routed by the OS to the serial driver specific to the port you are communicating with. In the case of local built-in COM ports, this will be the native OS driver. With regards to handling COM port settings like parity, LabVIEW behaves the same as any other application written to the Win32 serial API.

If you are using the parity bit for 9
bit framing the sequence should be something like the following:

1) Open COM port
2) Set all settings (baud rate, etc.)
3) For each byte written do:
A) Set parity to Mark or Space
B) Write character
C) Wait to allow character write to complete
4) For each byte received do
A) Set parity to Mark or Space
B) Receive character and look for parity error as indication of the value of the 9th bit.

NOTE: Receiving 9 bit data may be tricky if you are also transmitting as you'll be changing parity and it'll be difficult, if not impossible, to know what state the parity setting was in at the instant that a data byte was received.

Hope this helps!
Message 2 of 8
(3,171 Views)
Wonderful post Chris!

How about using one serial for transmit operations and another for the read operations?

That way you can do what Chris said but you can keep track of the parity setting!

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 8
(3,170 Views)
I NEEDE MAKE A SIMPLE SERIAL TRANSMITION WITH LV8 BUT I DON'T KNOW HOW MADE THIS WITH VISA, BECAUSE I ALWAYS WORK THIS JOBS WITH THE OLD VERSION OF SERIA IN LV6.

I TRY UNDERSTAND AND APPLY THE EXAMPLES BUT DON'T WORK.

ANYBODY CAN HELP ME WITH A EXAMPLE FOR LV8 IN SERIA TRANSMITIONS?
0 Kudos
Message 4 of 8
(2,960 Views)
The examples works fine. Did you take in account the stacked sequence structure? I had some problems because I dind't wait nothing. So, before reading again make sure you wait like 500ms just to confirm it works. For example if you're are just wainting from serial, make sure each time you read the buffer there is an interval of +/- 500ms. Then you must read all buffer. I think there is an example with this wait step. Take a look.
0 Kudos
Message 5 of 8
(2,955 Views)
WHEN I WORK WITH SERIAL VISA TOOLS THIS TAKES PLACE A CODE ERROR (TAKES PLACE), SOMEBODY KNOWS LIKE I CAN CORRECT THIS PROBLEM?

0 Kudos
Message 6 of 8
(2,939 Views)
It would help if you mentioned the error code that you are getting.
0 Kudos
Message 7 of 8
(2,933 Views)
Since you have experience with the old serial functions, then start by opening a copy of one of your LV 6.X VI's.
 
I believe LV will replace all of the old serial calls with VI that "look" like the old serial functions but inside you will find the VISA versions doing all of the work.
 
Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 8 of 8
(2,924 Views)