CANopen Field Bus
Operating Manual XCx 300 / 500 / 540 Version 09/08
81
Example
(* CAN1> - Don't remove this label*)
PROGRAM netin1 : INPUT
(
VAR_ADR := 1000, (* CAN card / network 1 *)
END_VAR_ADR := 1255,
DEVICE := DRIVER,
DRIVER_NAME := 'CANIO'
(* use defaults *)
);
PROGRAM netout1 : OUTPUT
(
VAR_ADR := 1000,
END_VAR_ADR := 1255,
DEVICE := DRIVER,
DRIVER_NAME := 'CANIO'
(* use defaults *)
);
(* diagnostic interface *)
PROGRAM netin1d : INPUT
(
VAR_ADR := 1256, (* CAN card / network 1 *)
END_VAR_ADR := 1259,
DEVICE := DRIVER,
DRIVER_NAME := 'CANIO',
DRIVER_PAR1 := 1
);
PROGRAM netout1d : OUTPUT
(
VAR_ADR := 1256, (* CAN card / network 1 *)
END_VAR_ADR := 1259,
DEVICE := DRIVER,
DRIVER_NAME := 'CANIO',
DRIVER_PAR1 := 1
);
(* <CAN1 - Don't remove this label *)
Declaration in PLC program:
VAR_GLOBAL
mNVInput1 AT %IW 1000 : INT;
mNVOutput1 AT %QW 1000 : INT;
mDiag1Input1 AT %IW 1256 : UINT;
mDiag1Input2 AT %IW 1258 : UINT;
mDiag1Output1 AT %QW 1256 : UINT;
mDiag1Output2 AT %QW 1258 : UINT;
VAR_END
Also note that
DRIVER_PAR1=1
must be set if the CANIO driver is to
access the parameterizing and diagnosis functions. Maps for the
memory locations of the parameterizing and diagnosis functions are
generated here.
If double buffer mode is activated anywhere in the I/O
configuration, the setting will apply to all driver
accesses.