| Volume pwrb | |
| Attributes: Runtime | Development | System | Template | Detail C Binding: Struct | Class  ClassTree | INDEX NO INDEX |
Class ChanAit
|
||
|---|---|---|
| Version | 1.0 | |
| Modified | 15-JAN-2025 13:23:36.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. |
|
| String80 | 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 |
| Description Attribute | ||
|---|---|---|
| Class | Attribute | |
| Type | String80 | |
| Flags | ||
| Body | RtBody | |
Optional text, for example to describe the channel or its employment.
| SigChanCon Attribute | ||
|---|---|---|
| Class | Attribute | |
| Type | AttrRef | |
| Flags | STATE | INVISIBLE | |
| Body | RtBody | |
Name of a signal object, i.e. Ai object, connected with the channel object.
| Identity Attribute | ||
|---|---|---|
| Class | Attribute | |
| Type | String80 | |
| Flags | ||
| Body | RtBody | |
The identity of the channel. Optional, for example Ai0 to denote the first channel, physical cable marking, etc.
| Number Attribute | ||
|---|---|---|
| Class | Attribute | |
| Type | UInt16 | |
| Flags | ||
| Body | 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 | ||
|---|---|---|
| Class | Attribute | |
| Type | Boolean | |
| Flags | ||
| Body | 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 | ||
|---|---|---|
| Class | Attribute | |
| Type | UInt32 | |
| Flags | ||
| Body | 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 | ||
|---|---|---|
| Class | Attribute | |
| Type | Boolean | |
| Flags | ||
| Body | RtBody | |
| RawValRangeLow Attribute | ||
|---|---|---|
| Class | Attribute | |
| Type | Float32 | |
| Flags | ||
| Body | RtBody | |
| RawValRangeHigh Attribute | ||
|---|---|---|
| Class | Attribute | |
| Type | Float32 | |
| Flags | ||
| Body | RtBody | |
| ChannelSigValRangeLow Attribute | ||
|---|---|---|
| Class | Attribute | |
| Type | Float32 | |
| Flags | ||
| Body | RtBody | |
| ChannelSigValRangeHigh Attribute | ||
|---|---|---|
| Class | Attribute | |
| Type | Float32 | |
| Flags | ||
| Body | RtBody | |
| SigValPolyCoef0 Attribute | ||
|---|---|---|
| Class | Attribute | |
| Type | Float32 | |
| Flags | INVISIBLE | STATE | |
| Body | RtBody | |
| SigValPolyCoef1 Attribute | ||
|---|---|---|
| Class | Attribute | |
| Type | Float32 | |
| Flags | INVISIBLE | STATE | |
| Body | RtBody | |
| SigValueUnit Attribute | ||
|---|---|---|
| Class | Attribute | |
| Type | String16 | |
| Flags | ||
| Body | RtBody | |
Engineering unit for SigValue.
| SensorTypeCode Attribute | ||
|---|---|---|
| Class | Attribute | |
| Type | UInt16 | |
| Flags | ||
| Body | 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 | ||
|---|---|---|
| Class | Attribute | |
| Type | UInt16 | |
| Flags | ||
| Body | 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 | ||
|---|---|---|
| Class | Attribute | |
| Type | UInt16 | |
| Flags | ||
| Body | RtBody | |
The number of coordinates (InValue, OutValue ) in the table. At least 2 and maximum 30.
| InValue Attribute | ||
|---|---|---|
| Class | Attribute | |
| Type | Array of Float32 | |
| Flags | ARRAY | |
| Elements | 30 | |
| Body | RtBody | |
s(SigValue).
| OutValue Attribute | ||
|---|---|---|
| Class | Attribute | |
| Type | Array of Float32 | |
| Flags | ARRAY | |
| Elements | 30 | |
| Body | RtBody | |
t ( s(SigValue) ).
| Intercept Attribute | ||
|---|---|---|
| Class | Attribute | |
| Type | Array of Float32 | |
| Flags | ARRAY | |
| Elements | 30 | |
| Body | RtBody | |
Offset.
| Slope Attribute | ||
|---|---|---|
| Class | Attribute | |
| Type | Array of Float32 | |
| Flags | ARRAY | |
| Elements | 30 | |
| Body | RtBody | |
Slope. Intercept[n] and Slope[n] are associated with the point (InValue[n], OutValue[n]). n is the current coordinate.
| PolCoefficients Attribute | ||
|---|---|---|
| Class | Attribute | |
| Type | Array of Float32 | |
| Flags | ARRAY | |
| Elements | 8 | |
| Body | RtBody | |
Polynomial coefficients to convert a sensor function of maximum seventh degree to a conversion table.
| PolUsedFlag Attribute | ||
|---|---|---|
| Class | Attribute | |
| Type | Boolean | |
| Flags | ||
| Body | 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 | ||
|---|---|---|
| Class | Attribute | |
| Type | Time | |
| Flags | ||
| Body | RtBody | |
Specifies when the table was last changed.
| Signature Attribute | ||
|---|---|---|
| Class | Attribute | |
| Type | String16 | |
| Flags | ||
| Body | RtBody | |
Specifies who changed the table last.
| Representation Attribute | ||
|---|---|---|
| Class | Attribute | |
| Type | DataRepEnum | |
| Flags | ||
| Body | RtBody | |
Specifies the data representation of the raw value.