10-03-2008 05:11 AM
Hi
I am using HWS format to store files on PXI-RT.
I use the HWS Set Attribute vis to set the waveform details, during logging.
The attributes i set are: Waveform Name and Y-axis label.
I get an error '-21572' (invalid timestamp) when i try to read the 'Timestamp' attribute using 'Get Wfm Attribute' function. I have not explicitly set the timestamp while writing to the files. could this be a reason for the error?
I have not found any material on this error code. Kindly someone explain to me, why i get this error.
Thank you
10-03-2008 09:33 AM
The timestamp field in the file is only auto-created if the data you are writing to the file has a timestamp in it. In LabVIEW, only the Analog Waveform Data type and the Digital Waveform Data type controls contain a timestamp. If you are using one of these data types, then NI-HWS will use the timestamp from the data to create the timestamp field.
My guess is that you are streaming to disk using binary data or just an array of analog values (no To or dT info). Therefore NI-HWS is not creating the timestamp field. If this is the case, you must write the timestamp on your own using the niHWS Set Wfm Attribute VI.
10-06-2008 12:56 AM
Hi
I am writing the waveform data acquried from DAQmx channels, into the HWS file.
So, it has the timestamp information.
10-06-2008 03:26 PM
Hello,
How are you retreiving the "timestamp" from the waveform data? If you are doing this with the "Get Waveform Attribute" VI and using the string "Timestamp", you will probably not get back anything unless that attribute has been set. What is is that you are attempting to do here? If you are wanting to get the data's starting timestamp, you can do this with the Get Waveform Components VI, which will give you both the t0 and the delta t that you will need. Use this VI to get the starting timestamp once you have read the analog waveform from the HWS file.
I am not sure why it would give you an invalid timestamp error. I am suprised that it would give you any error at all. In a Windows system, if the attribute is not available, it doesn't appear that this VI will return any error, so it may be due to the RT system. I am not sure. In any event, unless you are using the Set Waveform Attribute VI when writing the waveform to a file, I wouldn't expect to see any attributes when using the Get Waveform Attribute. DAQmx will give the waveform a timestamp, but this is part of the waveform's data, not it's attributes.
10-06-2008 10:16 PM
Well!!
Even I was as surprised as you when I faced the issue.
I do not see a reason to set the attribute, before reading it. Timestamp is automatically obtained when the data is written to a file. I had been using the same attribute earlier, and faced no issues. The only solution I see is to read the data and use 'get waveform components' function, though I see no reason to get this error message.
Thanks
10-06-2008 11:25 PM
Hi
After trying to read the timestamp from the waveform component, i realized that the HWS file does not give me the correct timestamp.
this is what i did:
Write a hws file with simulated sine wave. Ensure that the waveform timestamp is set to current time.
Read the hws file and get the timestamp component of waveform using ' get waveform component'. I end up with '5.30.00 AM 1/1/1904'.
I tried the same with DAQmx acquisition from two channels. Acqurie data on RT, write it into a HWS file, read the file on Host. I end up with the same default timestamp.
also, when i plot the read data on a graph, i do not see the data when i uncheck 'Ignore Timestamp' on the graph properties. I see the correct data when i check 'Ignore Timestamp'.
Can someone help me out?
Thanks
10-07-2008 04:16 PM - edited 10-07-2008 04:18 PM
Hello,
I attempted to reproduce what you were seeing using LV RT 8.5 and a PXI 8186. I didn't have any analog hardware, so I simulated a device and ran the following VI:
Then I FTP'd into the system and downloaded the hws file and ran the following VI on it:
It seems like the timestamp is able to be saved to the hws file and seen by the VI that reads this file. Are there any errors that are occurring when you write the file in the RT system? If there were an error when trying to get the timestamp of the waveform by the hws VIs, then it may default the timestamp to what you are seeing. You said that you verified that the waveform timestamp is the current time, is the current time reflected by other timing VIs like Get Date/Time In Seconds? It could be that the clock on the RT system is not being read correctly, either by the DAQ task, or by the HWS writing VIs.
10-07-2008 11:37 PM
Hi
Thanks for the details given.
I i am externally setting the date and time on RT, by sending the same from Host. The timestamp on the 'current time' output, on the Waveform graph match (on RT). While i write the data into the HWS file, i can see the same timestamp (by probing) as on the waveform graph. i do not get any error message. I am not setting any timestamp attribute.
I have not faced this problem earlier. This problem popped up recently, over the last few days.
I shall try using this example code and check.
Thanks again.
10-07-2008 11:39 PM
Hi
Forgot to mention one thing.
I see the data which is written into the file. I just do not get the timestamp. I get any other attribute that i set (say, Y-axis label, Note)
10-15-2008 11:40 AM
Hello,
Do you mind posting the code that you are using to write and read the file? Also, how are you transferring the file to the host? Are you using ftp to grab the file off of the RT machine, or are you transferring it some other way? Finally, what versions of LabVIEW are you using, and are you using the same versions of HWS on both machines?