05-18-2020 07:43 AM
Is it possible to extract a 128 bit number (ie LabVIEW timestamp) from a binary data file using a plugin?
Thanks,
Andrew
05-18-2020 10:01 AM - edited 05-18-2020 10:01 AM
...
05-19-2020 02:06 PM
I assume there is no 128 bit number retriever.
If it is a LabVIEW time you can access tow i64.
The first one is seconds till 1904.
The second one is fractions of seconds in 1/2^64
If you are just interested in the seconds this might help.
05-20-2020 10:31 AM
Thanks AndreasK. For clarification, are you saying when a LabVIEW timestamp is converted to binary the first half (upper I64) is the time since 1904 and the second half (lower I64) is the fractions of seconds? Is there a way to combine the two and create one channel in DIAdem that shows the full Date and Time with fractions of seconds?
TIA,
Andrew
05-22-2020 02:52 PM
Hey Andrew,
What NI software and software version are you wanting to use the DataPlugin with? If the file was written with LabVIEW, do you happen to already have a VI that reads the binary data file? It is possible to create a DataPlugin with native LabVIEW code...
Brad Turpin
Senior Technical Support Engineer
National Instruments
05-26-2020 07:23 AM
Hi Brad,
I am writing this plugin for a coworker that is working on the LabVIEW piece of this project. I believe he has a working VI to read in his binary files. I would be interested in learning how to create a plugin with LabVIEW.
On a side note, I was able to read the date and time from the file using an I64 but when trying to read the fractions of seconds I got an error stating a U64 was not a valid datatype. When trying an I64, I can read the fractions of a second but they are not always correct (signed vs unsigned issue). Is there a way to read the 64 bits unsigned? Or can I convert a signed data block to unsigned?
Thanks,
Andrew
05-26-2020
05:32 PM
- last edited on
06-10-2025
03:40 PM
by
Content Cleaner
Hi Andrew,
There is an option to declare a U64 binary data type in a DirectAccessChannel in a VBScript DataPlugin. You can also choose to declare a certain byte range as one DirectAccessChannel and a different byte range as a second DirectAccessChannel, in case the fractional time value is stored in a particular byte range. Bitmasking is also a possibility, as is combining the values of two separate DirectAccessChannels using a "ProcessedChannel".
If you want to try the LabVIEW DataPlugin option, you should know that there are some ugly compatibility problems that surfaced with LabVIEW DataPlugins and the 2019 versions of DIAdem and SystemLink (DataFinder), and these problems will persist. A planned LabVIEW 2020 DataPlugin SDK is supposed to resolve these incompatibilities moving forward. What version of LabVIEW are you guys using in this project? What software products do you want to run the DataPlugin in, and what release versions are they? Here are the currently released versions of the LabVIEW DataPlugin SDKs:
https://www.ni.com/en/support/downloads/tools-network/download.labview-dataplugin-sdk.html
Brad Turpin
Senior Technical Support Engineer
National Instruments
05-27-2020 07:57 AM
Brad,
Currently, we are using LabVIEW 2019 (64-bit) and DIAdem 2018 (64-bit). The plugin will be run in DIAdem only.
Also, attached is a snippet of the plugin I have been trying to get working. When I change "eI64" to "eU64" on line:
Set otimefract = BlockTfract.Channels.Add("FractionofSec", eI64)
I get an invalid datatype error. How do I declare otimefract as a U64?
Thank you,
Andrew
05-27-2020 11:25 AM
Hi Andrew,
The "eU64" datatype parameter designation is the correct way to indicate 64bit unsigned integer interpretation. I'm not sure why that's failing on your end. Could you send me the error message you get or a data file I can try your DataPlugin on?
Please note that when you use the ProcessedChannel to add two numeric channels together you are still constrained by the datatype of the ProcessedChannel-- in this case the best option is the eR64 you chose. So even though the datetime value is stored in a 64bit integer and the fractional time is stored in a 64bit integer, if we succeed in adding these two components together, we'll be stuffing them into an eR64, which has only about 53 bits of resolution. Effectively this will be like the old LabVIEW DBL implementation of datetime values from circa LabVIEW 6.0 or earlier.
Brad Turpin
Senior Technical Support Engineer
National Instruments
05-27-2020 11:40 AM
Thanks Brad.
Here is the error I get. If useful, I am using DIAdem 2018 SP1 64-bit.
On a related note, why doesn't eTime work as the datatype? Isn't that 128 bit?
Thank you for looking into this.