Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

how to process data stream from VISA

I'm totally new at this VISA and just found out I needed to use this function. I went ahead to look through the examples but I couldnt understand a single thing. I'm a bioengineering major with little or no background in labView but have been required to use labView to do my senior project. 

 

Basically I have no idea what is bytes or bits or how to "process" such a data stream. I look the example from NI and removed the different portion until I only got the read part down (trial and error) - even then I still dont really understand what is going on.

 

What this VI is doing is that, it reading output from a CO2 sensor which outputs Z ###### z ##### /r/n twice every second. I'm not sure why there is a /s in the space between. How do I "process" the signal to just to get the first ##### which I am interested in and "throw" away the rest? 

0 Kudos
Message 1 of 5
(3,323 Views)

Hello Danwhc,

 

What type of communication are you doing in your application? Could you please provide some more background about your application and what you would like to be able to do. In addition, what devices are you using. I have included a link to some useful information regarding VISA.

 

NI-VISA Overview

http://zone.ni.com/devzone/cda/tut/p/id/3702

 

Paul

Applications Engineer
National Instruments
0 Kudos
Message 2 of 5
(3,303 Views)

Hi Paul

 

I'm using a 5V USB-UART trying to read a data stream from a carbon dioxide sensor. Basically, during operation, the sensor would just output continously ppm or concentration data via the USB UART cable and I have to read that stream, process that since its a string format as I understand it and finally display it in interger or as a number. 

 

 

0 Kudos
Message 3 of 5
(3,290 Views)

Hello Danwhc,

 

Look in the Example Finder for the example called "Parse String.vi" in the Fundamentals>>Strings section.

 

This example will show you how to remove portions of a string at a given offset to return a substring of your desire.

 

Regards,

 

Jeff L.

0 Kudos
Message 4 of 5
(3,274 Views)
All you really need is the Scan From String function.

You can get rid of the Bytes at Serial Port. Not necessary with the termination character enabled. Use a fixed number for the number to read.

The \s is just how a space is indicated when you have \ Codes Display turned on.

Also, you cannot do a continuous read without a while loop. Do NOT use the run continuous button.
0 Kudos
Message 5 of 5
(3,269 Views)