MicroLogix 1500 programming questions

P

Thread Starter

Pete Arthur

I was wondering if there is an easier way to add large quantities of Integer files together other than using the ADD instruction that allows me to add A+B? I need to add A+B+C+D+.... Also, if I have a timer with a preset that is larger than 3600 seconds (1Hr)I would like to setup a readout on the PanelView 300 that will display the time in HR/MIN/SEC format? Any advice would be greatly appreciated.
 
A

amora fibrianto

> I was wondering if there is an easier way to add large quantities of Integer files together other than using the ADD instruction that allows me to add A+B? I need to add A+B+C+D+.... ## I'm afraid there'are no other way ??? since the ML1500 doesn't support CPT instruction > Also, if I have a timer with a preset that is larger than 3600 seconds (1Hr)I would like to setup a readout on the PanelView 300 that will display the time in HR/MIN/SEC format? Any advice would be greatly appreciated. > ## have u try to assign different tag for HR, Min, Sec ?? Rgrds Amora Fibrianto
 
With out putting in too much effort on my part i offer some suggestions. put a pulse timer in your program, handy thing, that will count by seconds and go on at 60...1 minute..keep running through duration of cycle. your user can input in minutes, and when the pulse comes on(1 minute).. you go pulse the timer or counter up or down 1....also even better still.. two timers, one goes on every sec... and the other times every pulse(on) of the first and comes on at the minute. sec timer can be used for the blinkers... you will be able to have values for your hr comp min comp and sec comp by this...now i forget if there is a comp for all three to be displayed in the most recent panelbuilder maybe, but you could just have three..one for each...to save space, perhaps a multi-display, which only shows current *blank* with hr/min/sec embedded into it....counting up or down. for the add, i would have an always adding branch of all the values(a+b+c+d+...=sum). while at first i was thinking that these values could be put to integer tag then moved to counting branch (input + sum= sum) and to counter/timer, there for shortening the branch.. i spent more time thinking about what if they were quick to put in numbers, and also of the limitations of the panelview/rslogix, and in the end said to my self......by now i could have written out the add all branch and not have worried about coliding values. one thing to consider...if you are adding all values.. make sure an unused timer, counters preset value is zeroed out if not directly done by user through terminal...or old integer will be added too. hope this helps. heather.
 
P
Heather, Thanks much for your suggestions. I like the idea of a pulsed timer. Regards, Pete Arthur
 
P
> Is this to show machine total time operation? > Thanks for the reply. No, the machine I am working on is a finishing machine. The user is going to be able to adjust the different components of the finish cycle (hence the 15 different timers). This timer is going to display the cumulative time for the cycle as determined by the user entries, then count down. Regards, Pete
 
P
Amora, Thanks for the reply. I was afraid I'd end up manually adding all of the presets together, but I thought it worth a try to see if somebody had a better idea. As for the Pview, I would agree that having separate tags for each is going to be the way to go. Regards, Pete Arthur
 
For your second problem, remember that the DIV instruction places the rounded quotient in the destination address, and it also places the unrounded quotient in S:14 and the remainder in S:13. Create a rung with the following five branches: DIV N7:10 60 N7:1; N7:10 is your total time. The remainder in S:13 is the number of seconds. MOV S:13 N7:1; move the seconds to N7:1. DIV S:14 60 N7:2; The remainder in S:13 is the number of minutes. MOV S:13 N7:2; move the minutes to N7:2. MOV S:14 N7:3; move the hours to N7:3. Hours, minutes, and seconds are now in N7:3, N7:2, and N7:1.
 
A

Alan Rimmington

If you use indirect addressing you can achieve your addition for as many timers as you like using just 8 instructions. I could e-mail you an example. The easiest way of displaying HR/MIN/SEC is to drive two counters from a 60 second timer. 60 second timer loops using dn bit in series with coil. On timer dn increment counter 1 (minutes) preset at 60, when done increment counter 2 (hours) preset 24. Each counter would need to reset its self when done. Again e-mail me if you would like example - [email protected]
 
J

Joe Jansen/ENGR/HQ/KEMET/US

>I was wondering if there is an easier way to add large quantities of >Integer files together other than using the ADD instruction that >allows me to add A+B? I need to add A+B+C+D+.... Not in a micro. 5/03 and higher have a CPT (compute) function block that allows for more complex math, but it is not available in the micrologix. >Also, if I have a timer with a preset that is larger than 3600 seconds >(1Hr)I would like to setup a readout on the PanelView 300 that will >display the time in HR/MIN/SEC format? Any advice would be greatly >appreciated. go to www.plcarchive.com and look for timer to HMS.pdf. I put it together quickly and posted it. I have not yet had a chance to put it on hardware, but it should work. I will try it out this weekend or early next week when I get my PCMK card back. If anything needs to change, I will make the appropriate adjustments and post another message. Hope this helps!! --Joe Jansen
 
P
Thanks very much to all of you who have obviously put quite a bit of thought into my query. I really appreciate your help with this! I will have a go at the example code you posted Joe. Thanks for your help. Best Regards, Peter J. Arthur Emerson Drive Solutions
 
Top