·260·
Installation manual
CNC 8060
CNC 8065
4.
PLC PROGRAMMING.
(REF: 1402)
Action instructions.
and will issue the corresponding error message. Whenever an error occurs when reading
a variable, the communication mark will remain at "1".
Syntax of the variables in commands CNCRD and CNCWR.
For these two commands, it is possible to define, in the mnemonic of the variable, the channel
number using an integer, a register or a symbol defined with DEF or PDEF.
If the mnemonic of the variable contains numerical suffixes, e.g. (V.).G.GUP[i], they too can
be defined with an integer, a register or a symbol defined with DEF or PDEF.
Consulting synchronous and asynchronous variables.
Synchronous variables are the ones resolved immediately whereas asynchronous variables
are the ones requiring several cycle scans to be resolved.
• Example of how to access asynchronous variables:
<condition> AND NOT M11 = CNCRD (TM.TOOL, R11, M11)
do not repeat this consultation until it ends.
DFD M11 AND CPS R11 EQ 3 = ...
wait for the consultation to end before comparing the data.
• Examples of how to access synchronous variables:
<condition> = CNCRD (G.FREAL, R12, M12)
CPS R12 GT 2000 = ...
No need to wait before consulting the data because synchronous variables are
resolved immediately.
<condition> = CNCWR (R13, PLC.TIMER, M13)
It resets the clock enabled by the PLC with the value contained in register R13.
= CNCEX
Execution of a CNC block.
It may be used to execute a CNC block in the indicated channel, including calls to subroutines
or to complete programs. It works like when executing a block in MDI. The restrictions for
the execution of commands are the same as for the MDI blocks.
Its programming format is:
CNCEX (block, mark, channel)
The mark is set to "1" at the beginning of the operation and it keeps its value until the end
of the operation. If the channel is not indicated, the block is executed in the first or main
channel.
Once the block has been executed, the CNC channel activates the FREE mark to let the PLC
know that it is ready to accept a new block. The execution of the CNCEX command may be
canceled with the mark PLCABORT.
CNCRD ([1].G.FREAL, R10, M1000)
... = MOV 1 R12
CNCRD ([R12].G.FREAL, R10, M1000)
DEF CHANNEL 3
CNCRD ([CHANNEL].G.FREAL, R10, M1000)
... = MOV 153 R101
CNCWR (G.GUP[R101], R10, M1000)
DEF PARAM 153
CNCRD (G.GUP[PARAM], R10, M1000)
... = CNCEX (G00 X0 Y0, M99, 2)
... = CNCEX (#CALL sub3.nc, M34)