LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I add a time stamp when I acquire data through Serial port?

I have written a program that controls a Mass flow controller (MKS 647c specifically). However, when I try to plot my data, I can only do it flow vs. cycles but I want to keep the time stamp. Later on I will sync this data with a mass spectrometer. I have attached the subvi's and the driver library for the MFC I use.
0 Kudos
Message 1 of 6
(3,946 Views)
Just place a Get Date/Time in Seconds function in parallel with your VISA Reads. Since you are recording DBLs, you can convert the timestamp to a DBL as well. If you want something like MM/DD/YYYY hh:mm:ss in the file, then you need to convert all to strings.
Message 2 of 6
(3,931 Views)

Thanks. That will help when I write to an excel sheet. Can I also apply those time stamps to my XY graph x-axis? How do I do that? I would appreciate a sample diagram if possible.

 

Thanks,

 

0 Kudos
Message 3 of 6
(3,926 Views)

Hi memoman,

 

You can put timestamps in a cluster input for the XY graph. See the attached screenshot.

 

Regards,

Stephen S.

National Instruments
Applications Engineering
Message 4 of 6
(3,871 Views)
I have 4 channels though. I want to put one timestamp for a set of 4 samples from each channel.
0 Kudos
Message 5 of 6
(3,843 Views)

Hi memoman,

 

You should be able to do this by bundling the timestamps and channel values into clusters, and building the clusters into an array, as shown in the attached picture. For more information on XY Graphs, there is an example program in the Example Finder, under Help>>Find Examples...>>Fundamentals>>Graphs and Charts>>XY Graph.vi that shows how to work with these graphs.

 

Regards,

Stephen S.

National Instruments
Applications Engineering
Message 6 of 6
(3,813 Views)