User manual

Publication LOGIX-AP010B-EN-P - May 2010 63
Software Conversions Instructions Chapter 3
Counter - UP
The following example shows how a COUNTUP function in SIMATIC S5 can be converted into a similar function in
RSLogix 5000 for Statement List and Ladder formats.
The RSLogix 5000-equivalent bit/word for each bit/word used in the S5 in the following example is shown below.
Function S5 RSLogix 5000
Counter Preset DW20 data_word1
Counter Reset I4.1 data_bit2
Count Up I4.2 data_bit1
Output Q2.0 out_bit1
S5 Statement List RSLogix 5000 Structured Text
AI4.0
LDW20
SC1
AI4.1
RC1
AI4.2
CU C1
AC1
=Q4.0
C1.Pre := data_word1;
C1.Reset := data_bit2;
C1.CUEnable := data_bit1;
CTUD(C1);
out_bit1 := C1.DN;
where timer C1 is defined as data type FBD_COUNTER in the
program tags as follows.