DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

ChnWfxUnitConvert does not refresh Minimum and Maximum

Solved!
Go to solution

If I run this script on EXAMPLE date that comes with DIAdem, so 2. ChannelGroup in some Noise:

 

call ChnWfxUnitConvert(Data.Root.ChannelGroups(2).Channels(1),Data.Root.ChannelGroups(2).Channels(1),"ms")

logfilewrite Data.Root.ChannelGroups(2).Channels(1).Maximum
logfilewrite Data.Root.ChannelGroups(2).Channels(1).Minimum

 

It rerutns "NOVALUE" and "NOVALUE"

How can I refresh Min and Max props?

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

You did not choose the right method.

call UnitConvert(Data.Root.ChannelGroups(2).Channels(1),Data.Root.ChannelGroups(2).Channels(1),"ms")

will change the channel unit.

If min max is not changed

call ChnCharacter(Data.Root.ChannelGroups(2).Channels(1))

can be used to recalculate the values.

 

P.S.: If you activate the macro recorder and change the unit in dataportal the command shows up in script.

 

Message 2 of 4
(3,297 Views)

Your metod changes unit of channel, but I need to change X part of waveform channel.

So I used ChnWfxUnitConvert, which does not recalculate characteristic values and ChnCharacter did the job.

 

Thank you.

0 Kudos
Message 3 of 4
(3,267 Views)

Hi Radek_Codr,

 

Just to be clear here, the Channel.Minimum and Channel.Maximum properties, which were previously CMin(Channel) and CMax(Channel), contain the extrema of the Y values of that channel.  There is no standard Channel property which stores the maximum X value of a channel.  ChnCharacter() will update the Y value extrema properties only.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

Message 4 of 4
(3,246 Views)