I am having and issue with the stream function in LabVIEW. What I am doing is reading audio signal of a device on two different channels one chanel at a time. The Stream Read is in as case structure. When Channel 1 is finished being read and analyzed, I send a serial command to stop it. This works great and moves on to Channel 2
The issue is during the Stream Read of channel 2, it seems that the waveform graph is the data from the Channel 1. I placed the 'Stop Stream VI' after channel 1and it continues. I have even removed the command to turn Channel 2 on and the graph still displays a signal. It seems that the buffer is holding on to this information. I tried to lower the sampling rate but that does not help.
Attached are the settings I have. I am using a LabJack T7, using AIN12 and AIN13 for the differential input. I started with ‘Steam_Basic.vi’ and altered it to qualify the signals. Any help would be great
-Is there a way to clear the buffer from LabVIEW?
-Is there a better way of reading two signals one after another in a more efficient way??
Thanks,
JB
Your settings indicate that you are streaming two channels at once. I suspect that you are getting back data for both channels, but maybe only reading the first channel data for both streams. If you are starting and stopping stream at two different times please make sure you only have the channel of interest in the scan list when you start streaming.
Also note that when you start a new stream the old data buffer in LJM is destroyed internally, so any buffer carryover issues are local to LabVIEW.
If the above is not helpful, please send over screenshots of your code.
I have the anoalog inputs setup as a differential input, AIN12 is positive and AIN13 is set up as the GND. I though I had to include both at the same time. I had the start_stream at the beginning and stop_stream at the end but I moved these to try and cancel the data of the first reading . I am not at my test setup but attached is the program I am working with.
So if its local to LabView then is it an application issue or are you saying that I would somehow stop the data form being sent to LabJack?
Attached is a screen shot not sure if that healps so I included the vi as well
Thank you.
If AIN13 is just tied to ground then you are doing a single ended measurement and you can just measure AIN12. If AIN13 is at some potential,you still do not need to stream AIN13, but instead you should set AIN12_NEGATIVE_CH to 26 (the address of AIN13) before streaming. See this related section:
https://labjack.com/support/datasheets/t-series/ain#differential
You should also be sure to have some reference to ground if you are doing differential readings, see here:
https://labjack.com/support/app-notes/differential-analog-inputs#differe...
LabVIEW does some sort of goofy things with memory allocation; I think that tying an empty array constant to your stream data shift register input will probably make your buffering problem go away. Also be sure to stop stream at the end of the "tone CH1" state when you add back in channel 2 because the LJM buffer will not be cleared between read states otherwise.