siemens s7-300 counter wanted.........

f117

Member
Join Date
Oct 2007
Location
ath
Posts
26
hello again, i want a counter that counts from 0 to 65535 .......can you help me plz...? i have found counter that counts up to 9999 but it want bigger range.... thank you again
 
Last edited:
High speed counter, like FM-350? or Software counter?
If your counter is running upto 9999, then run 7 of these counters like Relay Race , ie start counter 2 when counter 1 reaches 9999, like wise.
 
This one is easy:

A I0.0 //whatever you want counted
FP M100.0 // Front puls
jcn END // Whenever front puls is negative then skip counting

L MW 200 // this is your counter
INC 1 // Increase counter by 1
T MW 200 // Store new counter value

END: NOP 0

Think that should do it....

Now if you take a MD you can have even larger counters.
Note: MWx can be replaced by DBx.DBWxx
 
If you use the INC instruction, you will only be able to count to 255. Use the "+ I" instruction instead.

edit: Also, if the counter needs to count above 32767, then you should use a DINT instead of an INT.
 
Last edited:

Similar Topics

i have problem with siemens fm 350 counter module on a s7-300. the "cr" lamp is off all the time, and the lamp "dir" always on... so the counter...
Replies
0
Views
4,114
L
Ok, normally when one does a counter, a done flag goes on when a count is done, either up counter or down counter... In Siemens S_CD or S_CU, the...
Replies
6
Views
10,870
Hello all. I have an ESA HMI that is connected to a Simatic S7-300 (CPU312). I have uploaded the program from the PLC which is written with Step7...
Replies
6
Views
1,437
Hello. There is a problem with Siemens S7 300. We got a replacement PLC but it does not run the program from the MMC. The new PLC is dated 2011...
Replies
3
Views
684
Hi to all, Our company does not usually use Siemens PLCs, but have a press with one in it. We are trying to change the IP address in our Simatic...
Replies
2
Views
1,064
Back
Top Bottom