LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can you make a VI to parse chars from a serial line?

Hi All,

 

I have some sensors to interface with, they have a serial output.  Is it possible (and easy) to write a VI that can read and parse chars received from a serial line?

How would one go about doing this?

 

Thanks,

Sean

0 Kudos
Message 1 of 4
(3,086 Views)

When you say that they have a serial output is it actually an RS-232 protocol, or some other sort of serial output like I2C or SPI?

 

If it's an RS-232 protocol then there's a few shipping examples that show you how to use VISA to communicate over serial port. You can also try the Instrument Assistant which walk you through a parsing of a response. Before you try either of these, though, you should verify your communication by trying to talk to the sensors using a terminal program such as HyperTerminal if you're on Windows. This will help to make sure you've got the right cable and the right serial port settings.You may also want to start here : Serial Instrument Control Tutorial.

 

Now, if it's another type of serial protocol then you need to look in the documentation to see what it is. Post back and we can try to suggest something.

0 Kudos
Message 2 of 4
(3,078 Views)
Sorry, should've been more specific.  Sensor is RS232 serial, TTL level (might need a level converter), ASCII 9600bps.  Actual data format not specified.  It sounds like Labview does have support for reading from the serial port then?  If yes, I should be able to make a VI to read and parse the messages.
0 Kudos
Message 3 of 4
(3,064 Views)

Yes, LabVIEW can communicate via serial port using the VISA read/write functions.

For parsing, you just need to know how the data is sent, ie termination characters, end of line characters, etc.

Once you know the format that the data is tranferred, post back and we can help you from there.

Cory K
0 Kudos
Message 4 of 4
(3,058 Views)