06-28-2012 12:07 PM
Hello all, this is my first post on this forum!
I am an undergraduate research assistant working on writing a program for lab research equipment. This is my second week using LabVIEW, and my first time ever working with Serial RS232. I have programmed temperature/pressure sensors with the NI DAQ board, but this VISA programming is entirely different and I believe I could use help with a step in the right direction.
My goal is to take realtime data from a seismograph device across RS232 and have it read out on a graph showing the waveform. The hardware I am reading from continuously outputs integer values one after another for the data. I am currently able to read from the device and show the individual value on a string indicator coming from the read buffer of the VISA Read Function. Running the program continuously displays values on the string indicator in real time as the data changes from the device.
I would like to take the string data from the VISA Read Function and 1) list the data values sequentially, as they are read, onto a table containing all other read values, and 2) take the data values from the table and put them on a graph that will display the seismic activity in real time as the data values are read from the device.
Attached is a screen shot of the program I have written. It is extremely simple, clearing the buffer and then waiting 100ms before reading each value.
Thank you for your assistance!
celeritas
06-28-2012 12:55 PM
Never use the run continuous button. That is just a debug tool. You need a while loop around the read. In order to write to a table, you would need a shift register. The Express table might be different but I don't use Express VIs often. To plot, you would convert the string to a numeric and wire it to a chart.
p.s. Using the VISA Configure Serial Port with termination character enabled along with the VISA Bytes at Serial Port is a bad combination. If your instrument sends data with a termination character, you just need a constant wired to the byte count of the VISA Read. You would also eliminate the wait function.
01-20-2016 05:12 AM
01-20-2016 06:43 AM
01-20-2016 07:06 AM
01-20-2016 07:15 AM
@ZohaibRamzane wrote:
Can you explain line feed?
LIne feed is a specific character in the ASCII chart. In the terms of a byte value, a LF is 10 in decimal, 0xA in Hexidecimal.
01-20-2016 09:56 AM
I am getting problems in getting the right Graph chart....
The array that i am sending is like this
unsigned char abc[7] = {' , ', '2 ', ' , ' ,' 4 '};
The vi and the data i am getting is like this.....in figures
Please tell me where i am wrong...
01-20-2016 10:17 AM
01-20-2016 11:07 PM - edited 01-20-2016 11:08 PM
Hi! I have changed my vi.Now i am continuously reading data from the port. I amsending an array like
unsigned char abc[6] = {'0',',','8',',','1',','};
but Instaed of getting constant 0 value in first graph chart ,i am getting varying value 0->8->1.Same problem is with other graph chart.
How can i tackle this prroblem? Please modify the vi or tell me the right way to do it.
01-21-2016 12:02 AM