Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Visa not parsing correctly

 

I am connecting a Nonin pulse oximeter to Labview using a serial data to usb connection.  The information from the Model 7500 is sent in an ASCII serial format at 9600 baud with 8 data bits, 1 start bit, and 2 stop bits. Each line is terminated by CR/LF. However when I try and read the serial data in Labview using visa read, I only get single random characters.  I am not sure what I am doing wrong.  I've set the stop bit to 2 and all other settings are correct in Labview.  I thought there was something wrong with the the byte count and I set up a control on the front panel and I clicked through 1-100 to see if I could change what was coming through with no avail. It should only be about 20 bytes anyways.  I know that labview can only read one termination character.  I've tried changing the termination character to either CR or LF and that hasn't made a difference. Even though there are no carriage returns in the data I am reading.  The serial output should be SPO2=XXX HR=XXX.  I have also tried turning off the termination character in Serial Reads and that also doesn't work.  Any advice would be appreciated.

0 Kudos
Message 1 of 8
(699 Views)

Goodmorning

Does it work in a serial terminal?

It could be you have swapped send and receive connections and maybe you need to send a command before it starts.

Anyway you should activate the terminal read on a line feed, then the count can be 100 but will be stopped on the line feed.

And please connect the output directly to the string instead of typecasting.

greetings from the Netherlands
0 Kudos
Message 2 of 8
(673 Views)

I have tried using it in NIMAX and I basically get the same results, a bunch of random characters. Is this what you mean?  When I run this I get the same random characters and an error saying framing issues.  Not sure how to get it to read properly.  It shouldn't need a command before starting. 

0 Kudos
Message 3 of 8
(583 Views)

why are you type casting?

 

No need for that. The default is OK.

 

I slightly modified your vi.

Let know if this works or not.

 

Maybe the bausrate is not correct.

greetings from the Netherlands
0 Kudos
Message 4 of 8
(573 Views)

I was typecasting to add a line feed termination character.

This code shows error code -1073807253 immediately after hitting play button.

0 Kudos
Message 5 of 8
(570 Views)

Indeed a framing error, probably boudrate or not two stopbits, or anything.

greetings from the Netherlands
0 Kudos
Message 6 of 8
(567 Views)

I’ve looked in the manual for the serial device and the settings are right. It does use carriage return and line feed as the termination character. Is that the reason it’s not reading properly?

0 Kudos
Message 7 of 8
(559 Views)

You can safely change the number of stopbits to 1.

Only in writing this is important and you only read. Maybe this helps.

greetings from the Netherlands
0 Kudos
Message 8 of 8
(543 Views)