CCAux  2.20.0.0
CCAux API reference
Functions
CfgIn functions

Functions

EXTERN_C CCAUXDLL_API CFGINHANDLE CCAUXDLL_CALLING_CONV GetCfgIn (void)
 
EXTERN_C CCAUXDLL_API void CCAUXDLL_CALLING_CONV CfgIn_release (CFGINHANDLE)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CfgIn_setCfgInMode (CFGINHANDLE, uint8_t channel, CfgInModeEnum set_mode)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CfgIn_getCfgInMode (CFGINHANDLE, uint8_t channel, CfgInModeEnum *get_mode)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CfgIn_getValue (CFGINHANDLE, uint8_t channel, uint16_t *sample_value)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CfgIn_getPwmValue (CFGINHANDLE, uint8_t channel, float32_t *frequency, uint16_t *duty_cycle)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CfgIn_getFrequencyValue (CFGINHANDLE, uint8_t channel, float32_t *frequency)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CfgIn_getMinFrequencyThreshold (CFGINHANDLE, uint8_t channel, float32_t *frequency)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CfgIn_setMinFrequencyThreshold (CFGINHANDLE, uint8_t channel, float32_t frequency)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CfgIn_setFrequencyFilterLevel (CFGINHANDLE, uint8_t level)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CfgIn_getActiveIomcu (CFGINHANDLE, uint8_t *ioindex)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CfgIn_setActiveIomcu (CFGINHANDLE, uint8_t ioindex)
 

Detailed Description

Functions in the CfgIn class

Function Documentation

◆ CfgIn_getActiveIomcu()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::CfgIn_getActiveIomcu ( CFGINHANDLE  ,
uint8_t ioindex 
)

Get active io mcu

Supported Platform(s): Yukon, V510, V710

Parameters
ioindexIo mcu number, valid values are 1-4.
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

Example Usage:

uint8_t mcu;
err = CfgIn_getActiveIomcu(pCfgIn, &mcu);
if (err != ERR_SUCCESS)
{
cout << "CfgIn_getActiveIomcu: " << GetErrorStringA(err) << std::endl;
}
else
{
cout << "Active io mcu is: " << (int)mcu << std::endl;
}
unsigned char uint8_t
Definition: CCAuxTypes.h:37
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CfgIn_getActiveIomcu(CFGINHANDLE, uint8_t *ioindex)
EXTERN_C CCAUXDLL_API char_t const *CCAUXDLL_CALLING_CONV GetErrorStringA(eErr errCode)
@ ERR_SUCCESS
Definition: CCAuxTypes.h:163

◆ CfgIn_getCfgInMode()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::CfgIn_getCfgInMode ( CFGINHANDLE  ,
uint8_t  channel,
CfgInModeEnum get_mode 
)

Get current input mode

Supported Platform(s): Yukon, V510, V710

Parameters
channelChannel to get. Numbering starts from 1.
get_modeThe current input mode
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

Example Usage:

err = CfgIn_getCfgInMode(pCfgIn, channel, &get_mode);
if (err != ERR_SUCCESS)
{
cout << "CfgIn_getCfgInMode: " << GetErrorStringA(err) << std::endl;
}
else
{
switch (get_mode)
{
cout << "CfgIn_getCfgInMode (" << (int)channel << "): CFGIN_NOT_IN_USE" << std::endl;
break;
cout << "CfgIn_getCfgInMode (" << (int)channel << "): CFGIN_VOLTAGE_5V" << std::endl;
break;
cout << "CfgIn_getCfgInMode (" << (int)channel << "): CFGIN_FREQ_PD_5V" << std::endl;
break;
default:
cout << "CfgIn_getCfgInMode (" << (int)channel << "): Unknown mode" << std::endl;
break;
}
}
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CfgIn_getCfgInMode(CFGINHANDLE, uint8_t channel, CfgInModeEnum *get_mode)
@ CFGIN_FREQ_PD_5V
Definition: CCAuxTypes.h:614
@ CFGIN_NOT_IN_USE
Definition: CCAuxTypes.h:592
@ CFGIN_VOLTAGE_5V
Definition: CCAuxTypes.h:596

◆ CfgIn_getFrequencyValue()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::CfgIn_getFrequencyValue ( CFGINHANDLE  ,
uint8_t  channel,
float32_t frequency 
)

Read the sampled frequency value from configurable input in frequency mode

Supported Platform(s): Yukon, V510, V710

Parameters
channelChannel to get. Numbering starts from 1.
frequencyRead signal frequency in Hz (0 - 50000.0Hz)
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

Example Usage:

◆ CfgIn_getMinFrequencyThreshold()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::CfgIn_getMinFrequencyThreshold ( CFGINHANDLE  ,
uint8_t  channel,
float32_t frequency 
)

Read the configured minimum frequency threshold for input in frequency measurement mode (CFGIN_FREQ_PD_5V, CFGIN_FREQ_F_5V, CFGIN_FREQ_PU_5V). The frequency threshold is set to 1Hz at device start-up. Use the frequency threshold to set up how low frequencies the unit are able to measure, if frequency is below this value a frequency of 0 is reported. This value will affect how long it will take to detect that the signal frequency has gone to 0.

Supported Platform(s): Yukon, V510, V710

Parameters
channelChannel to get. Numbering starts from 1.
frequencyMinimum frequency threshold (1.0 - 15000Hz) for Yukon, V510, V710.
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

Example Usage:

float frequency_threshold;
channel = 2;
err = CfgIn_getMinFrequencyThreshold(pCfgIn, channel, &frequency_threshold);
if (err != ERR_SUCCESS)
{
cout << "CfgIn_getMinFrequencyThreshold: " << GetErrorStringA(err) << std::endl;
}
else
{
cout << "CfgIn_getMinFrequencyThreshold: channel 2: " << std::fixed << frequency_threshold << "Hz" << std::endl;
}
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CfgIn_getMinFrequencyThreshold(CFGINHANDLE, uint8_t channel, float32_t *frequency)

◆ CfgIn_getPwmValue()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::CfgIn_getPwmValue ( CFGINHANDLE  ,
uint8_t  channel,
float32_t frequency,
uint16_t duty_cycle 
)

Read the sampled value from configurable input in frequency or duty-cycle measurement mode

Yukon, V510, V710: CFGIN_FREQ_PD_5V CFGIN_FREQ_F_5V CFGIN_FREQ_PU_5V CFGIN_DC_PD_5V CFGIN_DC_F_5V CFGIN_DC_PU_5V

Supported Platform(s): Yukon, V510, V710

Parameters
channelChannel to get. Numbering starts from 1.
frequencyRead signal frequency (0.0 - 50000.0 Hz)
duty_cycleRead signal duty cycle (0-4095) which corresponds to 0-100%. Valid only in duty cycle-mode.
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

Example Usage:

float frequency;
unsigned short duty_cycle;
err = CfgIn_getPwmValue(pCfgIn, 2, &frequency, &duty_cycle);
if (err != ERR_SUCCESS)
{
cout << "CfgIn_getPwmValue: " << GetErrorStringA(err) << std::endl;
}
else
{
cout << "CfgIn_getPwmValue: channel 2 PWM measurement: " << std::fixed << frequency << "Hz, " << (int)duty_cycle
<< "duty cycle" << std::endl;
}
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CfgIn_getPwmValue(CFGINHANDLE, uint8_t channel, float32_t *frequency, uint16_t *duty_cycle)

◆ CfgIn_getValue()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::CfgIn_getValue ( CFGINHANDLE  ,
uint8_t  channel,
uint16_t sample_value 
)

Read the sampled value from configurable input, when in modes other than frequency and duty-cycle mode

For Yukon, V510, V710 platform: CFGIN_VOLTAGE_5V - sample_value in mV, CFGIN_RESISTANCE - sample_value in 0.1 Ohm/bit, CFGIN_CURRENT_4_20 - sample_value in µA, CFGIN_VOLTAGE_32V - sample_value in mV, CFGIN_DIGITAL_PD_5V - sample_value is 0-1 CFGIN_DIGITAL_F_5V - sample_value is 0-1 CFGIN_DIGITAL_PU_5V - sample_value is 0-1

Supported Platform(s): Yukon, V510, V710

Parameters
channelChannel to get. Numbering starts from 1.
sample_valueCurrent sample value.
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

Example Usage:

unsigned short value;
err = CfgIn_getValue(pCfgIn, 1, &value);
if (err != ERR_SUCCESS)
{
cout << "CfgIn_getValue: " << GetErrorStringA(err) << std::endl;
}
else
{
cout << "CfgIn_getValue: channel 1 5V voltage measurement: " << (int)value << "mV" << std::endl;
}
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CfgIn_getValue(CFGINHANDLE, uint8_t channel, uint16_t *sample_value)

◆ CfgIn_release()

EXTERN_C CCAUXDLL_API void CCAUXDLL_CALLING_CONV CrossControl::CfgIn_release ( CFGINHANDLE  )

Release the CfgIn object.

Supported Platform(s): Yukon, V510, V710

Returns
-

Example Usage:

CFGINHANDLE pCfgIn = ::GetCfgIn();
assert(pCfgIn);
cfgin_example(pCfgIn);
CfgIn_release(pCfgIn);
EXTERN_C CCAUXDLL_API CFGINHANDLE CCAUXDLL_CALLING_CONV GetCfgIn(void)
EXTERN_C CCAUXDLL_API void CCAUXDLL_CALLING_CONV CfgIn_release(CFGINHANDLE)
void * CFGINHANDLE
Definition: CfgIn.h:32

◆ CfgIn_setActiveIomcu()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::CfgIn_setActiveIomcu ( CFGINHANDLE  ,
uint8_t  ioindex 
)

Set active io mcu

Supported Platform(s): Yukon, V510, V710

Parameters
ioindexIo mcu number, valid values are 1-4.
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

Example Usage:

err = CfgIn_setActiveIomcu(pCfgIn, 1);
if (err != ERR_SUCCESS)
{
cout << "CfgIn_setActiveIomcu: " << GetErrorStringA(err) << std::endl;
}
else
{
cout << "Active io mcu set to 1" << std::endl;
}
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CfgIn_setActiveIomcu(CFGINHANDLE, uint8_t ioindex)

◆ CfgIn_setCfgInMode()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::CfgIn_setCfgInMode ( CFGINHANDLE  ,
uint8_t  channel,
CfgInModeEnum  set_mode 
)

Set configurable input mode

Supported Platform(s): Yukon, V510, V710

Parameters
channelChannel to set. Numbering starts from 1.
set_modeWhich mode to set. See CfgInModeEnum for a description of which modes are available in the current platform.

For Yukon, V510, V710 platform: CFGIN_VOLTAGE_5V CFGIN_RESISTANCE CFGIN_CURRENT_4_20 CFGIN_VOLTAGE_32V CFGIN_DIGITAL_PD_5V CFGIN_DIGITAL_F_5V CFGIN_DIGITAL_PU_5V CFGIN_FREQ_PD_5V CFGIN_FREQ_F_5V CFGIN_FREQ_PU_5V CFGIN_DC_PD_5V CFGIN_DC_F_5V CFGIN_DC_PU_5V

Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

Example Usage:

err = CfgIn_setCfgInMode(pCfgIn, channel, CFGIN_VOLTAGE_5V);
if (err != ERR_SUCCESS)
{
cout << "CfgIn_setCfgInMode: " << GetErrorStringA(err) << std::endl;
}
else
{
cout << "CfgIn_setCfgInMode: channel 1 mode set to CFGIN_VOLTAGE_V5" << std::endl;
}
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CfgIn_setCfgInMode(CFGINHANDLE, uint8_t channel, CfgInModeEnum set_mode)

◆ CfgIn_setFrequencyFilterLevel()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::CfgIn_setFrequencyFilterLevel ( CFGINHANDLE  ,
uint8_t  level 
)

Sets the weight of the old sample value in frequency measurements as a percentage. The sampled frequency is filtered with a moving average. A large weight increases the filter level and gives better accuracy in high frequency measurements, but decreases the speed of which changes in the input frequency can be detected.

Supported Platform(s):

Parameters
levelWeight of the old sample value as a percentage (0-99)
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

Example Usage:

◆ CfgIn_setMinFrequencyThreshold()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::CfgIn_setMinFrequencyThreshold ( CFGINHANDLE  ,
uint8_t  channel,
float32_t  frequency 
)

Set the configured minimum frequency threshold for input in frequency measurement mode (CFGIN_FREQ_PD_5V, CFGIN_FREQ_F_5V, CFGIN_FREQ_PU_5V). The frequency threshold is set to 1Hz at device start-up. Use the frequency threshold to set up how low frequencies the unit are able to measure, if frequency is below this value a frequency of 0 is reported. This value will affect how long it will take to detect that the signal frequency has gone to 0.

Supported Platform(s): Yukon, V510, V710

Parameters
channelChannel to set. Numbering starts from 1.
frequencyMinimum frequency threshold (1.0 - 15000Hz) for Yukon, V510, V710.
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

Example Usage:

channel = 2;
err = CfgIn_setMinFrequencyThreshold(pCfgIn, channel, 50.0);
if (err != ERR_SUCCESS)
{
cout << "CfgIn_setMinFrequencyThreshold: " << GetErrorStringA(err) << std::endl;
}
else
{
cout << "CfgIn_setMinFrequencyThreshold: channel 2 minimum frequency threshold set to 50.0Hz" << std::endl;
}
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CfgIn_setMinFrequencyThreshold(CFGINHANDLE, uint8_t channel, float32_t frequency)

◆ GetCfgIn()

EXTERN_C CCAUXDLL_API CFGINHANDLE CCAUXDLL_CALLING_CONV CrossControl::GetCfgIn ( void  )

Factory function that creates instances of the CfgIn object.

Supported Platform(s): Yukon, V510, V710

Returns
CFGINHANDLE to an allocated CfgIn object. The returned handle needs to be deallocated using the CfgIn_release(CFGINHANDLE) method when it's no longer needed. Returns NULL if it fails to allocate memory.

Example Usage:

CFGINHANDLE pCfgIn = ::GetCfgIn();
assert(pCfgIn);
cfgin_example(pCfgIn);
CfgIn_release(pCfgIn);