Class ChanAit
Version 1.0
Modified 26-MAY-2023 14:29:26.00
 Configures an analog input channel independent of the
 type of physical Ai-card. The conversion from signal
 value to actual value is done by means of a table.

 SigValue is converted to ActualValue via sensor
 function s, table t and filter function f according to,

 ActualValue = f ( t( s(SigValue) ) ) , where the choice of

 -- sensor function s, is determined by SensorTypeCode
 -- table t, is determined by SensorPolyType
 -- filter function f, is determined by FilterType in Ai object

 The table t is defined in one of the following ways:

 - Direct input of NoOfCoordinates pairs of numbers (InValue,O
   arranged in order of increasing InValue. The first
   and the last InValue specify the allowed interval of
   s(SigValue).
 - By specifying the coefficients PolCoefficients in a
   polynomial of maximum degree 7 and the maximum and
   minimum values of s(SigValue). By a menu procedure,
   not implemented, the interval between the minimum and
   maximum values will be divided into 29 equidistant
   intervals, which results in 30 s(SigValue)-values.
   Thereafter ActualValue of these points is calculated,
   and the pairs of numbers (InValue,OutValue) can be
   filled-in.

 In practice, the function t ( s(SigValue) ) will be put
 in by means of the menu handling. When the transfer
 function is defined, the Intercept(n) respectively
 Slope(n) for each point are decided by request; see
 figure above.
 In the target environment the following occurs with the
 SigValue:

 - If SigValuemin <= s(SigValue) >= SigValuemax , then
    - the index n is calculated as
              SigValue(n) = s(SigValue) < SigValue(n+1)
    - t( s(SigValue) ) = Intercept(n) + Slope(n)* s(SigValue)
 - otherwise, t( s(SigValue) ) = OutValue for the first
   or the last pair of numbers depending on
   s(SigValue) < s(SigValuemin) or s(SigValuemax) > s(SigValuemax)

 As the menu handling is not implemented yet we manually
 put in, for each NoOfCoordinates, the corresponding
 pair of numbers (InValue, OutValue ) respectively (Intercept, Slope).

 ChanAit objects are configured below a suitable card
 object.

See also


RtBody attributes pwr_sClass_ChanAit
String80 Description   Optional text, for example to describe the channel or
its employment.
AttrRef SigChanCon   Name of a signal object, i.e. Ai object, connected with
the channel object.
String40 Identity   The identity of the channel. Optional, for example Ai0
to denote the first channel, physical cable marking,
etc.
UInt16 Number   The Number attribute is used to associate the ChanAit
object to a fixed channel on the card named by
SigChanCon. The physical channels of the card are
numbered in the interval {0,1, ... , (MaxNoOfChannels-1)},
where MaxNoOfChannels is an attribute in the card
object.
The channels of the card are numbered according to the
instructions of the card manufacturer.
Boolean ConversionOn   Specifies if the RawValue should be updated or not.
FALSE means no updating; TRUE means RawValue should be
updated at the period of ScanInterval.
UInt32 ScanInterval   Specifies, in relation to the period T0, how often
RawValue will be read in and converted to ActualValue.

The IO job handles local Ai-signals by the period T0 =
CycleTimeBus and remote signals by the period T0 =
CycleTimeSerial; (see IOHandler).
ScanInterval have to be >= 1.

RawValue will be updated by the period: ScanInterval * T0
Boolean CalculateNewCoef  
Float32 RawValRangeLow  
Float32 RawValRangeHigh  
Float32 ChannelSigValRangeLow  
Float32 ChannelSigValRangeHigh  
Float32 SigValPolyCoef0  
Float32 SigValPolyCoef1  
String16 SigValueUnit   Engineering unit for SigValue.
UInt16 SensorTypeCode   The signal value can be adjusted by a sensor function
before conversion to ActualValue. The possible types of
sensor functions s are:

-- 0 Normal case: s(SigValue) = SigValue
UInt16 SensorPolyType   Specifies in which way SigValue will be converted to
ActualValue. The possible types of conversions are:

-- 0 No conversion: t ( s(SigValue) ) = s(SigValue)
-- 1 Conversion via table: t ( s(SigValue) ) = table function( s(SigValue) )

SigValue belong to the Ai object.
UInt16 NoOfCoordinates   The number of coordinates (InValue, OutValue ) in the
table. At least 2 and maximum 30.
Array of Float32 InValue   s(SigValue).
Array of Float32 OutValue   t ( s(SigValue) ).
Array of Float32 Intercept   Offset.
Array of Float32 Slope   Slope. Intercept[n] and Slope[n] are associated with
the point (InValue[n], OutValue[n]). n is the current
coordinate.
Array of Float32 PolCoefficients   Polynomial coefficients to convert a sensor function of
maximum seventh degree to a conversion table.
Boolean PolUsedFlag   Specifies if the table (InValue[n], OutValue[n]) has
been created by means of a polynomial or if the
coordinates have been written point by point. FALSE
means a manual input operation, at which input and
output values of every coordinate have been defined.
TRUE means a table that has been created indirectly by
a specified polynomial.
Time Date   Specifies when the table was last changed.
String16 Signature   Specifies who changed the table last.
DataRepEnum Representation   Specifies the data representation of the raw value.


Template Object
ConversionOn 1
ScanInterval 1
SensorTypeCode 0
SensorPolyType 1
ChannelSigValRangeLow -10
ChannelSigValRangeHigh 10
SigValueUnit V


Attributes detail


Description Attribute
Klass Attribute
Typ String80
Flags
Kropp RtBody
 Optional text, for example to describe the channel or
 its employment.

SigChanCon Attribute
Klass Attribute
Typ AttrRef
Flags STATE | INVISIBLE
Kropp RtBody
 Name of a signal object, i.e. Ai object, connected with
 the channel object.

Identity Attribute
Klass Attribute
Typ String40
Flags
Kropp RtBody
 The identity of the channel. Optional, for example Ai0
 to denote the first channel, physical cable marking,
 etc.

Number Attribute
Klass Attribute
Typ UInt16
Flags
Kropp RtBody
 The Number attribute is used to associate the ChanAit
 object to a fixed channel on the card named by
 SigChanCon. The physical channels of the card are
 numbered in the interval {0,1, ... , (MaxNoOfChannels-1)},
 where MaxNoOfChannels is an attribute in the card
 object.
 The channels of the card are numbered according to the
 instructions of the card manufacturer.

ConversionOn Attribute
Klass Attribute
Typ Boolean
Flags
Kropp RtBody
 Specifies if the RawValue should be updated or not.
 FALSE means no updating; TRUE means RawValue should be
 updated at the period of ScanInterval.

ScanInterval Attribute
Klass Attribute
Typ UInt32
Flags
Kropp RtBody
 Specifies, in relation to the period T0, how often
 RawValue will be read in and converted to ActualValue.

 The IO job handles local Ai-signals by the period T0 =
 CycleTimeBus and remote signals by the period T0 =
 CycleTimeSerial; (see IOHandler).
 ScanInterval have to be >= 1.

 RawValue will be updated by the period: ScanInterval * T0

CalculateNewCoef Attribute
Klass Attribute
Typ Boolean
Flags
Kropp RtBody

RawValRangeLow Attribute
Klass Attribute
Typ Float32
Flags
Kropp RtBody

RawValRangeHigh Attribute
Klass Attribute
Typ Float32
Flags
Kropp RtBody

ChannelSigValRangeLow Attribute
Klass Attribute
Typ Float32
Flags
Kropp RtBody

ChannelSigValRangeHigh Attribute
Klass Attribute
Typ Float32
Flags
Kropp RtBody

SigValPolyCoef0 Attribute
Klass Attribute
Typ Float32
Flags INVISIBLE | STATE
Kropp RtBody

SigValPolyCoef1 Attribute
Klass Attribute
Typ Float32
Flags INVISIBLE | STATE
Kropp RtBody

SigValueUnit Attribute
Klass Attribute
Typ String16
Flags
Kropp RtBody
 Engineering unit for SigValue.

SensorTypeCode Attribute
Klass Attribute
Typ UInt16
Flags
Kropp RtBody
 The signal value can be adjusted by a sensor function
 before conversion to ActualValue. The possible types of
 sensor functions s are:

  -- 0    Normal case:  s(SigValue) = SigValue

SensorPolyType Attribute
Klass Attribute
Typ UInt16
Flags
Kropp RtBody
 Specifies in which way SigValue will be converted to
 ActualValue. The possible types of conversions are:

  -- 0   No conversion:              t ( s(SigValue) ) = s(SigValue)
  -- 1   Conversion via table:   t ( s(SigValue) ) = table function( s(SigValue) )

 SigValue belong to the Ai object.

NoOfCoordinates Attribute
Klass Attribute
Typ UInt16
Flags
Kropp RtBody
 The number of coordinates (InValue, OutValue ) in the
 table. At least 2 and maximum 30.

InValue Attribute
Klass Attribute
Typ Array of Float32
Flags ARRAY
Elements 30
Kropp RtBody
 s(SigValue).

OutValue Attribute
Klass Attribute
Typ Array of Float32
Flags ARRAY
Elements 30
Kropp RtBody
 t ( s(SigValue) ).

Intercept Attribute
Klass Attribute
Typ Array of Float32
Flags ARRAY
Elements 30
Kropp RtBody
 Offset.

Slope Attribute
Klass Attribute
Typ Array of Float32
Flags ARRAY
Elements 30
Kropp RtBody
 Slope. Intercept[n] and Slope[n] are associated with
 the point (InValue[n], OutValue[n]). n is the current
 coordinate.

PolCoefficients Attribute
Klass Attribute
Typ Array of Float32
Flags ARRAY
Elements 8
Kropp RtBody
 Polynomial coefficients to convert a sensor function of
 maximum seventh degree to a conversion table.

PolUsedFlag Attribute
Klass Attribute
Typ Boolean
Flags
Kropp RtBody
 Specifies if the table (InValue[n], OutValue[n]) has
 been created by means of a polynomial or if the
 coordinates have been written point by point. FALSE
 means a manual input operation, at which input and
 output values of every coordinate have been defined.
 TRUE means a table that has been created indirectly by
 a specified polynomial.

Date Attribute
Klass Attribute
Typ Time
Flags
Kropp RtBody
 Specifies when the table was last changed.

Signature Attribute
Klass Attribute
Typ String16
Flags
Kropp RtBody
 Specifies who changed the table last.

Representation Attribute
Klass Attribute
Typ DataRepEnum
Flags
Kropp RtBody
 Specifies the data representation of the raw value.