I am new to PLC programming, I know programming for software development but applying this knowledge to PLC programming is causing some difficulties.
I thought what I needed would be a rather simple program, but my skills just aren’t there yet.
I am using Arduino Opta PLC and the Arduino PLC IDE.
Keyence IV4 vision system
Banner K50 illuminated touch button
I need a program with 1 button that will work with 2 different pushes. I need the first push of the button to actuate a cylinder and latch the cylinder in place, then do nothing until the second button push. The second button push will trigger the vision system to check if the part has its components in place. If it sends a good signal the cylinders release and resets for the next part. If there is a no good part it does nothing and waits for the good signal. I will also have a separate reset button in case it needs to be reset.
I would appreciate any assistance in this. I'm trying to keep it in one of the PLC languages so future engineers can modify it. I was caught off guard at how fast PLCs really are. That and traditional programming language techniques don’t apply.
Hello,
I never worked with PLC coming from Arduino
What language are you actually to use to program it?
My personal goal is to use ladder logic or structured text. I just learned that there are case statements available in these languages. I am now trying to make a state machine.
Alright.
A state machine could be a could choice.
Did you find any tuto or help on how to perform this in ladder (or else)?
I did find some guides using structured text state machines, I do feel more comfortable in ST for now. I'm used to programming robots and using other procedural languages. I got to say PLC programming took me by surprise, I thought it would be different. It's so fast and feels like everything happens at once.
When I get this project done I will definitely be taking some online courses to further my knowledge in PLC programming.
Actually all outputs of a PLC are updated at the same time
We could divide the way it works in three steps. Careful, here I'll explain how would work a single network not all the program. Obviously if a network takes more time to compute than another then the output will be updated later.
- Step 1: The input are stated. The PLC saved the state in local memory so the if it changes during the cycle it won't affect anything.
- Step 2: It compute what it has to, if you used some conditionnal block or whatever. It could take several cycles. From there, it know what should be the value of the output.
- Step 3: It updates the outputs to the new state.
So if you have two network that takes the same time to compute, the output will change at the same time (as long as the input change at same time ofc)
Thanks, that makes since has what I have done so far is acting the way it is.
Today I put my assembly jig into production and it's working very well.
The steps are: Insert part, touch button, part gets locked in place, put components on part, touch button, if components are present, release part, if ng, hold part until good signal. I also have an illuminated button that changes color based on the current status.
Figuring out rising and falling edge was a game changer for me. It's a very simple concept but I just didn't know about it.
Anyway, thanks for the guidance.