July 2013 9.5 Data Transfer NC > PLC, PLC > NC 1743
Permissible entries for [value]:
Q parameter, e.g.:=Q10
Undefined:SET UNDEFINED
Q string, e.g.:=QS10
Numerical value directly, e.g.:=10
String directly, e.g.:="new value"
If you specify a Q parameter in [value], it must match the interrogated PLC
operand. The control will otherwise issue the error message Access to PLC
variable has failed.
Examples:
WRITE TO PLC KEY "WG_ParSet_number" =+2
Writes the value 2 to WG_ParSet_number, e.g. for selecting an axis parameter
set
WRITE TO PLC KEY "MG_ParSet_activation" =+Q100
Writes the value from Q100 to the MG_ParSet_activation PLC marker, e.g. for
activating an axis parameter set
The WRITE TO PLC KEY command is run in look-ahead, meaning that the
control executes the command immediately instead of waiting until the NC
program has been executed up to the corresponding point. If a
synchronization with real time is necessary, then FN20: WAIT FOR SYNC
must be programmed in the preceding NC block. Look-ahead is then
stopped, and WRITE TO PLC KEY is not performed until this block is actually
reached in the NC program.
With the FN17: SYSWRITE ID13 NR3 function, you can define a label to which
the control will jump if an error occurs executing the command. The Access
to PLC variable has failed error message will be suppressed in this case.