SLC500 fun

JGrissom

Member
Join Date
Dec 2013
Location
colorado
Posts
18
Can you reset a group of counters using a copy instruction without reseting the preset values? If not how can I reset a group of counters without using an entire page of RES instructions?
 
You won't be able to do that with a COP. The COP works on continuous blocks of bytes so you would end up resetting everything related to the counter.

Do all the counters need to be reset in the same scan or can this occur over multiple scans?

Keith
 
Would be nice to do in one scan but not a must. I have copied template copy of a counter into all but would have to have two template type counters as there are two preset values needed.
 
Last edited:
If you do it over multiple scans you can use indirect addressing without looping. If it needs to be done in a single scan you can still use indirect addressing but you would need to use JMP/LBB looping. however, if you do that be EXTREMELY careful you don't get stuck in the loop.

I don't have the SLC instruction set in front of me but there may be a file manipulation instruction (F??) that would let you perform a looped logical operation on a file all contained in one instruction.

Keith
 
I tried to use indirect addressing but got an error saying indirect addressing not allowed when veriying the rung. I also tried to us FLL but would reset the preset values to zero.
 
It's not difficult to "reset" a group of timers by resetting the ACCU (not the PRE), using either indirects or cop's. But, I believe that if the .dn bit is already set, you'll have to also reset it -- just resetting the accu won't clear it.
 
It does not seem to be the same with a counter as I can't use indirect addressing because I get an error saying indirect addressing not allowed. The only way I found was to copy in a blank counter with the proper preset value and zero in the ACCUM and I can do as many as I want at one time. Just looking for a cleaner way if possible. This project is gathering OEE information on a machine so I need to get up/down/Operator breaks/scheduled down/corrective time buckets so I can compute the OEE values. Also I don't seem to be able divide two floats in a compute instruction, any ideas??
 
Also I don't seem to be able divide two floats in a compute instruction, any ideas??

Post your code. What error do you get? Remember "/" is not a divide symbol, "|" is.

How many counters do you have? sometimes brute force is the only/best way.
 
can you have the machine log in a code for when it it down?
when the machine is down, start a 60 second timer that increments a counter.

that way, you only have 3 registers to deal with, machine status code, seconds, minutes.

also, in regards to your floating point math, we do that all the time, are your ( ) in the right place?

regards,
james
 
James,
I have it set up to get the current hours/minutes/seconds from the PLC clock. I have 4 counters per time bucket so that would be 24 counters that count only if that category is selected and an additional one for when there is no category selected so it will keep track of the time until a category is selected then is transferred to the correct time bucket. This is why I'm trying to use either indirect or indexed addressing so I can write to these counters without having pages of code repeated over and over again with different counters.
 
I tried to use indirect addressing but got an error saying indirect addressing not allowed when veriying the rung.
You must have had a mistake. I tried indirect addressing using a MOV and it seems to work fine to move a value into any counter ACCUMULATOR. Also indirect addressing can be used with Unlatch (U) to reset the Counter DN bit. See picture.

You should be able to set up the a MOV and Unlatch in a JMP-LBL loop using a pointer to index through all your counters that need setting.

Counter Indirect Addressing.jpg
 
Last edited:

Similar Topics

Okay this is what I'm trying to do, I have several bits say B9:0 that are selections by operators. I want only one on at a time, I've tried masked...
Replies
2
Views
1,979
can the slc500 5/05 send a email and text over Ethernet ?
Replies
3
Views
151
Hello, did anybody know, if there exist an converting cable like the1492-CM1746-M01 (for an 1746-IB16 to an 5069-IB16), for an 1746-HSCE to an...
Replies
3
Views
360
Customer is buying several spare 504 CPU's to have one handy when there's an issue with the ones in operation. Having them on the shelf for years...
Replies
15
Views
2,759
You have to go offline to create the 'Trend' but do you have to download the program to go back Online with the Trend ?
Replies
0
Views
324
Back
Top Bottom