From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

DIAdem - ChnResampleFreqBasedXOffsetCalc2 using script record - not working

in DIAdem 2017 -

I have two groups open in the DIAdem data portal.

While recording the script, I am using  Analysis --> Channel Functions --> Synchronize data from different files and the files were synchronized correctly using the Synchronization Channel from each of the two groups.

I stopped the recording at this point, closed the data files without saving, reopened both groups in the same order and this time ran the recorded script and it gave the error below. "Invalid Channel in command " ChnResampleFreqBasedXOffsetCalc2" (Parameter: 5).

 Error.jpg

 

 

0 Kudos
Message 1 of 6
(2,752 Views)
It looks like the error is associated with the time channel of the second measurement. Could you post the VBScript code you are working with?

 

0 Kudos
Message 2 of 6
(2,702 Views)

Call ChnResampleFreqBasedXOffsetCalc2("","[1]/MyChn1","'[1]/MyChan1' - '[1]/MyChan1580'",-122.593710240099,"[2]/","

[2]/Chnset17","'[2]/Chnset1' - '[2]/Chnset1350'",0,1,"Automatic",10,"Automatic",0,0)

 

This is the single line in the script from TeachIn using Script Record function..

 

MyChn1 (from group 1) and Chnset17 (from group2) are channels for sync 

First group has 1580 channels and second group has 1350 channels 

 

Both groups have waveform channels with Waveform x-offset = 0 and Waveform x-step width = 0.1

 

The length of waveform channels between the two groups is different. 

   - First group have few channels which have different length than the majority of other channels in that group

   - all channels in second group have same length

 

 

0 Kudos
Message 3 of 6
(2,690 Views)

Hi Bhole_Amit_P@cat.com,

 

Are you able to post that data set that your script code goes with?  I'm not surprised that all the output data files have the same length, if you're processing them at the same time with one function call, but it would help to see the data in order to try out multiple function calls and see if I can get the results you need.  Also, I'd like to test the script with actual data, because I'd like to change from the channel range syntax the Script Recorder used to the more modern and easier to debug object syntax.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 4 of 6
(2,681 Views)

Brad,

Thanks for the reply..

I will send you the data set by email.

FYI, I modified the original data set however I am still able to replicate the exact same issue.

 

Thanks,

Amit

0 Kudos
Message 5 of 6
(2,666 Views)

Also, I found another issue (if you were not expecting this behavior)

DIAdem 2017 ->

"Analysis --> Channel Functions --> Synchronize data from different files" does not work with two groups in the same file unless they are directly coming from two different files.

 

I understand that "Synchronize data from different files" specifically calls for different files, however if not sure why its not able to pick two different groups as they have independent waveform start time.

0 Kudos
Message 6 of 6
(2,662 Views)