Strange behaviour for an S7 counter?

uptown47

Lifetime Supporting Member
Join Date
Feb 2008
Location
Over there, next to those boxes
Posts
1,146
Hi all,

I was messing around with a counter today, using the Set and Preset Value inputs. I would normally post a picture of the code but, as I haven't got S7 on this computer, I'll just describe the 2 lines of ladder and the unusual outcome I experienced to see if anyone has an explaination...

Network 1:
If I0.0 comes on MOVE 8 into MW20

Network 2:
A Counter with I0.1 on the SET input and MW20 on the PRESET VALUE input.

Behaviour:
Switch I0.0 on and MW20 is equal to 8

Switch I0.1 on and 8 goes into the counter

All fine

Change the value to 10 and do the same, PLC goes to STOP mode
Same behaviour with values 11,12,13,14,15 (i.e. all the HEX letters).

When the value is 16, the counter works again

This is something to do with values that are represented with letters in HEX.

I had the same problem with 170 (i.e. AA) but not with 60 (i.e 96)

???

Anyone any ideas why this might be??

🔨
 
Count values are in BCD and go from 0 to 999

A count of 10(decimal) is entered as 10(hexadecimal)=16 (decimal)

An invalid count value (i.e. not a bcd number) results in an error OB being called.
 

Similar Topics

Hi All, I'm just trying to understand the reason behind something I recently experienced. Background: The system contains 4 CompactLogix...
Replies
2
Views
127
Hi All, I am using a Red Lion graphite G12 panel to draw a scatter graph, all works well until I run this code every morning to reset the arrays...
Replies
19
Views
6,407
Hello, I have several plastic-sleeved roller conveyors in series, all driven by the AB PF525's. Most of the conveyors are straight, except for...
Replies
34
Views
13,123
Hi all, I need to change an IP address on a CPU and wanted to check the hardware config was correct. I compared the 'System Data' in the blocks...
Replies
0
Views
2,065
Hi guys this is my first post on this forum but I have been a long time browser. I have this issue with a micrologix 1500, it's a strange one...
Replies
4
Views
2,122
Back
Top Bottom