Can someone take a look at my code?

Jrivers010

Member
Join Date
Aug 2017
Location
Washington
Posts
20
So i made this thread yesterday. http://www.plctalk.net/qanda/showthread.php?t=111208

and i decided to give it a shot and work little by little. turns out, I can do more than i thought.

So i am working on one of the projects given on a Udemy course, and this is the problem statement. http://imgur.com/a/vc7E8

I wrote my program and i got it to clear test criteria 1. As you can see, the goal of this is to auto start the belt. once it hits the proximity area, shut off motor, and drop either one of the nuts, and sensor level reads it if full and it stops it. then it starts motor again to carry it off.

I tried to use a jump command for the "restart motor" part of the code, but it turns out the motor just stays on even when I force on the Proximity switch on my emulator.

https://www.dropbox.com/s/q7zafq0kccgpvt6/Re-Do.RSS?dl=0

why is that? how come its not working as i intended? (which was for the jmp command to only work ONCE, when the Lvl sensor bit is turned on. Going back to trigger a motor restart)
 
do not have 2 OTE of the same bit, like the motor conveyor bit, just parallel lvl sensor to motor on logic and remove the jmp. remember, this is ladder logic so once you reach the end of the ladder you start at the top again. http://prntscr.com/g66zro
 
remember, this is ladder logic so once you reach the end of the ladder you start at the top again. http://prntscr.com/g66zro

Yup. but for some reason, even tho i "get that" its hard to "get it" if you know what i mean.

I often write something, and something doesnt energize and i wouldnt understand why even tho i get that its reading from top left to bottom right simultaneously, I still dont understand sometimes when a previous bit wouldn't energize just because of that bit being on the bottom again. because, it energizes first, and then denergizes again because of a false at a later rung.

I will try to work with that logic you provided. thx
 
Yup. but for some reason, even tho i "get that" its hard to "get it" if you know what i mean.

I often write something, and something doesnt energize and i wouldnt understand why even tho i get that its reading from top left to bottom right simultaneously, I still dont understand sometimes when a previous bit wouldn't energize just because of that bit being on the bottom again. because, it energizes first, and then denergizes again because of a false at a later rung.

I will try to work with that logic you provided. thx
I'm going to try to help you understand how ladder logic works, as far as I understand it.
This is about a main ladder program only and not one with sub-routines in it. Sub-routines behave a little differently.
Each rung solves the logic contained within each rung on a one by one basis for each rung and writes the result to the output table or file, however you can vision it. Once the entire ladder has scanned, after the last rung has sent it's decision to the output table, the outputs are activated and whatever is stored in it as a result of the ladder logic will determine whether or not the output is energized on or de-energized off. After that the scan will repeat.

It is much easier, in my opinion, to just know and remember that you should use a physical output address once. There are exceptions of course and others will be quick to point that out. Ladder code just doesn't behave like other languages, like using "C", for instance.
 

Similar Topics

I recently made up some code to practice indexing and was told there was no way it would work. The code is as follows. Oil_Complete is a...
Replies
7
Views
2,184
ok... was wondering if anyone might help me by taking a look at my program and telling me what they think. I attached the .prj file from...
Replies
9
Views
2,170
Hi all, I'm struggling to understand a bit of code at the very start of an FB. OPN DB 100 AN M215.5 L DBW 452 L 1 +I T DBW 452 = M 215.6...
Replies
12
Views
2,734
OPN #base L DBW [#state_bits] L 1 AW L 1 <>I JC stat I don't get a ar1 ar2 movements and else. Tnx Marek...
Replies
11
Views
2,292
Hello, Can someone please convert a .RSS program file to a PDF? See attached. It's from a MicroLogix 1200 system. Thank you! Michael
Replies
2
Views
3,897
Back
Top Bottom