DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Copying time channel entries

Solved!
Go to solution

 

Hi,

I am trying to copy selected rows of a time channel ('Time') to another time channel ('NewTime'). 

However, the copied values are different from the original ones.  An example is: -

 

TimeChannel.PNG

 

My script is: -

Script.PNG

 

I suspect I am seeing a resolution limit, but then the original channel displays ok....

(1) How can I get an exact copy of an entry?

(2) Is there a more elegant (or more correct) method than that which I have used?

(3) The original channel ('Time') is from measurements with a sample rate of 10 microseconds.

This time channel was created by splitting a recorded waveform using  WfChnToChn

The microseconds appear to be 'lost' in the channel display - normal?

 

I am using Diadem 2015   15.0.2f6347 service pack 2, (64 bit)

 

Thanks in advance for any help

Thomas

 

 

 

 

 

 

0 Kudos
Message 1 of 7
(3,203 Views)

Hi mme,

 

This is one option:

dim oGroupChn, oChnTOld, oChnTNew, iStart, iStop, iLoop, iIdx

set oGroupChn = Data.Root.ChannelGroups(1).Channels
set oChnTOld  = oGroupChn("TimeOld")
set oChnTNew  = oGroupChn.Add("TimeNew", DataTypeChnDate)

iStart        = 10
iStop         = 100
iIdx          = 0

for iLoop = iStart to iStop
  iIdx = iIdx + 1
  oChnTNew(iIdx) = oChnTOld(iLoop)
next

Greetings

Walter

0 Kudos
Message 2 of 7
(3,181 Views)

Hi Thomas,

As of DIAdem 2017, losing microseconds and even tenths of microseconds is normal for DIAdem.

 

For copying multiple datetime rows from one channel to another, you should try the DataBlCopy() function.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 3 of 7
(3,157 Views)

Hi Brad,

 

Are the microseconds really lost or is it that they are there, but just not visible?

Thanks

Thomas

0 Kudos
Message 4 of 7
(3,127 Views)
Solution
Accepted by topic author mrme

Hi Thomas,

 

As of DIAdem 2017, the maximum resolution of a DIAdem datetime value is:

#mm/dd/yyyy hh:nn:ss.ffff

 

So any resolution smaller than a tenth of a millisecond is lost when the data is sent to the Data Portal.  R&D is looking into ways of addressing this for future versions of DIAdem, but we have no commitments yet.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 5 of 7
(3,100 Views)

Hi Walter,

 

Thanks! It works for me.  Some resolution as explained by Brad.

 

Thomas

0 Kudos
Message 6 of 7
(3,080 Views)

Hi Brad,

Thanks for the explanation.  It is clearer now.

 

Thomas

0 Kudos
Message 7 of 7
(3,078 Views)