Compare Stl,ladd,flow Chart

d jagtap

Member
Join Date
Jul 2005
Location
mumbai
Posts
6
DEAR FRIENDS,


CAN SIEMENS PLC'S ( OR MAY BE ANY BRAND PLC ) MAKE DIFFERENCE (COSIDERING THE SCAN TIME ) WHILE SCANING A SAME CODE IN LADDER OR STATEMENT PROGRAME(STL) OR FLOW CHART ?



REGARDS,

DATTA JAGTAP
 
The key phrase here is "same code".

If you use three different design and programming methods (LAD, STL, SFC) to perform the same task, you won't generate the same code in the PLC each time. Generally the language which gives you the greatest opportunity to think and write in terse economical statements is STL. But then you have to accept there is no graphical view on the program as there is in LAD. If you think and write in LAD, then it may be more visually attractive to you and others and you can always switch to view it in STL. However the LAD editor requires extra embedded statements to make the visual structure consistent, so it will generally require more memory than STL - and hence have a longer scan time. Finally SFC (Sequential Function Chart - is this what you mean by flow chart?) is the most memory intensive of all, usually because of all the features and facilities it automatically build in to control the step-wise nature of execution. I'm not suggesting this is the 'worst' language - I doubt if most human programmers could write the code any smaller in STL to achieve the same tasks.

So overall the "same code" will always execute at the same rate no matter how it is generated. However, the likelihood of producing the "same code" from three different approaches is virtually nil.

Regards

Ken.
 
Ken, I totally agree with your comments (and they are very well put) when applied to Siemens Step 7 plc's - does the same apply to AB et al ?
 
Simon

You're right - my comments were entirely based on Siemens S7. However, conceptually at least, I don't think that any other programmable system would differ.

I've seen an example where someone (yeah, it's like going to the doctor to discuss an embarrassing problem that "a friend" has!) wanted to multiply an integer by 16, and compared two methods of doing this. One was a traditional MULT instruction, the other was just a bit-shift by 4 bits. Of course for all practical purposes the end result was the same, but the execution time (as tested in a big loop) was clearly not the same. At the level of the microprocessor instruction set it was presumably executing different code which took different lengths of time. And the difference existed whether both examples were coded in LAD or both in STL.

Of course, the result wouldn't be the same across the entire scope of the operation. If the original integer was large enough, the bit-shift failed miserably and gave no warning of this - it had done its job. But within defined values the results were identical.

I'd be interested to hear if anyone knows examples of genuinely identical pieces of code varying in execution speed according to how they were generated.

Regards

Ken
 
I don't know about Allen-Bradley SLC, because I don't have the possibility to program FBD there. With the Allen-Bradley CompactLogix you can't convert from one representation to the other. You have to program in LAD or in FBD. The resulting programs are therefor NOT the same. You can enter a LAD rung in something similar to STL, but I don't know how to do the same for FBD. The representation shown when monitoring is always LAD or FBD, depending on what language you used to create the logic. I don't know if it is even possible to monitor in STL-ish.

My OMRON CQM1 on the other hand can, similarly to Siemens, swith between LAD and STL, both for programming as for monitoring. The code remains the same for the two representations. There is even no need to enter special codes to make switching possible as is the case with Siemens.

I prefer to monitor in LAD, whatever the system used, because the similarities between different systems are the greatest in that representation.

Kind regards,
 

Similar Topics

Hello I am currently learning on my own how to program a Siemens S7-300, and I have hit a bit of a snag with a FB I am making that will compare...
Replies
5
Views
5,429
I have a question about a compare. I know how to write a compare... that's not my problem. But I have a compare in a function with a little...
Replies
2
Views
4,137
Help please. Im new to Omron and have a machine down. I have a compare = for barcode label scan. I've attached two pics. On the Mnemonics you can...
Replies
4
Views
622
Hi everyone! Accidentally closed it and it wont appear again. Checked and unchecked the option and seem to make no difference. Running v7.10.00...
Replies
16
Views
1,901
I'm working on an array that contains a UDT of 5 Items Array[4] DataType[0] - Part 1 - Part 2 - Part 3 - Part 4...
Replies
1
Views
839
Back
Top Bottom