10-28-2012 01:00 PM - edited 10-28-2012 01:17 PM
Hello everybody,
I am trying to write real-time data in a text file based on PC time. I have attached my program. The problem is that time column has pc time only for some points and the rest or missed. I have done the same program for another VI file and I didn't face with this problem. I have attached both textfiles. Any suggestion and help would be appreciated.
Warm Regards,
10-28-2012 01:25 PM
It is almost impossible to diagnose the problem from an image of a portion of a diagram, especially one containing Express VIs.
My suspicion is that your program is working just fine and that you get 500 ms of data on the ECG and Cuff Pressure lines on eahc iteration of the loop. If you look through the output.txt file you will see that a timestamp is written about every half second. If your data is being acquired continuously, you really only need the timestamp at the beginning (T0). The time of any other sample is simply the T0 plus dt*sample index.
The other program was probably returning one data point at a time.
You have some strange constructs: False constant connected to Not connected to AND? The output of the AND is always equal to the other input. Your Latch stays True after the first time the input becomes True. The only way to reset it is to close the VI.
You could multiply the signal by the Pressure Calibrator value on time then index out the first element later.
Lynn
10-28-2012 03:12 PM - edited 10-28-2012 03:13 PM
Thanks for prompt reply.
My goal is to do synchronization between two signals from this VI and one signal from other VI so I am trying to have both of text.file based on PC time and then try to run two VI at the same time.
I would like to have ECG and PPG data also same as the other one.
I mean want to have time stamp for those 500ms of data also.
Thanks in advance for your answer.
Warm Regards,
10-28-2012 03:22 PM
Synchronizing at the file level is likely to have significant amounts of time jitter due to OS latencies. It is far better to synchronize at the data acquisition hardware level. You also do not have any idea when the Get Date Time function executes relative to the data acqusition or event whether the relationship is consistent from run to run.
Please post you entire program and perhaps someone will be able to suggest somethng to meet your requirements. How much time jitter can you tolerate between the various signals?
Lynn
10-28-2012 03:56 PM - edited 10-28-2012 03:57 PM
So many thanks.
Actually it is not possible to do synchronization at hardware level since there are two different devices for each VI.
Regarding time jitter about 1-10 ms is ok.
I have attached both programs.
10-28-2012 04:06 PM
I would like to add that in one program the following module has been used :
-NI 9239 (4-Channel, 24-Bit Analog Input Module)
-NI 9263(4-Channel, 100 kS/s, 16-bit, ±10 V, Analog Output Module)
for the other one, device is connected to the serial port.
10-29-2012 10:36 AM
Hello everybody,
No idea?I am wondering if you could give me some hint.
10-29-2012 12:49 PM
What kind of device is connected via the serial port. What is its sampling rate? Does it have any unused channels or any kind of electrical output signals (other than the RS-232)?
What sampling rates are you using with the NI 9239 and NI 9263? Are all the channels used on those devices?
Lynn
10-29-2012 02:23 PM
For the first device connected through Serial port, sampling rate is 100 HZ, and there is only one output for this device.
About second one, sampling rate for those two modules is 2000 HZ.and two chanels has been used.
Thanks!
10-30-2012 10:22 AM
Any idea?