The configuration settings for both the inputs and the outputs on the uControl hardware can be changed dynamically at run time using the MCx library functions that are included with the installation.
General Precautions
Care must be used when using this feature to prevent damage to the hardware and mitigate all safety risks that may cause inadvertent behavior of an input or an output.
- Disable the SSR before making configuration changes
- Disable outputs before making configuration changes
Library
Add the MCx platform Application Library to your project and view the Configure group to view the complete list of functions available.
General Steps
Create a local Instance of the desired function block.
Typically you will only use the Factory_xxxx Functions.
Inputs:
input_hi_speed : McxApp.Factory_hi_spd;
Outputs:
output_4A_dual_range : McxApp.Factory_4A_fb_drange;
Setup the Configuration Parameters
Using the reference information in the library add all the desired parameters and set their values. Some parameters will require a numeric value and others will use the pre-defined enumerated values or a Boolean.
Inputs:
input_mode:= McxApp.scaling_mode_enum._0_to_5V_absolute,
pullup_en:= TRUE,
Outputs:
drive_mode:= McxApp.output_drive_mode.PWM,
pwm_freq:= 500,
Push the New Configuration Settings
Inputs:
McxApp.ConfigureInput(in:= McxApp.ParamCfg.INPUT_HI_SPD + McxApp.ParamPin.A07,
kind:= McxApp.input_cfg.hi_spd,
opts:= input_hi_speed.instance);
Outputs:
McxApp.ConfigureOutput(in:= McxApp.ParamCfg.OUTPUT_4A_DRANGE + McxApp.ParamPin.B05,
kind:= McxApp.output_cfg._4A_fb_drange,
opts:= output_4A_dual_range.instance);
Comments
0 comments
Please sign in to leave a comment.