!
|
(*If WRITE_CMD not in progress, then initialization of faults*)
|
IF NOT Ring.CMD_IN_PROGR THEN Ring.ACTION_CMD:= 409;
|
|
WRITE_CMD(Ring);
|
|
END_IF;
|
!
|
(*If WRITE_CMD not in progress, then writing (set) of the optical power*)
|
|
IF NOT Ring.CMD_IN_PROGR THEN Ring.ACTION_CMD:= 2545;
|
||
Ring.PARAM_CMD_3:= 51.5;
|
//Parameter 3: optical power = 51.5
|
|
WRITE_CMD(Ring);
|
||
END_IF;
|
!
|
(*If WRITE_CMD not in progress, then reading (get) of the transmission ratio*)
|
|
IF NOT Ring.CMD_IN_PROGR THEN Ring.ACTION_CMD:= 1551;
|
||
WRITE_CMD(Ring);
|
||
END_IF;
|
||
!
|
(*If WRITE_CMD has been completed and if there is no fault, then the value of the transmission ratio is accessible in return 1*)
|
|
IF NOT Ring.CMD_IN_PROGR AND NOT Ring.CMD_ERR
|
||
THEN BAUD_RATE: = Ring.RETURN_CMD_1;
|
//transmission ratio in return 1
|
|
END_IF;
|
!
|
(*If WRITE_CMD not in progress, then move real axis 3*)
|
|
IF NOT Axis_3.CMD_IN_PROGR THEN Axis_3.ACTION_CMD:= 513;
|
||
Axis_3.PARAM_CMD_1:= 0;
|
//Parameter 1: type of movement = absolute
|
|
Axis_3.PARAM_CMD_3:= 105.2;
|
//Parameter 3: position = 105.2
|
|
|
Axis_3.PARAM_CMD_4:= 5.0;
|
//Parameter 4: speed = 5
|
WRITE_CMD(Axis_3);
|
||
END_IF;
|
!
|
(*If WRITE_CMD not in progress, then reading the position of the follower slave*)
|
|
IF NOT Follow.CMD_IN_PROGR THEN Follow.ACTION_CMD:= 537;
|
||
Follow.PARAM_CMD_3:= 102.5;
|
//Parameter 3: position of the master = 102.5
|
|
WRITE_CMD(Follow);
|
||
END_IF;
|
||
!
|
(*If WRITE_CMD has been completed and if there is no fault, then the position of the slave is accessible in return 2*)
|
|
IF NOT Follow.CMD_IN_PROGR AND NOT Follow.CMD_ERR
|
||
THEN SLAVE_POSITION:=Follow.RETURN_CMD_2;
|
//position in return 2
|
|
END_IF;
|