09-18-2024 04:38 PM
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?
09-18-2024 07:01 PM
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.
09-19-2024 01:17 PM
Sorry it took me a while. I have saved the code in 2020 version.
09-19-2024 01:40 PM - edited 09-19-2024 01:53 PM
@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!
09-19-2024 01:52 PM
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!
09-19-2024 03:21 PM
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?
09-20-2024 12:41 AM
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!