FunctionBlocks Additional MC_ExchangeConfigurationFB - ThorstenBrach/SRCI GitHub Wiki
Reads and writes specific configuration parameters on RC that are required for the RI to work.

This command is used internally by the RobotTask functionblock and should not be used directly within the application. The RobotTask functionblock automatically provides the extracted data in the UserData.
VAR_INPUT
Parameter | Data Type | Default Value | Description | Required |
---|---|---|---|---|
InternalLogger |
- |
For internal usage only |
- |
|
ExternalLogger |
- |
For internal usage only |
- |
|
LogLevel |
- |
For internal usage only |
- |
|
Name |
- |
User defined command name |
O |
|
ExecMode |
SEQUENCE_PRIMARY |
Execution mode of the command |
M |
|
Priority |
PriorityLevel.NORMAL |
Priority of the command |
M |
|
Enable |
- |
Enable / Disable the command at rising / falling edge |
M |
|
ParCmd |
- |
Command specific parameter |
M |
VAR_IN_OUT
Parameter | Data Type | Default Value | Description | Required |
---|---|---|---|---|
AxesGroup |
- |
Robot group assigned to the function |
M |
VAR_OUTPUT
Parameter | Data Type | Default Value | Description | Required |
---|---|---|---|---|
CommandData |
RobotLibraryCommandDataFB |
- |
For internal usage only |
- |
ResponseData |
RobotLibraryResponseDataFB |
- |
For internal usage only |
- |
Error |
- |
Error occurred during execution. See ErrorID for details |
M |
|
ErrorID |
- |
Error ID as raw value for error diagnosis |
M |
|
ErrorIDEnum |
- |
Error ID as enumeration for error diagnosis |
M |
|
ErrorAddTxt |
- |
Additional error text information |
M |
|
WarningID |
- |
Warning ID as raw value for identifying warnings |
M |
|
WarningIDEnum |
- |
Warning ID as enumeration for identifying warning |
M |
|
InfoID |
- |
Info ID for as raw value for identifying additional information |
M |
|
InfoIDEnum |
- |
Info ID for as enumeration for identifying additional information |
M |
|
Enabled |
- |
Command enabled successfully |
M |
|
Busy |
- |
Function block is being processed |
M |
|
CommmandBuffered |
- |
Command was transferred to the robot-controller and confirmed |
M |
|
ParameterAccepted |
- |
Receiving of input parameter values has been acknowledged by RC |
M |
|
OutCmd |
- |
Command specific outputs |
M |
ExchangeConfigurationParCmd
Parameter | Data Type | Default Value | Description | Required |
---|---|---|---|---|
LogLevel |
- |
Defines up to which level of severity messages will be logged in the RC’s server log |
M |
|
WaitAtBlendingZone |
- |
Defines blending behavior for single move commands. One of the optional modes must be supported. |
M |
|
AllowSecSeqWhileSubprogram |
- |
Allow a sequence switch from primary to secondary while a subprogram called via |
M |
|
AllowDynamicBlending |
- |
Allows blending when |
M |
|
DelayTime |
- |
Waiting time of RC between receiving first move command (when queue is empty) and starting movement |
M |
|
WaitForNrOfCmd |
- |
Number of points required to calculate the blending |
M |
|
LifeSignTimeOut |
50 |
Maximum allowed time between LifeSign updates before communication error |
M |
|
SyncDelay |
0 |
Delay time between detecting configuration inconsistency and executing |
M |
|
SyncReaction |
- |
Reaction in case of synchronization data inconsistency |
M |
|
DataInSync |
- |
Datas which are synchronized |
M |
|
DataEnableSync |
- |
Enable datas to synchronize |
M |
ExchangeConfigurationOutCmd
Parameter | Data Type | Default Value | Description | Required |
---|---|---|---|---|
LengthACR |
- |
Metric of how many CMDs the RC can receive and manage at the same time |
M |
|
HighestToolIndex |
- |
Highest index of available tools on the RC |
M |
|
HighestFrameIndex |
- |
Highest index of available frames on the RC |
M |
|
HighestLoadIndex |
- |
Highest index of available loads on the RC |
M |
|
HighestWorkAreaIndex |
- |
Highest index of available work areas on the RC |
M |
|
DataInSync |
- |
Datas which are synchronized |
M |
|
ChangeIndexTool |
- |
Index of tool changed on RC |
M |
|
ChangeIndexFrame |
- |
Index of frame changed on RC |
M |
|
ChangeIndexLoad |
- |
Index of load changed on RC |
M |
|
ChangeIndexWorkArea |
- |
Index of work area changed on RC |
M |
|
RAWorkingHours |
- |
Working hours of a connected RA |
M |
|
BrakeTestRequired |
- |
Signals that a brake test is required within monitoring time |
M |
|
StepModeExactStopActive |
- |
StepMode is active and set to ExactStop |
M |
|
StepModeBlendingActive |
- |
StepMode is active and set to Blending |
M |
|
PathAccuracyMode |
- |
PathAccuracyMode is active |
M |
|
AvoidSingularity |
- |
AvoidSingularity is active |
M |
|
CollisionDetectionEnabled |
- |
CollisionDetection is active |
M |
|
AcceleratingSupported |
- |
RC supports cyclic dynamics status bit: Accelerating |
M |
|
DecceleratingSupported |
- |
RC supports cyclic dynamics status bit: Decelerating |
M |
|
ConstantVelocitySupported |
- |
RC supports cyclic dynamics status bit: ConstantVelocity |
M |
|
RCWorkingHours |
- |
Total system hours of connected RA |
M |
Declaration
VAR_GLOBAL
/// Robot assignment of function
AxesGroup : AxesGroup;
/// Robot Task
RobotTask : MC_RobotTaskFB;
/// Exchange Configuration
ExchangeConfiguration : MC_ExchangeConfigurationFB;
END_VAR
Call
// Call functionblock
ExchangeConfiguration
(
Name := 'SRCI_Robot',
ExecutionMode := ExecutionMode.PARALLEL,
Priority := PriorityLevel.NORMAL,
AxesGroup := AxesGroup
);
Usage
VAR_INPUT
/// Request exchange configuration
EnableRequest : BOOL;
END_VAR
VAR_OUTPUT
/// Error ID
ErrorID : DINT;
/// Error addition text
ErrorAddTxt : STRING;
/// Configuration
Configuration : ExchangeConfigurationOutCmd;
END_VAR
VAR
/// internal step counter
_stepCmd : DINT;
/// internal timer for command
_timerCmd : TON;
/// internal timeout for command
_timeoutCmd : TIME := T#5S;
END_VAR
CASE _stepCmd OF
0: // Enable or disable exchange of configuration ?
IF (( EnableRequest ) XOR
( ExchangeConfiguration.Enabled ))
THEN
// set timeout
SetTimeout(PT := _timeoutCmd, rTimer := _timerCmd);
// inc step counter
_stepCmd := _stepCmd + 1;
END_IF
1: // Start Execution
IF (( NOT ExchangeConfiguration.Busy ) AND
( NOT ExchangeConfiguration.Error ))
THEN
// enable/disable exchange configuration
ExchangeConfiguration.Enable := EnableRequest;
// set timeout
SetTimeout(PT := _timeoutCmd, rTimer := _timerCmd);
// inc step counter
_stepCmd := _stepCmd + 1;
ELSE
// timeout exceeded ?
IF (CheckTimeout(_timerCmd) = RobotLibraryConstants.OK)
THEN
ErrorID := RobotLibraryErrorIdEnum.ERR_TIMEOUT_CMD;
ErrorAddTxt := CONCAT('_stepCmd = ' , DINT_TO_STRING(_stepCmd));
END_IF
// Error occurred ?
IF (ExchangeConfiguration.Error)
THEN
ErrorID := ExchangeConfiguration.ErrorID;
ErrorAddTxt := CONCAT('_stepCmd = ' , DINT_TO_STRING(_stepCmd));
END_IF
END_IF
2: // Wait Execution done ?
IF (( NOT ExchangeConfiguration.Busy ) AND
( ExchangeConfiguration.Enabled = EnableRequest ))
THEN
// copy results
Configuration := ExchangeConfiguration.OutCmd;
// set timeout
SetTimeout(PT := _timeoutCmd, rTimer := _timerCmd);
// set step counter
_stepCmd := 0;
ELSE
// timeout exceeded ?
IF (CheckTimeout(_timerCmd) = RobotLibraryConstants.OK)
THEN
ErrorID := RobotLibraryErrorIdEnum.ERR_TIMEOUT_CMD;
ErrorAddTxt := CONCAT('_stepCmd = ' , DINT_TO_STRING(_stepCmd));
END_IF
// Error occurred ?
IF (ExchangeConfiguration.Error)
THEN
ErrorID := ExchangeConfiguration.ErrorID;
ErrorAddTxt := CONCAT('_stepCmd = ' , DINT_TO_STRING(_stepCmd));
END_IF
END_IF
ELSE
// invalid step
ErrorID := RobotLibraryErrorIdEnum.ERR_INVALID_STEP;
ErrorAddTxt := CONCAT('_stepCmd = ' , DINT_TO_STRING(_stepCmd));
END_CASE