Need help with school project

rjyusmc2005

Member
Join Date
May 2016
Location
Ky
Posts
2
What am I doing wrong? This is a project for school and I thought I had it until I added the JMP/LBL instruction set to work as a loop. When I do that, it freezes once it gets there. I want this to cycle thorough start to finish from the time you press the start button (I:1/0) until the stop button (I:1/1) is pressed. I know it may not be the most efficient way to implement it, but it is functional, except for the loop. Any guidance or suggestions how I can fix the this to get it to properly loop would be greatly appreciated. Is there a better way to reset all the counters at once other than a reset command for each of them near the end of the program?

Oh, this is using LogixPro software.

1Capture.jpg 2Capture.jpg
 
Welcome to the forum!

Without having any details as to what this is supposed to do, we're really taking blind guesses (ok, perhaps educated guesses), but I will offer this piece of advice:

Do not use a JMP/LBL instruction. There are very few places where they are really the right thing to use, and this isn't one of them.

Remember that a PLC in and of itself is self-looping, if you will. It runs the code over and over all by itself. As we have no functional spec to refer to, I'm not sure what extra functionality you're trying to achieve by looping, but I would suggest you might be looking at it the wrong way.
 
Here is my intended action. This is supposed to be operation for an automated paint booth, or at least that was my intent. The loop I am trying to implement is essentially moving one item out an another in once the paint process is completed. I have also attached a crude flow chart of the intended operation.
_____________________
- Pressing start applies power to the system
- The doors open
- An alarm sounds for 1.5 secs
- 5 secs after the doors open, the carriage system begins moving the product to be painted into place
- A proximity sensor in the center of the chamber detects the product
- When product is detected, the carriage stops
- The up counter is incremented by 1
- The doors close
- The operation light turns on
- 5 seconds after the doors close, the sprayer activates for 30 seconds
- After the sprayer shuts off there is a 5 sec delay before the process repeats unless the stop button has been pressed.
_____________________

flow.jpg
 
I want this to cycle thorough start to finish from the time you press the start button (I:1/0) until the stop button (I:1/1) is pressed
As ASF said, PLC runs the code cyclic. you don't need to do it by yourself and in your sequence you don't need to implement any loop.
 
this is best solved in a sequence.
or next a state machine, the diagram can be used as a lead.
example sprayer activates:
set sprayer ON
start spraytimer
if spraytimer.Q is on then change state to sprayer shuts off.
 
answer to your question: "What am I doing wrong?"

here's what we're all telling you – but said in a different way ...

apparently you're trying to use a "looping" action to provide a "pause" in the machine's operation ... now that approach might work just fine for a program written for a desktop or a laptop computer – by providing something like a "delay" of several seconds while the operator reads a message on the screen – or something along those same lines ...

but ...

programming a PLC to "pause" in a "looping" action would be the kiss of death ...

think about this: there are invariably a LOT of sensors – and limit switches – and start buttons - and stop buttons – etc. - that are all connected to the PLC as inputs (either on the one machine that you're programming now – or on other machinery to be added to the program later) ...

now suppose that you COULD get the PLC "loop" to cycle, and cycle, and cycle for several seconds ...

question: while the PLC is "pausing/looping/running-around-in-circles" what about all of those other input devices? ... and even the other output devices? ... in simple terms, if the PLC is forced to "hang in a loop" then it is NOT able to pay attention to any signals which are coming in – or going out – of the system ...

in a nutshell – you need to ditch the "looping" idea – and start thinking in different paths ...

if you need help with that approach, just ask the forum and you'll get more detailed hints ...

and rest assured that most "computer" programmers make this same type of mistake when they try to make the transition to PLC programming ...

good luck with your project ...
 
Last edited:
Here are a few hnts. Please zip and attach the .rsl program. Other forum users have LogixPro and can experiment more easily with your program. For those that don't have LogixPro, you can print and attach the program as a.pdf file with CutePDF or a similar program.
You might want to split the Run into 2 separate functions. The 1st function would be a System enable . The 2nd would be a Cycle Run/Stop function. That would allow a normal End of Cycle stop or a "Stop Now" function. This would allow you to now set up your continuous run action.
Another suggestion is to not put outputs in series on the same rung. This includes timers and counters.
 
rest assured that most "computer" programmers make this same type of mistake when they try to make the transition to PLC programming ...

good luck with your project ...

I am such a person! I come from the world of desktop computer programing and I still have a hard time trying to remember how a PLC must be able to scan and act upon it's inputs.

I am getting better at understanding the program flow of PLC's because of this forum and a special friend, that is a excellent local PLC programmer.

So be patient, ask question and HELP will come.
 

Similar Topics

I have a project for school that has been holding me back from moving on to the next project. We are using Allen Bradley is there anyone that...
Replies
2
Views
1,476
I'm fairly new to Rockwell software, I've had some basic training in the past but nothing too advanced. My company and I use Reliable products for...
Replies
9
Views
237
Hi all, I am having issues accessing my Cimplicity software - the site code changed after re-install and I am no longer able to attain a new key...
Replies
10
Views
156
Good day all! Can someone help me with the procedure to update Beijers E700 firmware? The Panel I am working on is firmware 2.04v and I would...
Replies
1
Views
62
Back
Top Bottom