CANopen Field Bus
82
Operating Manual XCx 300 / 500 / 540 Version 09/08
7.2.4
Accessing direct network variables
Direct network variables are declared as follows in the PLC program:
VAR_GLOBAL
(* CAN card / network 1 *)
mNV1Input AT %MW 3.1010000 : UDINT;
mNV1Output AT %MW 3.1010512 : UDINT;
(* CAN card / network 2 *)
mNV2Input AT %MW 3.1020000 : UDINT;
mNV2Output AT %MW 3.1020512 : UDINT;
VAR_END
Similarly, the corresponding memory locations of the parameterizing
and diagnosis functions can also be accessed directly, i.e. without
assistance from the CANIO driver.
VAR_GLOBAL
mDiag1Input1 AT %MW 3.1019992 : UINT;
mDiag1Input2 AT %MW 3.1019994 : UINT;
mDiag1Output1 AT %MW 3.1019996 : UINT;
mDiag1Output2 AT %MW 3.1019998 : UINT;
VAR_END
Here, no maps are generated for the memory locations of the
parameterizing and diagnosis functions.
7.2.5
Accessing parameterizing and diagnosis functions
The PLC can initiate parameterizing and diagnosis functions in the
CAN processor.
The PLC requests a function by entering the required function code in
the mDiag1Output1 variable.
If a function is to be sent with parameter, first the parameter has to be
entered in mDiag1Output2 and then the function code in
mDiag1Output1.
After the function has been executed the function code is always
displayed in mDiag1Input1, while the diagnosis data can be read in
mDiag1Input2
.
FC
=
F
unction
C
ode
P
=
P
arameter
D
=
D
ata
Direct assignment in 32-bit variables is also possible (e.g. %QD1256
and %ID1256).