LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get real-time and add to my array everytime a sample is collected?

Hello, I am beginner with labview. I have an existing code that collects the voltage and converts it into temperature values. I want to record the date and time when a sample  is collected. As of now the code uses 'High resolution relative seconds'. I tried changing it to 'Get Date/Time in seconds'. But I get an error that the type of source is time stamp and the type of sink is dynamic data. Can someone please help with this?

0 Kudos
Message 1 of 7
(202 Views)

Most forum members don't have access to the latest version of LabVIEW. Please save your VI in an earlier version (File >> Save As Previous Version), preferably in 2020.

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 2 of 7
(176 Views)

Sorry it took me a while. I have saved the code in 2020 version. 

0 Kudos
Message 3 of 7
(145 Views)

@Jay1000 wrote:

Sorry it took me a while. I have saved the code in 2020 version. 


I have no LabVIEW version at all on my phone but...

 

You said dynamic data type. That means that you are probably using a DAQ Express VI.  Careful rolling of my Magic 8-Ball( ~~~Oh 8-Ball could the poster ... etc.) Tells me to tell you to use a DAQMx "Scale" on your Analog Input "Channel" to get units of temperature straight-away from the DAQMx Read.

 

After that we might want to know how and if you want to display that information (or simply log it to a file with no user display)

 

And, Jay,  choose a numeralific in a recent eon!  Jay1000 seems outdated 😀. Or is that -J as INT4? That's cool then!


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 7
(139 Views)

Hi Jay,

 


@Jay1000 wrote:

 As of now the code uses 'High resolution relative seconds'. I tried changing it to 'Get Date/Time in seconds'. But I get an error that the type of source is time stamp and the type of sink is dynamic data. Can someone please help with this?


Because YOU use two ExpressVIs (MergeSignals, FromDDT) to build an array!

Why don't you use an array function to do the same? There is a BuildArray function: guess what its for…

 

You can use GetDatTime followed by ToDBL, but you will get the number of seconds since LabVIEW epoch (as explained in the LabVIEW help).

 

The better solution would involve to convert the TimeStamp to a formatted string (as well as convert those thermistor readings) and use the string variant of the WriteDelimitedFile function!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 7
(129 Views)

Thank you! I am a beginner so I did not understand your answer fully. I think from your response the simplest answer is to use 'GetDatTime' to get the elapsed time in seconds. (Did you mean "Get Date/Time in seconds") In that case I just have to get the realtime at the very beginning of the run and then add the seconds to get the corresponding real time. Is that right?

0 Kudos
Message 6 of 7
(117 Views)

Hi Jay,

 


@Jay1000 wrote:

I think from your response the simplest answer is to use 'GetDatTime' to get the elapsed time in seconds. (Did you mean "Get Date/Time in seconds") In that case I just have to get the realtime at the very beginning of the run and then add the seconds to get the corresponding real time. Is that right?


What exactly do you want to log? Is it the absolute timestamp or is it a relative "elapsed time" value?

 

For the absolute timestamp I already recommended to go to string formatting.

For the elapsed time you should not "add the seconds", but get the difference between two timestamps!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 7
(98 Views)