DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

CTNV with x-channel of Waveform

Solved!
Go to solution

Hello,

I have a waveform in DIAdem which is say 30s long. In a script I would like to convert a section of data between say 0s and 4s to NoValues.  If I was doing conversion based on y-values then I would the CTNV function. However I can't a find a way of doing this based on a time interval. I know I can do it in View using the cursors but I need to be able to script it with no user intervention.

Can anyone help please?

Thanks,

Martin

0 Kudos
Message 1 of 3
(5,350 Views)
Solution
Accepted by topic author MartinMcD

Hi Martin,

 

I'm afraid your best bet is to temporarily create a time channel from the waveform properties.  Assuming you're starting with a channel object variable for the YChannel in question, this is what it would look like:

 

ChanList = WfChnToChn(YChannel, TRUE, "WfXRelative")
L1 = CNo(ChanList(0))
L2 = YChannel.Properties("Number").Value
R1 = 0
R2 = 4
Call Calculate("Ch(""New YChannel"") = IIF(Ch(L1)>=R1 AND Ch(L2)<=R2, Ch(L2), Null)")
Call ChnDel(L1)

  

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 2 of 3
(5,327 Views)
Hi Brad,

Thank you very much for the reply. I had forgotten how you could use the variables and IIF function within Calculate to operate on whole channels like that, fantastic.
I made one which I guess was typo to anyone else following which was 'L2 = YChannel'.

Thanks again,

Martin
0 Kudos
Message 3 of 3
(5,314 Views)