Application Example - Siemens SIMATIC S7-300 FM 350-1 Manual

Counter
Table of Contents

Advertisement

Programming the FM 350-1

5.5 Application example

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
L
#1000;
T
T CNT_CHAN1.LOAD_VAL;
U
TRIGGER;
S
L_DIRECT;
R
TRIGGER;
CALL
CNT_CTL1
DB_NO
SW_GATE
GATE_STP
OT_ERR_A
SET_DO0
SET_DO1
OT_ERR
L_DIRECT
L_PREPAR
T_CMP_V1
T_CMP_V2
C_DOPARA
RES_SYNC
RES_ZERO
AN
OT_ERR;
JC
CONT;
L
CNT_CHAN1.OT_ERR_B;
T
DISPLAY;
SET
S
CON_OT_ERR
...
JL
END;
50
Explanation
// Enter load value in
// DB1 (double integer).
// DIRECT input parameter
(
// FC call with the DB 1
:=1,
//Channel 1
:=SW_GATE
// Control software gate
:=GATE_STP,
// Stop gate
:=CON_OT_ERR,
// Acknowledge operator error
:=SET_DO0,
// Set Output DO0
:=SET_DO1,
// Set Output DO1
:=OT_ERR,
// Operator error occurred
:=L_DIRECT,
// Load new counter value
:=L_PREPAR,
// Prepare new counter value
:=T_CMP_V1,
// Load new Comparison value 1
:=T_CMP_V2,
// Load new Comparison value 2
:=C_DOPARA,
// Initiate parameter change
:=RES_SYNC,
// Delete synchronization status bit
:=RES_ZERO);
// Delete zero pass status bit
// If no error has occurred,
// CONTinue
// *** Error evaluation START ***
// Read and display additional
// information.
// Generate RLO 1
// Acknowledge error
// Further error response
// ***Error evaluation END ***
FM 350-1 Counter module
Manual, 05/2011, A5E03648639-01

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents