LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

asynchronous to synchronous data

I have a vi with several sub vis collecting data from a variety of more or less asynchronous processes. In some cases the instruments are triggered but mostly they are supplying serial ASCII strings of various lengths at about 1 second intervals. Some are slower. How do I once per second grab whatever data is available in the all of the individual buffers and put it in a time stamped array, each row having a one-second time stamp. It is not necessary that each data point have unique data. There is no problem if the same data is read more than once for storage in the array.
0 Kudos
Message 1 of 3
(2,820 Views)
Steve,

I have to assume that you are reading the serial data in a while loop. (Does the loop use a timer for reading? Do you have a loop for every serial device?)

There are many ways to do what you are asking to do. I will give just a couple. First, since the saving process is a different process, use a separate loop. Every time that you get new data, send off a notifier with the data to the other loop. You can then collect the data and place it into an array every second (using the tick counter to determine that). Second, you can use a shift register in the main while loop to collect all of the data that is brought in and every second, place this into another shift register that contains your save array. If you are using multiple while loops to collect the
data, then a combination of both of these methods would work as well.

Randy Hoskin
Applications Engineer
National Instruments
http://www.ni.com/ask
0 Kudos
Message 2 of 3
(2,820 Views)
Hi,
i have a problem.
I saved data from VISA read into a file in a for-loop and then read the data from the same file and display them into a waveform chart, in another for loop.
I want the two operations to operate synchronously, as in, once a string is being read by VISA read, the other for-loop will plot it and plot the point in the waveform chart.
I tried to wire the waveform chart directly to the array of strings collected, but it can only be displayed only after all the strings have been collected using spreadsheet into an array. However, this is not I want. I want to read one string, plot one point, and this process is continued until i get a whole waveform.

I read from the above reply that "Every time that you get new data, send off a n
otifier with the data to the other loop. You can then collect the data and place it into an array every second (using the tick counter to determine that)."
is that suitable for my case?
i am not using a while loop, which is being assumed. So, i am not sure how i should do? should i use the event-driven to make my case work?

student
0 Kudos
Message 3 of 3
(2,820 Views)