Programming the FM 350-1
5.5 Application example
FM 350-1 Counter module
50 Manual, 05/2011, A5E03648639-01
5.5 Application example
Introduction
The example below shows how the CNT_CTL1 function can be used for the functions
`Transfer load value to FM 350-1' and `Start counter'. These functions are representative of
all functions here.
Prerequisites
The load value to be transferred must have been entered in DB 1.
Example for Transferring the Load Value to the FM 350-1 and Starting the Counter
STL Explanation
L #1000; // Enter load value in
T T CNT_CHAN1.LOAD_VAL; // DB1 (double integer).
U TRIGGER;
S L_DIRECT; // DIRECT input parameter
R TRIGGER;
CALL CNT_CTL1 ( // FC call with the DB 1
DB_NO :=1, //Channel 1
SW_GATE :=SW_GATE // Control software gate
GATE_STP :=GATE_STP, // Stop gate
OT_ERR_A :=CON_OT_ERR, // Acknowledge operator error
SET_DO0 :=SET_DO0, // Set Output DO0
SET_DO1 :=SET_DO1, // Set Output DO1
OT_ERR :=OT_ERR, // Operator error occurred
L_DIRECT :=L_DIRECT, // Load new counter value
L_PREPAR :=L_PREPAR, // Prepare new counter value
T_CMP_V1 :=T_CMP_V1, // Load new Comparison value 1
T_CMP_V2 :=T_CMP_V2, // Load new Comparison value 2
C_DOPARA :=C_DOPARA, // Initiate parameter change
RES_SYNC :=RES_SYNC, // Delete synchronization status bit
RES_ZERO :=RES_ZERO); // Delete zero pass status bit
AN OT_ERR; // If no error has occurred,
JC CONT; // CONTinue
// *** Error evaluation START ***
L CNT_CHAN1.OT_ERR_B; // Read and display additional
T DISPLAY; // information.
SET // Generate RLO 1
S CON_OT_ERR // Acknowledge error
... // Further error response
JL END; // ***Error evaluation END ***