Modulo Flag and Synchronization Flag
Original instructions
At a Glance
This section presents the operation of the bits relating to the following events:
The table below presents the counting modes that may activate synchronization, homing and modulo events:
Flag
Counting mode concerned
sync_ref_flag bit (%IWr.m.c.0.2)
  • Free Large counter: When the counter presets
  • Modulo loop counter: When the counter resets
  • One shot counting: When the counter presets and starts
modulo_flag bit (%IWr.m.c.0.1
  • Modulo loop counter: When the counter rollovers the modulo or 0
  • Free large counter: When the counter rollovers its limits.
Operation of the Flag Bits
The synchronization or homing event’s flag bit is set to 1 when a counter synchronization or homing occurs.
The modulo event's flag bit is set to 1 in the following counting modes:
Location of the Flag Bits
The following table presents the modulo_flag and sync_ref_flag bits which are elements of the %IWr.m.c.d status word:
Language object
Standard symbol
Meaning
%IWr.m.c.0.0
RUN
The counter operates in one shot mode only
%IWr.m.c.0.1
MODULO_FLAG
Flag set to 1 by a modulo switch event
%IWr.m.c.0.2
SYNC_REF_FLAG
Flag set to 1 by a preset or synchronization event
%IWr.m.c.0.3
VALIDITY
The current numerical value is valid
%IWr.m.c.0.4
HIGH_LIMIT
The current numerical value is locked at the upper threshold value
%IWr.m.c.0.5
LOW_LIMIT
The current numerical value is locked at the lower threshold value
Resetting the Flag Bits to 0
The user application must reset the flag bit to 0 (if it is active) by using the appropriate command bit from the following two bits:
Location of Reset to 0 Commands
The following table presents the sync_reset and modulo_reset bits which are elements of the %Qr.m.c.d output command word:
Language object
Standard symbol
Meaning
%Qr.m.c.0
OUTPUT_0
Forces OUTPUT_0 to level 1
%Qr.m.c.1
OUTPUT_1
Forces OUTPUT_1 to level 1
%Qr.m.c.2
OUTPUT_BLOCK_0_ENABLE
Implementation of output 0 function block
%Qr.m.c.3
OUTPUT_BLOCK_1_ENABLE
Implementation of output 1 function block
%Qr.m.c.4
FORCE_SYNC
Counting function synchronization and start
%Qr.m.c.5
FORCE_REF
Set to preset counter value
%Qr.m.c.6
FORCE_ENABLE
Implementation of counter
%Qr.m.c.7
FORCE_RESET
Reset counter
%Qr.m.c.8
SYNC_RESET
Reset SYNC_REF_FLAG
%Qr.m.c.9
MODULO_RESET
Reset MODULO_FLAG