Control Channel Access

Overview

Control channel access functions This group defines all functions for access to control parameters like setpoint or actual value.

+ Collaboration diagram for Control Channel Access:

Functions

long LCC_EnableControlLoop (dev_hdl ChanHdl, int Enable)
 Enables / disables a control loop. More...
 
long LCC_GetSetPoint (dev_hdl ChanHdl, double *pfSetPointValue)
 Query setpoint value from device object. More...
 
long LCC_GetSwScalingParam (dev_hdl ChanHdl, double *pfScalingFactor, double *pfScalingOffset)
 Read software scaling parameters. More...
 
long LCC_IsControlLoopEnabled (dev_hdl ChanHdl)
 Query if a control loop is enabled. More...
 
long LCC_ReadActualValue (dev_hdl ChanHdl, double *pfActualValue)
 Read actual value from device. More...
 
long LCC_ReadActualValueUnscaled (dev_hdl ChanHdl, double *pfActualValueRaw)
 Read actual value from device - bypass scaling. More...
 
long LCC_ReadStatus (dev_hdl ChanHdl, unsigned long *pdwStatus)
 Read additional status information from device. More...
 
long LCC_SetPIDParameter (dev_hdl ChanHdl, int PIDParamId, double Value)
 Set the PID parameters of a certain control channel. More...
 
long LCC_SetSwScalingOn (dev_hdl ChanHdl, int ScalingOn)
 Enable / disable software scaling. More...
 
long LCC_SetSwScalingParam (dev_hdl ChanHdl, double fScalingFactor, double fScalingOffset)
 Set software scaling parameters. More...
 
long LCC_WriteSetPoint (dev_hdl ChanHdl, double fSetPointValue)
 Write setpoint value to controller device. More...
 
long LCC_WriteSetPointUnscaled (dev_hdl ChanHdl, double SetPointValueRaw)
 Write setpoint value to controller device - bypass scaling stage. More...
 

Function Documentation

long LCC_EnableControlLoop ( dev_hdl  ChanHdl,
int  Enable 
)

Enables / disables a control loop.

If the control loop is enabled, then the output value is calculated periodically.

Parameters
ChanHdlValid handle of a controller channel
Enable1 = enable, 0 = disable
Returns
Error code - ERR_NOERR indicates success
See also
LCC_IsControlLoopEnabled()
Examples:
capi_dynamic_controller_test.cpp, capi_pressure_control_test.cpp, and capi_qmixqplus_test.cpp.
long LCC_GetSetPoint ( dev_hdl  ChanHdl,
double *  pfSetPointValue 
)

Query setpoint value from device object.

This function does not return the real setpoint value of the device but only the cached setpoint value entered by writeSetPoint()

Parameters
[in]ChanHdlValid handle of open controller channel
[in]pfSetPointValueThe setpoint value read from device
Returns
Error code - ERR_NOERR indicates success
long LCC_GetSwScalingParam ( dev_hdl  ChanHdl,
double *  pfScalingFactor,
double *  pfScalingOffset 
)

Read software scaling parameters.

Parameters
[in]ChanHdlValid handle of open controller channel
[out]pfScalingFactorThe scaling factor multiplied with field value
[out]pfScalingOffsetThe scaling offset added to field value
See also
LCC_SetSwScalingParam()
Return values
ERR_NOERRindicates success
-ERR_NOTSUPLinear scaling not supported (i.e. if channel uses a different kind of scaling like PT100 scaling)
long LCC_IsControlLoopEnabled ( dev_hdl  ChanHdl)

Query if a control loop is enabled.

If the control loop is enabled, then the output value is calculated periodically.

Parameters
ChanHdlValid handle of a controller channel
Return values
1- Control channel is enabled
0- Control channel is disabled
<0- Error code
See also
LCC_EnableControlLoop()
Examples:
capi_qmixqplus_test.cpp.
long LCC_ReadActualValue ( dev_hdl  ChanHdl,
double *  pfActualValue 
)

Read actual value from device.

Parameters
[in]ChanHdlValid handle of open controller channel
[out]pfActualValueReturns the actual controller value
Returns
Error code - ERR_NOERR indicates success
Examples:
capi_dynamic_controller_test.cpp, capi_pressure_control_test.cpp, and capi_qmixqplus_test.cpp.
long LCC_ReadActualValueUnscaled ( dev_hdl  ChanHdl,
double *  pfActualValueRaw 
)

Read actual value from device - bypass scaling.

Reads the actual value from the device bypassing the scaling stage of the channel. Reads the unprocessed value directly.

Parameters
[in]ChanHdlValid handle of open controller channel
[out]pfActualValueRawUnprocessed actual value (no scaling)
Returns
Error code - ERR_NOERR indicates success
long LCC_ReadStatus ( dev_hdl  ChanHdl,
unsigned long *  pdwStatus 
)

Read additional status information from device.

Parameters
[in]ChanHdlValid handle of open controller channel
[out]pdwStatusStores the status read from device
Returns
Error code - ERR_NOERR indicates success
long LCC_SetPIDParameter ( dev_hdl  ChanHdl,
int  PIDParamId,
double  Value 
)

Set the PID parameters of a certain control channel.

See also
PIDParameterId for a list of all available parameters. If you create a dynamic control channel, the you need to set all PID parameters before you enable the channel via LCC_EnableControlLoop().
Parameters
ChanHdlValid handle of a controller channel
PIDParamIdPID parameter identifier -
See also
PIDParameterId for a list of all PID parameters
Parameters
ValueThe value for the PID parameter given in PIDParamId
Returns
Error code - ERR_NOERR indicates success
Examples:
capi_dynamic_controller_test.cpp, and capi_pressure_control_test.cpp.
long LCC_SetSwScalingOn ( dev_hdl  ChanHdl,
int  ScalingOn 
)

Enable / disable software scaling.

Parameters
[in]ChanHdlValid handle of open controller channel
[in]ScalingOn1 = Scaling on, 0 = Scaling off
Returns
Error code - ERR_NOERR indicates success
long LCC_SetSwScalingParam ( dev_hdl  ChanHdl,
double  fScalingFactor,
double  fScalingOffset 
)

Set software scaling parameters.

These parameters are used to scale the measured value from device. These scaling parameters are independent from the device scaling parameters and the scaling is performed on the local machine. Scaled Value = (Process Value * Scaling Factor) + Scaling Offset. The default value for Scaling Factor is 1 and for Scaling Offset is 0.

Parameters
[in]ChanHdlValid handle of open controller channel
[in]fScalingFactorThe scaling factor to multiply with field value
[in]fScalingOffsetThe scaling offset ro add to field value
Return values
ERR_NOERRindicates success
-ERR_NOTSUPLinear scaling not supported (i.e. if channel uses a different kind of scaling like PT100 scaling)
See also
LCC_GetSwScalingParam()
long LCC_WriteSetPoint ( dev_hdl  ChanHdl,
double  fSetPointValue 
)

Write setpoint value to controller device.

Parameters
[in]ChanHdlValid handle of open controller channel
[in]fSetPointValueThe setpoint value to write
Returns
Error code - ERR_NOERR indicates success
Examples:
capi_dynamic_controller_test.cpp, capi_pressure_control_test.cpp, and capi_qmixqplus_test.cpp.
long LCC_WriteSetPointUnscaled ( dev_hdl  ChanHdl,
double  SetPointValueRaw 
)

Write setpoint value to controller device - bypass scaling stage.

Parameters
[in]ChanHdlValid handle of open controller channel
[in]SetPointValueRawUnprocessed set point value (no scaling)
Returns
Error code - ERR_NOERR indicates success