LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Text file based on PC time

 

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,

Download All
0 Kudos
Message 1 of 11
(3,520 Views)

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

0 Kudos
Message 2 of 11
(3,494 Views)

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,

Download All
0 Kudos
Message 3 of 11
(3,481 Views)

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

0 Kudos
Message 4 of 11
(3,471 Views)

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.

 

 

 

 

 

 

 

Download All
0 Kudos
Message 5 of 11
(3,464 Views)

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.

 

 

0 Kudos
Message 6 of 11
(3,459 Views)

Hello everybody,

 

No idea?I am wondering if you could give me some hint.

0 Kudos
Message 7 of 11
(3,429 Views)

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

0 Kudos
Message 8 of 11
(3,404 Views)

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!

0 Kudos
Message 9 of 11
(3,393 Views)

Any idea?

0 Kudos
Message 10 of 11
(3,369 Views)