DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Script being ignored

Solved!
Go to solution

I am trying to run a series of scripts in order to load data, clean it, run some calculations then chart it.

 

I have a cleaning routine that is getting "ignored." When I use F5 to Run Script, the channel does not get cleaned per the code. When I use Ctrl F5 or Debug, then it cleans just fine. If I pull that subroutine out and run in a new script by itself, it works fine.

 

Why does DIAdem ignore my cleaning subroutine? Debugging is difficult since anytime I debug, it works fine.

 

Note I'm running DIAdem 2015.

0 Kudos
Message 1 of 4
(1,281 Views)

Hi DIAdemUser81,

 

Please note that <F5> in the DIAdem SCRIPT panel is the same as clicking the "Debug/Continue" icon at the top of the SCRIPT panel to run with debugging engaged.  When you press <Ctrl-F5>, that is the same as clicking the "Run Script" icon at the top of the SCRIPT panel to run without debugging.

 

It would really help in identifying the source of your troubles if you could show us more of this part of your code that is being ignored.  Is it part of an IF/THEN branch or in a Sub or Function or Class?  How is it being called?  Can you send or post the script for us to look at?

 

Brad Turpin

Principal Technical Support Engineer

National Instruments

0 Kudos
Message 2 of 4
(1,203 Views)

I figured it out! The Channel Characteristics were not updated. For reference, the script was roughly as follows. I use that If statement because I'll occasionally have bad data full of NoValues and this catches that for me. However, I found ChnValMin and ChnValMax in the case of this one file was giving blanks. I added Call ChnCharacter(L1) prior to the If statement and that seems to have covered it.

 

L1 = Cno("ChannelofInterest")

 

If ChnValMax(L1) <> ChnValMin(L1) Then

    Do some things

End If

0 Kudos
Message 3 of 4
(1,191 Views)
Solution
Accepted by topic author DIAdemUser81

Hi DIAdemUser81,

 

A while ago DIAdem changed from its longstanding behavior to always calculate the channel characteristics every time a channel was loaded, to now having that action be optionally selectable (DIAdem settings), with the default being that it does not happen.  I'm not sure why there was a difference here between running the script with debugging or without debugging, but for folks with longstanding code this is a behavior change in DIAdem that is useful to remember.

 

The use case where it's best to delay the calculation is when loading more data channels than you really want to look at-- say loading all 200 channel from a file when you only want to look at 5 of them.  For very long channels in the millions of values, running those additional 195 channel characteristics calculations can add up to a significant delay.

 

Brad Turpin

Principal Technical Support Engineer

National Instruments

0 Kudos
Message 4 of 4
(1,172 Views)