Any suggestions for streamlining?

danaguesswho

Member
Join Date
Apr 2011
Location
usa
Posts
3
I have completed the first part of the light simulator, I was wondering if there was anything I could have done different in this? I will try and post this JPG.

I have been doing industrial maintenance, electronics, fabrication and electrical for 23 yrs, this is my first attempt at PLC's, I am currently taking the course from the learning pit dot com on PLC programming and I like it so far, I also want to try the course provided from this site after, ( all self taught).

I bought the first book on the PLC from this site , unfortunately it was something that was free on this site (as in the tutorial) So on that note I am wondering if anyone has done this course from this site , if so feedback would be appreciated. I want to further my education and am very interested in learning.
ladderrungs.jpg

http://img156.imageshack.us/i/ladderrungs.jpg/

link for the program on the traffic light.
 
To streamline your posted code, I would suggest using only 1 timer, and use LIM (or GEQ/LES) limits on the accumulator value.

I would suggest it would be easier to add East/West, Filter Lane lights, pedestrian crossing lights etc. etc.

Your light sequence goes Red, Amber, Green, Red, Amber, Green, etc. Do traffic lights in your country do that ? In the UK they go...

Red
Red+Amber
Green
Amber
Red

As you get deeper into the programming, you will realise that there are several alternatives - for instance A-B PLCs have a SQO (Sequencer Out) instruction, that takes sequential bit patterns from a storage file, pushes them through a mask word, and can be directly output to specific bits in the output word. In fact, using SQO (and a bit of cunning), it is possible (in an A-B PLC) to do a full N/S-E/W traffic light sequence using only 2 instructions !

If your hardware platform doesn't have a SQO, or equivalent instruction, it can be programmed using "standard" logic, but usually involves a technique called indirection, where one instruction can address sequential elements of a data file.

Food for thought....
 

Similar Topics

I know this topic has been brought up a few times, but i had some specific questions. I have installed several 1783-NATR devices and they have...
Replies
0
Views
24
I'd like people's opinions on which manufacturer of hardware they prefer. We are an aerospace manufacturing facility that does little to no SCADA...
Replies
10
Views
527
I am setting up control for Hypochlorite dosing. The easy part is the dosing calculation for flow pacing but I would also like to setup trimming...
Replies
8
Views
942
I'm working on an application and have hit a bit of a snag. I need to find an industrial touchscreen display that can: - Tolerate down to -40C...
Replies
7
Views
753
Hello Everyone, I am reaching out to this knowledgeable community with a peculiar problem I've been experiencing with a PLC 5/40E. This issue has...
Replies
16
Views
2,264
Back
Top Bottom