RSLOGIC 500 Counter

I would recommend using the cascaded counters method that was suggested earlier, then using a formula tag in Crimson to combine the two values into one. This would save you from having to display two integer values right next to each other.

For example, if you have two counters X and Y and the first one (X) resets at 1000 and increments Y by one, your formula would be: (1000*Y)+X.
 
Originally posted by Peter Nachtwey:



I would use a L regiseter, a one shot and a add block.

Assuming WeedRat needs to stick with his current hardware his options are somewhat limited. As stated the HMI doesn't supports long reads. Also, the ML1500 copy (COP) doesn't allow freeform data copy. You effectively have to copy within the same data type. So he can't even count with a long and then copy the words to integers.

I suppose he could do a double divide (DDV) by one and then take the individual words directly out of the math registers.

This all assumes that the HMI will transfer two consecutive integers and combine them as a double.

Keith
 
Last edited:
Kamenges:

The 1200 and 1500 do not support the DDV instruciton. I have a 1200 one running on my desk now and I was thinking the same thing you were. But it doesn't work. And the DIV instruciton operating on a long rounds the result and won't put anything in the S:13-14 math registers. So I guess getting a non-rounded quotient and remainder on L math is going to be a convoluted headache.
 
Alaric-


Did you set S:2/14 when you did your test? According to the help if this bit is set the math registers should stay valid until the next math instruction. So if you just did an ADD on a L data type the math registers should get populated.

Keith
 
Yes, I did set S:2/14. It does not seem to make a difference when using L words. It appears from looking at the 1200/1500 instrucion set reference that the math register is not affected by L word operations and that to use the math register to get quotient/remainder from N words the destination address must be the S:13 register. I tested it by doing a DIV 9 5 N7:20 and it put a 2 in N7:20 and nothing in the math reister, however, if I did DIV 9 5 S:13, I got a 4 and a 1 in the math register. AB need to learn "if it aint broke, dont fix it."

From the 1500 ISR:
Use the DIV instruction to divide one value by another value (Source A/ Source B) and place the result in the Destination. If the Sources are single words and the Destination is directly addressed to S:13 (math register), then the quotient is stored in S:14 and the remainder is stored in S:13. If long words are used, then the results are rounded.



edit:
There is a technote here about how to split a long into two integers, eg 344,999 is split into 344 and 999. Its a lot more convoluted than just using the quotient/remainder from the math register. However, it shows one way that the OP might split it for display but still use a long as a counter.

Here is the sample .RSS file on how to do it.

http://domino.automation.rockwell.com/applications/kb/RAKB.nsf/0/0127e511e4b4f45f85256afb00696bb2/$FILE/ATTAGC8J/Long2int.rss


edit again: I don't really like the example in the Rockwell tech note, here is one way to implement a long counter in the ML1200 or 1500 and split the value into two words for display and count to 32,767,999.





 
Last edited:
WeedRat,

I'll have one of our tech guys get in touch to make sure your problem got solved...

Cheers,

Mike Granby
President
Red Lion Controls
 

Similar Topics

how to delete password protection from rs logic500 (plc is micrologic 1400) i kinow the plc but i want to remove password protection. what is the...
Replies
3
Views
1,629
I logged on to one of my machines today to try to communicate with the machine (Micrologix 1000) and there are only two plc's on the network, but...
Replies
5
Views
2,135
Looking for info on converting RSLogix 500 file to RSLogix 5000 format. 1747-L552 CPU is being changed out with the 1769L35E
Replies
3
Views
9,817
Replies
6
Views
2,135
Hey, im pretty new in allen bradley, we only have one machine with that on our plant. This evening an colleague to me called me and told that the...
Replies
15
Views
5,021
Back
Top Bottom