From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
11-01-2007 06:19 PM
11-02-2007 01:32 PM
11-03-2007 02:26 PM
11-05-2007 10:54 AM
Hi jsmalley,
Are you assigning your channels values one by one in the DataPlugin with Root.ChannelGroups(1).Channels(1).Values(i) = CDbl(ValueVariable), or are you using a String or Binary Block and a DirectAccessChannel? It is possible to assign individual CDate(ValueVariable) values to a channel in the DataPlugin. It is also possible to assign a string block of DirectAccessChannel values as native datetime values, but it is not possible to assign a binary block of DirectAccessChannel values as native datetime values-- for that you have to go the eR64 route that you have discovered.
Brad Turpin
Product Support Engineer
National Instruments
11-05-2007 11:10 AM
11-06-2007 08:45 AM
Hi jsmalley,
You have two native ways of getting a scaler datetime object in a DataPlugin, which you can then assign to an "eTime" channel value by value. If you are reading in a datetime string (01/05/1999 12:23 am), then you can use the following syntax:
Set DateValue = File.Formatter.ParseString(StringValue, eTime)
If, alternatively, you are individually reading out the components of the datetime value (Years, Months, Days, Hours, Minutes, Seconds, Milliseconds), then you can use the following syntax:
Set DateValue = CreateTime(Years, Months, Days, Hours, Minutes, Seconds, Milliseconds, Microseconds, Nanoseconds)
In both cases you would assign the datetime value normally, though you have to use the "Set" syntax since you're assigning an object:
Set Root.ChannelGroups(1).Channels(1).Values(1) = DateValue
One footnote here, it is not very efficient to assign channel content value by value. Is there a compelling reason you're not using Blocks and DirectAccessChannels? Also, it's just fine to declare the channel as eR64 and tweak the display format property to be "Time"-- the one drawback with that is that LabVIEW and CVI and MeasurementStudio will not (yet) recognize that channel as a datetime channel, only DIAdem and Excel will.
Brad Turpin
DIAdem Product Support Engineer
National Instruments
11-06-2007 09:26 AM