K1: Mode group, channel, program operation, reset response
9.16 Program runtime / Part counter
Basic Functions
668 Function Manual, 09/2011, 6FC5397-0BP40-2BA0
Example 3: Measuring the duration of "mySubProgrammA" and "mySubProgrammC"
9.16.2 Workpiece counter
Function
The "Workpiece counter" function makes available various counters which can be used in particular internally in
the control to count workpieces.
The counters exist as channel-specific system variables with read and write access in a range of values from 0 to
999,999,999.
Channel-specific machine data can be used to control counter activation, counter reset timing and the counting
algorithm.
System variables for workpiece counting
Program code
N10 DO $AC_PROG_NET_TIME_TRIGGER=2
N20 mySubProgrammA
N30 DO $AC_PROG_NET_TIME_TRIGGER=3
N40 mySubProgrammB
N50 DO $AC_PROG_NET_TIME_TRIGGER=4
N60 mySubProgrammC
N70 DO $AC_PROG_NET_TIME_TRIGGER=1
N80 mySubProgrammD
N90 M30
System variable Description
$AC_REQUIRED_PARTS Number of the workpieces to be produced (setpoint number of
workpieces)
In this counter the number of workpieces at which the actual workpiece
count ($AC_ACTUAL_PARTS) will be reset to "0" can be defined.
MD27880 can be used to activate the generation of the display alarm:
"Channel%1 workpiece target=%2 reached"
and of the channel-specific NC/PLC interface signal:
DB21,DBX317.2 (workpiece target reached)
.
$AC_TOTAL_PARTS Number of completed workpieces in total (actual workpiece total)
This counter specifies the total number of all workpieces produced
since the start time. The value is only automatically reset to "0" when
the control powers up with default values.