How to do a structured text for a traffic light

BenHineline

Member
Join Date
Mar 2015
Location
greenville
Posts
2
Please help me I am new on here but really need help. I have been struggling to figure out how to do a structured text for a traffic light. Can anyone help me. Thanks in advanced. Ben
 
What platform of PLC?

Have you done a traffic light in ladder already?
If so, write out your ladder as a series of if... then statements, line for line. Once you've done that, the rest is just syntax.
If you haven't done this in ladder yet, then focus on that. Google search this forum for traffic light examples. They are legion.
 
I don't get what is exactley the problem.
I have already build a traficlight in SCL in TIA Portal.
Maybe I can help you if you be more specefic about your problem.
 
K93F, the problem is he wants your project, without learning how to do it, BM told him how to do it. When he has an attempt at that and posts it, people will be able to assist him to correct any mistakes.( correction here, l won't be offering advice as ST is like the bible to me)
 
I won't give him my program, he needs to try it him slef, as you sad. But if he has specific problem in his code, maybe i could give him some tips. That's what I meant.
 
I have done a traffic light already in logic. My teacher wont help me that is the problem with this college & I am not sure what you you mean by syntax. I am not asking for someone to do this for me I am only asking for someone to make sense of it for me. It does make sense with the if then statments
 
Originally posted by BenHineline:

...& I am not sure what you you mean by syntax.

https://www.google.com/#q=syntax

just like any other written language, Structured text in its various forms has a list of rules you have to follow as you write it. Where do you put commas? Where do you put semicolons? What do you have to put parentheses around? What are the function keywords? What are the restrictions on variable names? These are all examples of elements of a programming language syntax.

When someone tells you to write an "if-then" representation you will generally write it in what is referred to as pseudocode. It will have all the required logical elements for your function but if you tried to enter it character for character in a plc program it would likely not be accepted. That is where syntax comes in. It is also why one of the first questions that was asked is what plc are you dealing with. Not all languages that are referred to as structured text have the same syntax. With the acceptance of IEC61131 many of them are the same. But not all.

Keith
 

Similar Topics

I have an expression in a structured text routine of a Logix controller that looks more or less like the following: ResultInteger := Integer1 *...
Replies
13
Views
374
Good evening. I display the step number of a SFC on a display. Sometimes, on a trip, it goes quickly through many steps and I need to prove to...
Replies
1
Views
113
I am trying to set up a piece of equipment with a Horner HE-X4R. I'd like to use structured text and so far I'm just trying to get a basic On/off...
Replies
0
Views
67
Good morning. I'm doing a rehab and I need to recycle some part of the old code that won't change and that I need. This is a calculation that...
Replies
22
Views
1,342
I'm writing some structured text that's handling a data structure that comes from a PC. The PC structure is in the "new" LREAL 64-bit floating...
Replies
3
Views
481
Back
Top Bottom