Controller module channel initialisation functions This group defines all functions to initialise controller channels properly.
Each measurement and control device that is attached to the labbCAN bus offers a number of controller channels.
◆ LCC_CreatePIDControlChannel()
LCC_Func long LCC_CALL LCC_CreatePIDControlChannel |
( |
dev_hdl |
AnalogInput, |
|
|
dev_hdl |
Output, |
|
|
unsigned int |
LoopOutType, |
|
|
dev_hdl * |
pCreatedChannel |
|
) |
| |
Function for creation of dynamic PID control channels.
With dynamic control channels you can create your own custom PID control loops. You just need to provide an analog input channel that measures the actual value and a control loop output for writing the control loop output value. You can use analog /digital output channels and pumps as control loop output. You can easily implement pressure controlled dosage by combining an analog pressure sensor as control loop input and a syringe pump as control loop output. The following example code shows how to do this
If you have created a channel, you need to call LCC_SetPIDParameter() to configure the PID parameters of the channel. If you have configured the PID parameters properly, you can enable the control loop via LCC_EnableControlLoop().
- Parameters
-
AnalogInput | The control loop input - channel handle of an analog input device. |
Output | The control loop output - you can pass in an analog out channel a digital out channel or a pump device. |
LoopOutType | Provide the type of the loop output that should get created by this function. The type need to match the type passed in in Output parameter. The following types are supported:
- ANALOG A simple analog output - e.g. for controlling a heater
- DIGITAL A simple digital switch - e.g. for switching a heater
- DIGITAL_PWM A loop output that uses a digital output channel to create a PWM - e.g. for PWM control of a peltier element
- PUMP_FLOW A loop output that controls the flow rate of a pump (see LoopOutType for all output type identifiers)
|
pCreatedChannel | Returns the handle to controller channel handle if the channel was successfully created. |
- See also
- LoopOutType for an enumeration of all loop output types
- Returns
- Error code - ERR_NOERR indicates success
- Examples:
- capi_dynamic_controller_test.cpp, and capi_pressure_control_test.cpp.
◆ LCC_GetChannelHandle()
LCC_Func long LCC_CALL LCC_GetChannelHandle |
( |
unsigned char |
Index, |
|
|
dev_hdl * |
pChanHdl |
|
) |
| |
Get controller channel handle by its index.
- Parameters
-
[in] | Index | Index into list of available controller channels. The index must be in the range of 0 - (LCC_GetNoOfControlChannels() - 1) |
[out] | pChanHdl | Returns handle to control channel or 0 if the given index is out of range |
- Return values
-
-ERR_PARAM_RANGE | If the given device index is out of range |
ERR_NOERR | indicates success |
- Examples:
- capi_qmixqplus_test.cpp.
◆ LCC_GetNoOfControlChannels()
LCC_Func long LCC_CALL LCC_GetNoOfControlChannels |
( |
| ) |
|
Query number of available controller channels.
- Return values
-
>= | 0 Number of available control channels |
< | 0 Error code |
- Examples:
- capi_qmixqplus_test.cpp.
◆ LCC_LookupChanByName()
LCC_Func long LCC_CALL LCC_LookupChanByName |
( |
const char * |
pChannelName, |
|
|
dev_hdl * |
pChanHdl |
|
) |
| |
Lookup for a controller channel by its name.
- Parameters
-
[in] | pChannelName | The name to assign with this channel |
[out] | pChanHdl | Handle to controller channel handle if the channel was sucessfully opened |
- Return values
-
-ERR_NODEV | No device with the given name found |
ERR_NOERR | indicates success |
- Returns
- Error code - ERR_NOERR indicates success
- Examples:
- capi_qmixqplus_test.cpp.