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
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
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.