10-05-2016 07:58 AM
Hey everyone
I am facing a challenging problem. I have a CO2 sensor connected to the PC that I want to be able to read from and display it on a waveform graph. The main problem is to be able to read from the sensor in labview. I got a software program with the sensor but I want to be able to display it in labview together with the other sensor I have so that I wont need to have both labview and the software open at the same time. How do I accomplish that? I added a picture of the sensor aswell with some manuals. Thanks!
Greetings
DP
Solved! Go to Solution.
10-05-2016 08:26 AM - edited 10-05-2016 08:27 AM
The sensor has what looks like an FTDI USB to Serial cable attached to it - so you'll be using NI VISA to communicate with the sensor.
Page 4 of the manual defines the parameters you must use (e.g. baud rate etc.) and page 5 gives the format of the commands sent by the sensor (an ASCII string with a \r\n carriage return / line feed termination - "Z ##### z #####\r\n").
Look at the NI VISA examples to get started - you will want to use a termination character (\n) to help you separate the commands.
10-05-2016 09:17 AM
Hi Sam
Okey I have been playing around with the "Continuous serial read and write vi" and it seems to read similiar data as the software that came with the sensor. Is it correct of me to put an "A" as termination character? Second if I want to display the data on a waveform chart how do I do that?
Greetings
DP
10-05-2016 09:17 AM
Hi Sam
Okey I have been playing around with the "Continuous serial read and write vi" and it seems to read similiar data as the software that came with the sensor. Is it correct of me to put an "A" as termination character? Second if I want to display the data on a waveform chart how do I do that?
Greetings
DP
10-05-2016 09:26 AM
10-05-2016 09:43 AM
This is what I did. I did not add any scaling yet but nothing is showing up on the chart. Whats wrong ?
Thanks alot for helping out.
Greetings
DP
10-05-2016 09:52 AM - edited 10-05-2016 09:53 AM
I can't open your VI as I only have LV2014. If you can save it for LV2014, I'll take a look.
Try using probes and check the error wires to see what is happening. If you are reading the string data correctly, it might be that the format string is slightly wrong (e.g. there's still a \r character in there - so you could add a trim whitespace to remove it).
10-05-2016 09:56 AM
Can you open this one :)?
10-05-2016 10:31 AM - edited 10-05-2016 10:32 AM
Hi DP,
nothing is showing up on the chart. Whats wrong ?
Well, it's wrong to connect the VISA reference to a ScanFromString function and to expect to get some device readings by this!
You need to parse the response string you get from VISARead! And you should connect the chart with a data source: no wire, no data to display!
(And maybe it's a good idea NOT to collect all read data in this string…)
10-05-2016 10:31 AM
I strongly suggest you take some of the LabVIEW tutorials as the error you have made is very basic and you would have easily found the problem if you had probed the input to your scan from string function.
You have the 'VISA Reference' (which contains the name of your serial port) wired to the input of the scan from string node. You need to wire the string data coming out of the 'VISA read' node (which contains the data being read from the device) into the scan from string.