DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How to identify sing ploarity of a channel

Hi,

 

how do i identify sign ploarity of a channel? i need it because if sign is negative i have to multiply it with -1 before plotting.

Please help me on this?

 

Thanks,

Sunil Padikar M

0 Kudos
Message 1 of 2
(3,994 Views)

Hi sunil,

 

This could depend on the shape of your data channel.  Often if your polarity is negative, then the channel's minimum will have a greater absolute value than the channel's maximum, like this:

 

Set Channel = Data.Root.ChannelGroups(1).Channels("Speed")
IF Abs(CMin(Channel)) > Abs(CMax(Channel)) THEN
  Call ChnLinScale(Channel, Channel, -1, 0)
END IF

 

Another approach that is sometimes appropriate is to just take the absolute value of the whole channel, like this:

 

Set Channel = Data.Root.ChannelGroups(1).Channels("Speed")
Call Calculate("RawCh = Abs(RawCh)", Array("RawCh"), Array(Channel))

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 2 of 2
(3,967 Views)