08-27-2012 11:36 PM - edited 08-27-2012 11:37 PM
@Sunny1290 wrote:
The VISA write and read functions well I get the data what I want.
The only case is I want the speed data that to be plotted on the graph every 2ms or written in the tdms or any type of file in 2ms
So you are sure that you are getting the data every 2 ms through VISA?. What is the hardware you are using? If you are able to read the data at 2ms intervel then its not a problem to write it to a file you can use a seperate while loop to do this by using queue.
08-28-2012 05:52 AM - last edited on 08-28-2012 09:08 AM by MaryH
To log the data every 2ms, you need to know the size of data you are trasferring over serial communication. Suppose, the size of "data to read" you are transferring over serial is 1Mbyte, then at a baud rate of 115200 bits/sec, you could log that data every (1024*8/115200) = 71ms. Since you want to log the data every 2ms, the data you are transferring over serial must be equal to or less than 230.4 bits. If you are not sure of whats the data size you are receiving over the serial port, you could use the VISA functions to find the size of data over the serial port. Now, once you are sure that your data can indeed be logged at 2ms rate with your existing hardware, you just need to make two parallel loops, one for aquiring data and other for logging.
09-06-2012 01:14 AM
Thank you guys.All 3 of you.
09-06-2012 01:14 AM
My bad.
Thanks to all four of you.
10-07-2012 09:01 AM
Hi can anyone please help me on this.....
Regards,
NKR
10-07-2012 10:29 AM
NKR,
You probably should start a new thread as your question has little to do with the this one except that it relates to timing.
You need a different type of program structure. Possibly a state machine or two parallel loops linked via a queue or a notifier.
Lynn