Siemens STEP 7 Lite

Try the Help on STL from the ladder editor, search for data types and then drill down to find the necessary format:

data009.JPG
 
For your REAL type constants just type in 300.0 & 100.0

For the BIPOLAR input you have to use a BOOL data object when using Ladder but it's easier to change the view to STL, type in CALL FC105 and then you can assign the constants TRUE or FALSE to the BOOL input.

If you are going to do any serious programming in S7 then STL is a must-have skill as the other language representations are essentially sub-sets of STL.

It takes a while, but once the 'penny drops' you'll see that S7 can be a powerful tool.

Kevin H
 
Last edited:
L D[AR2,P#0.0] vbmenu_register("postmenu_293910", true);

I have many thoughts on this,

First is, Wow that is so cool that someone so far away would respond to my issue with such a nice complete solution, so quickly,........and for free.

Second, I wish I had time to sift through it and understand STL right now, but I don't. I must use Step7 and it must be Lad and we have orders coming in now for a machine that does not exist and I am the sole programmer here. Ah ........marketing.

Third, it just seems like Siemens would have made the original as neat as yours.

I thought "ANY" meant any as in just type it in. I have to re read what I can find on the data types. Everytime I re read it all gets a little bit clearer.

This was great, I feel like I should not have needed so much hand holding, and I still have so far to go.

Thanks again to everyone who stuck with me on this.
 
krk vbmenu_register("postmenu_293918", true);

I already agree Step7 is very powerful. I never doubted that from the beginning.

I am just having trouble digesting all this using the available documentation in such a short time. (I have to learn Step7 and write a program that works, using a process I have never seen and still don't fully understand, test it and ship it in 3 weeks, and one of those is gone.)

I would not normaly be such a forum bother but I have no time to work it out the slow way.

Thanks for the help.

Using 100.0 makes it a real number right?

And #xxx refers to a local variable? #m10.1

Is there a book that explains Siemens to new users in native English?
 
dahnuguy said:
.. I wish I had time to sift through it and understand STL right now, but I don't. I must use Step7 and it must be Lad ...

The code is written in LAD, it's just that source code only exists in STL. Follow the instructions to compile it and when you open FC222 from the blocks folder you will see it in ladder.

Later in your project, if you have further problems and need some code analysed, you can post it as source code. We can then compile it and run the same code that you are having problems with, with minimal chance of typos
 
Last edited:
L D[AR2,P#0.0]

Oh I see how that could be read two ways.

What I meant was, I would like to go through and understand how your block was made so I could aply that to other issues later. I have your block compiled and in use now, it is very nice.

It bugs me that I am using something I do not fully understand though.

I read through it and while I can follow it, and I get the basic idea, I could not write a similar block nor could I use this to write a slightly different block. I plan to study it in the future and I think it will help me grasp the issues much better. So it will be a valuable resource.

I like the idea of being able to make up your own blocks though, that is really nice.


But if understand you correctly, you wrote this new block in STL and in your block FC222 you call FC22.

I thought about making copies of the existing blocks in Step7 (I found a tool to unlock the standard blocks) and just modify them and play around until I get what I want.

Looking inside th blocks is what allowed me to see some of my problems.

Thanks again.
 
L D[AR2,P#0.0] vbmenu_register("postmenu_293947", true);

Please forgive my density for a moment.......

You made the FC222 block in Ladder?

Oh wait a minute! DO you mean you wrote it all out long way in ladder and then compiled it into one single block??????

That will be very nice if it true.

I just ordered the 2 books by Hans Berger and a new one called Step7 in 7 days. The latter got some very good revues.
 
Yep.

Edit: The editor "generated" the source code for me. Compilation is the process of taking source code and compiling it to produce a block in the block folder.
 
Last edited:
L D[AR2,P#0.0] vbmenu_register("postmenu_293952", true);

OHHHHHHHHHHH! that changes everyyyyyything!!!!!!!

I thought you wrote it in STL as it appears .........that was just to transmit the data through the forum. I suppose it is difficult to extract just the one block from the project and attach it in block form.

If I may , intrude on your extensive patience once more today ...........

I am now exploring this very thing.

I made a new object in the Manager. FC223

Now I open FC223 and put what ever I want into it using ladder logic commands.

Then compile from the file menu.......

My first attmempt has errors and will not compile, I will digest the new info and keep at it.

OK I am looking at your block in ladder and switching to STL and then working through the variable declaration table at the top of the page.



I should have it in a couple hours. I can read about the variabl table and the struct type.

This is an amazing functionality.

I assume this source code has to be included in a new project to take it with me as I collect a bag of favorite bits.

This makes up for so much of the difficult beginning.

Thanks so much, you may have just saved me on this one.

I may not be able to help much, but I will check back and see if I can "give back" to the forum.

I have never received any usefull help online before so this is quite nice.

Thanks again to all,
 
Not so fast.

I used the block editor to create the block. When I save the block, the editor automatically generates the source code in the source code folder. As you say it is very convenient for posting on the forum.

It sounds like you are editing the source file and compiling. Whilst this is possible, the chances are you will not generate code that will be viewable in ladder form.
 
I think we are on the same page.

I used the Manager to add the block to the project.

Then the block editor to add the ladder logic.

Then set up the options to generate the source

Then choose compile from the file menu.

Thats where I hit the snag / errors.

Error in title line error in comment line....but it looks just like yours in STL.



So I am looking for where I made the mistake.

This seems to me to be a step by step repeat of your efforts.

I tried to do this in a OB2 but it tried to compile the whole OB2 not just the couple of networks of ladder.
 
If you have the block open from the blocks folder and you try to compile it from the source file it will fail as the block is already open....



On a side note, what hardware are you using ? CPU model i/o cards etc.
 
Last edited:

Similar Topics

Hi everyone CAN SOMEONE EXPLAIN THE FUNCTION OF THE SYMBOL TABLE AND FLOW CHARTS.ON A PLC. Thanks James
Replies
2
Views
1,565
Good Morning, Hoping someone with some Siemens experience can give me a hand with this one. Customer has a S7-200 cpu, which has a 6GK7...
Replies
0
Views
254
I'm just trying to figure out the right method of adding a DO card to an existing rack. It's not the *next* open slot, but I have to move the AO...
Replies
5
Views
557
Hi Siemens Experts, I am hoping someone can shed some light on my issue. I have uploaded the code from a S7-300 (317-2PN/DP) using Step 7...
Replies
9
Views
691
Hello, We monitor the temperature of a pipe via a 4-20mA temperature transducer. This goes into DB135(Read Analog Inputs). The issue I have is the...
Replies
0
Views
632
Back
Top Bottom