6.4 Example application
Example for the use of the FC CNT_CTRL
The following example is representative for all functions and demonstrates the "Transfer load
value to FM 450-1" and "Start counter" functions to show how the FC°CNT_CTRL can be applied.
STL
L +1000; // Enter load value into
T KANAL1.LOAD_VAL; // the DB.
U INITIATION;
S LOAD_DIRECT; // DIRECT input parameters
R TRIGGER;
CALL CNT_CTRL, ( // Call the FC with the DB
// Channel 1.
SW_GATE :=START, // Control software gate
GATE_STP :=GATE_STOP, // Stop GATE
OT_ERR_A :=ERROR_ACKN, // Acknowledge operator error
OT_ERR :=OPERATOR_ERR, // Operator error occurred
L_DIRECT :=LOAD_DIRECT, // Load new counter value
L_PREPAR :=LOAD_INDIRECT, // Prepare new counter value
T_CMP_V1 := COMP1_LOAD // Load new comparison value 1
T_CMP_V2 :=COMP2_LOAD, // Load new comparison value 2
RES_SYNC :=RES_SYNCHRO, // Delete synchronization status bit
RES_ZERO := RES_ZERO); // Delete "zero crossing" status bit
AN OPERATOR_ERROR; // If no error has occurred,
JC CONT; // CONTinue
// *** Error evaluation START ***
L CHANNEL1.OT_ERR_B; // Read additional information
T OUTPUT; // and output.
SET // Generate RLO 1
S ERR_ACKN // Acknowledge error
... // Further error responses
SPA END; // *** Error evaluation END ***
CONT: ... // Continue with normal processing
AN LOAD_DIRECT; // Load direct function is ready
S START; // Open software gate
END:
Program
6.4 Example application
Counter module FM 450-1
44 Equipment Manual, 03/2022, A5E03648739-AC