Lucon SDK 1.0.7
Loading...
Searching...
No Matches
Functions related to a Lucon Channel (Lucon power module).

Functions

LuconHandle LUCON_NewChannel (LuconHandle conn, const unsigned char channelNr)
 creates a new LuconHandle referring to a Lucon channel
LuconResult LUCON_ChannelFactoryReset (LuconHandle channel)
 Reset all channel settings to their factory defaults.
LuconResult LUCON_ChannelSavePermanently (LuconHandle channel, int32_t restart)
 Save the current settings on the hardware.
LuconResult LUCON_ChannelRestart (LuconHandle channel)
 Restart a power module.
LuconResult LUCON_ChannelGetDesiredContinuousCurrent (LuconHandle channel, float *result)
 Read the currently set desired current of continuous mode / mA.
LuconResult LUCON_ChannelGetActualContinuousCurrent (LuconHandle channel, float *result)
 Read the actual output current at the moment / mA.
LuconResult LUCON_ChannelGetVoltageOverLight (LuconHandle channel, int32_t *result)
 Read the actual output voltage at the moment / mV.
LuconResult LUCON_ChannelGetLastPulseVoltage (LuconHandle channel, int32_t *result)
 Read the voltage of the last output pulse / mV.
LuconResult LUCON_ChannelGetLastPulseCurrent (LuconHandle channel, float *result)
 Read the current of the last output pulse / mA.
LuconResult LUCON_ChannelGetDesiredPulseCurrent (LuconHandle channel, float *result)
 Read the desired output current for pulse mode / mA.
LuconResult LUCON_ChannelGetDesiredSwitchCurrent (LuconHandle channel, float *result)
 Get the desired output current for switch mode / mA.
LuconResult LUCON_ChannelGetCurrentLimit (LuconHandle channel, int32_t *result)
 Read the output current limit / mA.
LuconResult LUCON_ChannelGetVoltageLimit (LuconHandle channel, int32_t *result)
 Read the output voltage limit / mV.
LuconResult LUCON_ChannelGetMode (LuconHandle channel, LuconChannelMode *result)
 Read the active output mode of the channel.
LuconResult LUCON_ChannelGetOutputTriggerParams (LuconHandle channel, struct LuconOutputTriggerParams *result)
 Read the active parameters of the channels trigger output.
LuconResult LUCON_ChannelSetOutputTriggerParams (LuconHandle channel, const struct LuconOutputTriggerParams *const value)
 Set the parameters for a channels trigger output.
LuconResult LUCON_ChannelSetCurrentLimit (LuconHandle channel, const int64_t value)
 Set the maximum output current limit for all modes / mA.
LuconResult LUCON_ChannelSetVoltageLimit (LuconHandle channel, const int64_t value)
 Set the maximum output voltage limit applicable to all modes / mA.
LuconResult LUCON_ChannelGetSerialNumber (LuconHandle channel, char *strbuf, const size_t buf_len)
 Read the serial number of a channel (power module).
LuconResult LUCON_ChannelGetBootloaderVersion (LuconHandle channel, char *strbuf, const size_t buf_len)
 Get a channels bootloader firmaware version.
LuconResult LUCON_ChannelGetFirmwareVersion (LuconHandle channel, char *strbuf, const size_t buf_len)
 Read the firmware version of a channel.
LuconResult LUCON_ChannelGetTemperature (LuconHandle channel, int32_t *result)
 Read a measurement of the temperature of a channel / °C.
LuconResult LUCON_ChannelGetSupplyVoltage (LuconHandle channel, int32_t *result)
 Read a measurement of the channels supply voltage / mV.
LuconResult LUCON_ChannelGetNumber (LuconHandle channel, uint8_t *result)
 Get the channel number.
LuconResult LUCON_ChannelSetToIdle (LuconHandle channel)
 Set the output mode of the channel to LUCON_MODE_IDLE.
LuconResult LUCON_ChannelGetContinuousModeParams (LuconHandle channel, struct LuconContinuousModeParameters *const result)
 Read the active settings for mode LUCON_MODE_CONTINUOUS.
LuconResult LUCON_ChannelSetToContinuousMode (LuconHandle channel, const struct LuconContinuousModeParameters *const settings)
 Apply the given settings and set the output mode of the channel to LUCON_MODE_CONTINUOUS.
LuconResult LUCON_ChannelSetToSwitchMode (LuconHandle channel, const struct LuconSwitchModeParameters *const settings)
 Apply the given settings and set the output mode of the channel to LUCON_MODE_SWITCH.
LuconResult LUCON_ChannelGetSwitchModeParams (LuconHandle channel, struct LuconSwitchModeParameters *const result)
 Read the active settings for output mode LUCON_MODE_SWITCH.
LuconResult LUCON_ChannelSetToPulseMode (LuconHandle channel, const struct LuconPulseModeParameters *settings)
 Apply the settings to a channel and set its output to LUCON_MODE_PULSE.
LuconResult LUCON_ChannelGetPulseModeParams (LuconHandle channel, struct LuconPulseModeParameters *const result)
 Read the active settings for output mode LUCON_MODE_PULSE.
LuconResult LUCON_ChannelGetInfo (LuconHandle channel, char *const strbuf, const size_t buf_len)
 Write a zero-terminated C string with a description of a channel into the result buffer.

Detailed Description

Function Documentation

◆ LUCON_ChannelFactoryReset()

LuconResult LUCON_ChannelFactoryReset ( LuconHandle channel)
extern

Reset all channel settings to their factory defaults.

Parameters
channelA handle to the channel
Returns

◆ LUCON_ChannelGetActualContinuousCurrent()

LuconResult LUCON_ChannelGetActualContinuousCurrent ( LuconHandle channel,
float * result )
extern

Read the actual output current at the moment / mA.

The exact time of reading the value is unknown due to communication and processing delays.

Parameters
channelA handle to the channel
resultAn output buffer to be filledon success with the current / mA.
Returns

◆ LUCON_ChannelGetBootloaderVersion()

LuconResult LUCON_ChannelGetBootloaderVersion ( LuconHandle channel,
char * strbuf,
const size_t buf_len )
extern

Get a channels bootloader firmaware version.

Version example: "2.0" An output buffer of 8 bytes should be sufficient

Parameters
channelA handle to the channel.
strbufOutput string buffer, receiving the version
buf_lenThe capacity of strbuf
Returns

◆ LUCON_ChannelGetContinuousModeParams()

LuconResult LUCON_ChannelGetContinuousModeParams ( LuconHandle channel,
struct LuconContinuousModeParameters *const result )
extern

Read the active settings for mode LUCON_MODE_CONTINUOUS.

The parameters may be read independent of the active LuconChannelMode

Parameters
channelA handle to the channel.
result
Returns

◆ LUCON_ChannelGetCurrentLimit()

LuconResult LUCON_ChannelGetCurrentLimit ( LuconHandle channel,
int32_t * result )
extern

Read the output current limit / mA.

The limit (maximum current) applies to all LuconChannelModes

Parameters
channelA handle to the channel.
resultAn output buffer to be filled on success with the current limit / mA.
Returns

◆ LUCON_ChannelGetDesiredContinuousCurrent()

LuconResult LUCON_ChannelGetDesiredContinuousCurrent ( LuconHandle channel,
float * result )
extern

Read the currently set desired current of continuous mode / mA.

The present setting is read independent of the active LuconChannelMode

Parameters
channelA handle to the channel
resultAn output buffer to be filled on success with the set current / mA.
Returns

◆ LUCON_ChannelGetDesiredPulseCurrent()

LuconResult LUCON_ChannelGetDesiredPulseCurrent ( LuconHandle channel,
float * result )
extern

Read the desired output current for pulse mode / mA.

The setting is read independent of the current mode.

Parameters
channelA handle to the channel.
resultAn output buffer to be filled on success with the current / mA.
Returns

◆ LUCON_ChannelGetDesiredSwitchCurrent()

LuconResult LUCON_ChannelGetDesiredSwitchCurrent ( LuconHandle channel,
float * result )
extern

Get the desired output current for switch mode / mA.

The setting is read independent of the current mode.

Parameters
channelA handle to the channel.
resultAn output buffer to be filled on success with the current / mA.
Returns

◆ LUCON_ChannelGetFirmwareVersion()

LuconResult LUCON_ChannelGetFirmwareVersion ( LuconHandle channel,
char * strbuf,
const size_t buf_len )
extern

Read the firmware version of a channel.

Version example: "1.0.1" An output buffer of 16 bytes should be sufficient

Parameters
channel
strbufOutput string buffer, receiving the version on success
buf_lenThe capacity of strbuf
Returns

◆ LUCON_ChannelGetInfo()

LuconResult LUCON_ChannelGetInfo ( LuconHandle channel,
char *const strbuf,
const size_t buf_len )
extern

Write a zero-terminated C string with a description of a channel into the result buffer.

The call attempts to read multiple parameters from the device. If the provided output buffer is smaller than the full description it will be filled with a truncated description, including proper zero-termination.

Parameters
channelA handle to a connection.
strbufoutput string buffer receiving the description.
buf_lenthe usable length of result buffer.

◆ LUCON_ChannelGetLastPulseCurrent()

LuconResult LUCON_ChannelGetLastPulseCurrent ( LuconHandle channel,
float * result )
extern

Read the current of the last output pulse / mA.

The measurement is updated by * pulse and switch mode

Parameters
channelA handle to the channel.
resultAn output buffer to be filled on success with the voltage / mA.
Returns

◆ LUCON_ChannelGetLastPulseVoltage()

LuconResult LUCON_ChannelGetLastPulseVoltage ( LuconHandle channel,
int32_t * result )
extern

Read the voltage of the last output pulse / mV.

The measurement is updated by * pulse and switch mode

Parameters
channelA handle to the channel.
resultAn output buffer to be filled on success with the voltage / mV.
Returns

◆ LUCON_ChannelGetMode()

LuconResult LUCON_ChannelGetMode ( LuconHandle channel,
LuconChannelMode * result )
extern

Read the active output mode of the channel.

See also
LUCON_ChannelSetToContinuousMode
LUCON_ChannelSetToPulseMode
LUCON_ChannelSetToSwitchMode
LUCON_ChannelSetToIdle
Parameters
channelA handle to the channel.
resultAn output buffer receiving the mode on success
Returns

◆ LUCON_ChannelGetNumber()

LuconResult LUCON_ChannelGetNumber ( LuconHandle channel,
uint8_t * result )
extern

Get the channel number.

Returns immediately without communication to the device.

Parameters
channelA handle to the channel.
resulta buffer receiving the channel number on success
Returns

◆ LUCON_ChannelGetOutputTriggerParams()

LuconResult LUCON_ChannelGetOutputTriggerParams ( LuconHandle channel,
struct LuconOutputTriggerParams * result )
extern

Read the active parameters of the channels trigger output.

Parameters
channelA handle to the channel.
resultAn output buffer receiving the active parameters on success
Returns

◆ LUCON_ChannelGetPulseModeParams()

LuconResult LUCON_ChannelGetPulseModeParams ( LuconHandle channel,
struct LuconPulseModeParameters *const result )
extern

Read the active settings for output mode LUCON_MODE_PULSE.

The settings are read indepent of the active mode.

Parameters
channelA handle to the channel.
resultA buffer receiving the result on success.
Returns

◆ LUCON_ChannelGetSerialNumber()

LuconResult LUCON_ChannelGetSerialNumber ( LuconHandle channel,
char * strbuf,
const size_t buf_len )
extern

Read the serial number of a channel (power module).

Serial number example: "220100145". An output buffer of 16 characters should be sufficient.

Parameters
channelA handle to the channel.
strbufOutput string buffer, receiving the serial number on success
buf_lenThe capacity of strbuf
Returns

◆ LUCON_ChannelGetSupplyVoltage()

LuconResult LUCON_ChannelGetSupplyVoltage ( LuconHandle channel,
int32_t * result )
extern

Read a measurement of the channels supply voltage / mV.

Parameters
channelA handle to the channel.
resulta buffer receiving voltage / mV
Returns

◆ LUCON_ChannelGetSwitchModeParams()

LuconResult LUCON_ChannelGetSwitchModeParams ( LuconHandle channel,
struct LuconSwitchModeParameters *const result )
extern

Read the active settings for output mode LUCON_MODE_SWITCH.

The settings are read independent of the active mode.

Parameters
channelA handle to the channel.
resultA buffer receiving the parameters in case of success.
Returns

◆ LUCON_ChannelGetTemperature()

LuconResult LUCON_ChannelGetTemperature ( LuconHandle channel,
int32_t * result )
extern

Read a measurement of the temperature of a channel / °C.

Parameters
channelA handle to the channel.
resulta buffer receiving the temperature on success / °C
Returns

◆ LUCON_ChannelGetVoltageLimit()

LuconResult LUCON_ChannelGetVoltageLimit ( LuconHandle channel,
int32_t * result )
extern

Read the output voltage limit / mV.

The limit (maximum voltage) applies to all LuconChannelModes

Parameters
channelA handle to the channel.
resultAn output buffer to be filled on success with the voltage limit / mV.
Returns

◆ LUCON_ChannelGetVoltageOverLight()

LuconResult LUCON_ChannelGetVoltageOverLight ( LuconHandle channel,
int32_t * result )
extern

Read the actual output voltage at the moment / mV.

The exact time of reading the value is unknown due to communication and processing delays.

Parameters
channelA handle to the channel.
resultAn output buffer to be filled on success with the voltage / mV.
Returns

◆ LUCON_ChannelRestart()

LuconResult LUCON_ChannelRestart ( LuconHandle channel)
extern

Restart a power module.

Upon restart, its settings will be initialized to the persisted settings. Any transient changes are discarded.

See also
LUCON_ChannelSavePermanently
Parameters
channelA handle to the channel
Returns

◆ LUCON_ChannelSavePermanently()

LuconResult LUCON_ChannelSavePermanently ( LuconHandle channel,
int32_t restart )
extern

Save the current settings on the hardware.

Persists the current settings on the channel hardware (power module). The persisted settings are used to initialize the module at any restart.

Parameters
channelA handle to the channel.
restartIff !=0, the communication module will be restarted
Returns

◆ LUCON_ChannelSetCurrentLimit()

LuconResult LUCON_ChannelSetCurrentLimit ( LuconHandle channel,
const int64_t value )
extern

Set the maximum output current limit for all modes / mA.

Parameters
channelA handle to the channel.
valueThe parameters to apply
Returns

◆ LUCON_ChannelSetOutputTriggerParams()

LuconResult LUCON_ChannelSetOutputTriggerParams ( LuconHandle channel,
const struct LuconOutputTriggerParams *const value )
extern

Set the parameters for a channels trigger output.

Parameters
channelA handle to the channel.
valueThe parameters to apply
Returns

◆ LUCON_ChannelSetToContinuousMode()

LuconResult LUCON_ChannelSetToContinuousMode ( LuconHandle channel,
const struct LuconContinuousModeParameters *const settings )
extern

Apply the given settings and set the output mode of the channel to LUCON_MODE_CONTINUOUS.

Parameters
channelA handle to the channel.
settingsThe settings to apply (requried).
Returns

◆ LUCON_ChannelSetToIdle()

LuconResult LUCON_ChannelSetToIdle ( LuconHandle channel)
extern

Set the output mode of the channel to LUCON_MODE_IDLE.

Parameters
channelA handle to the channel.
Returns

◆ LUCON_ChannelSetToPulseMode()

LuconResult LUCON_ChannelSetToPulseMode ( LuconHandle channel,
const struct LuconPulseModeParameters * settings )
extern

Apply the settings to a channel and set its output to LUCON_MODE_PULSE.

Parameters
channelA handle to the channel.
settingsThe settings to apply (requried).
Returns

◆ LUCON_ChannelSetToSwitchMode()

LuconResult LUCON_ChannelSetToSwitchMode ( LuconHandle channel,
const struct LuconSwitchModeParameters *const settings )
extern

Apply the given settings and set the output mode of the channel to LUCON_MODE_SWITCH.

Parameters
channelA handle to the channel.
settingsThe settings to apply (requried).
Returns

◆ LUCON_ChannelSetVoltageLimit()

LuconResult LUCON_ChannelSetVoltageLimit ( LuconHandle channel,
const int64_t value )
extern

Set the maximum output voltage limit applicable to all modes / mA.

Parameters
channelA handle to the channel.
valueThe parameters to apply
Returns

◆ LUCON_NewChannel()

LuconHandle LUCON_NewChannel ( LuconHandle conn,
const unsigned char channelNr )
extern

creates a new LuconHandle referring to a Lucon channel

The handle is returned without checking whether a channel with the id is physically present.

Parameters
connHandle to a connection for device communication
channelNrThe channel number of the desired power module.
Returns
The new LuconHandle or NULL in case of an error