Siemens STEP 7 Lite

I just Zipped it

The file I have is a simple ZIP file.RightClick->>Add To Archive -->Click.Why? Is there any problem with it?I unzipped it from the site and it appears to be all right.
Anyway thank you for your replies.It is invaluable help.I understand now the DB's and the addressing.I think so far that STEP 7 is great.Plenty of Blocks and the way you can structure it as far as I understand looks powerful.I will keep going with it.If somebody would like to have a look at the file I posted I would be gratefull.Just to mkake sure I didn't get anything wrong big time.Thanx:site:
 
In Simatic manager (non Lite) you archive projects from the File menu which creates a zip file. Your archive contains a K7P file which I haven't seen before - maybe it's unique to Step 7 Lite ?
 
K7P Files

I believe they are specific to STEP7 LITE as I tried extremely hard all across the internet to download a k7p file so I have some sample to look at and learn faster but I couldn't find any.
I liked the Siemens programming environment quite a lot so tonight I will buy the full version STEP7 Professional.I am determined to learn the whole lot so I will be able to do jobs not only in Allen Bradley,Omnron,GeFanuc,Mitsubishi but Siemens as well.So far I like it but of course I didn't come across a complex project like I did many in AB and I didn't come across any comms setup so we'll see.I give my best shot.
If someone could have a lok at my first project I posted earliewr in the thread and have a look if I made any big mistakes it would be nice.Tomorrow I am going to download to the CPU and comission the machine anyway.I hope it will be ok.
Thanx a lot
 
I too am new to Siemens.

I too have experience with several other platforms.

I too wonder why all the extra steps and little gotcha pit falls.

I would like to scale a value and specify the input min max and output min max. 105 assumes the input is the full range of an analog value and constants are not allowed.

I would also like to use a less than block to compare a variable which might be an analog input or memory location with the number 4. Can't do it.

Seems odd that all the extreme capability of this Step7 is the very thing that stops you from doing what you want in one step. Maybe that's why they call it Step7?

As best as I can tell, to use less than block, I have to define a memory location and use the move block to assign a value to it then if I used the same data type that the block will allow, I can then use this memory location to compare my analog input to. Oh wait no I can't I have to use the peripheral version of the analog input.

What's wrong with a block that allows the actual input to be compared to a constant?

AIW is less than 5. true or false

And having to assign the DB for a function block seems like just another place to cause a problem. Why not assign it in the background automaticaly? Do I really need to tell the software to use DB30 next?

I am sure allot of thought went into Step7 and I am making an honest effort to decode it. Only because I am being paid allot of money to do so.

But if anyone wants to write some code and make a machine work, I would recommend using anything but Step7.

You spend most of your time trying to satisfy the Step7 software instead of the actual logic. And in the end, it just turns on the output like all the others do.

I think if Siemens programers would use other softwares once or twice they would be amazed at how fast and easy it can be.

And all these answers that say "Well you can do X or you could do Y" Just to let you know, that doesn't help any. Unless you follow that up with HOW to do X or Y.

Even the manuals do this and seems to be embedded into the Siemens way of thinking.

"You could use a constant here" Except the block will not accept a constant. Or it says it wont, I can't try it because I can't find one place that spells out how to use a constant.

Like, how hard can you make writing "4"?

Well after 2 weeks with Step7, I still have hope that I am just missing something. So glad I didn't actualy buy it myself.

On the other hand MicroWinn and WinCC were fairly straight forward................but they were developed by TI before Siemens bought the company, so no German engineering there.

I am about done asking , can't get a straight answer, yes it is late, yes I am tired, yes I using my weekend to find answers for problems at work.

I could have written the whole project in a week with any other PLC software.

Germans.

OK I'm done.
 
dahnuguy said:
As best as I can tell, to use less than block, I have to define a memory location and use the move block to assign a value to it then if I used the same data type that the block will allow, I can then use this memory location to compare my analog input to. Oh wait no I can't I have to use the peripheral version of the analog input.

I don't quite understand what you're saying, but it sounds like you have type checking enabled. Siemens has an option in Ladder mode where they protect against a programmer making a comparison between two different data types. Turn this off (in the Options), and you can make any comparison you want.

Also, MicroWin was developed by TI guys, but WinCC is pure German (although early in develpoment, they got more US imput than they normally do. I know they worked quite closely with Microsoft, probably to give it fairly strong vb scripting suport right from the beginning).
 
thanks, that is the kind of little gotcha I am learning is the default in Step7.

I suppose it has a good basis for being there.

What I am saying in the above quote in your message is this.

I tried to use a "less than" black to compare a varible (an analog input) to a constant, like "5" or "500".

As in AIW4 is less than 500. In ladder logic not STL. I write it here in text because I don't have Step7 on this PC.

I just found out that "5" is not a constant, but "5.0" is. BUt the "less than" block still would not allow using the analog input or a constant. So you have to use

PIW4 is less than MWxxxx and then I had to use the "move block" to put a number in the memory location "MWxxx"

Where as in other PLCs I have used, You just use the analog in and compare it to a constant and get the result.

Now if I can apply your advice(which I would have never even thought to look for) and use "5.0" and "PIW4" it sounds like it should work.

If they worked closely with microsoft that explains some of the un necessary complication.

Why do we need VB scripts in a PLC?

After looking at the STL and how direct and to the point it is, I wonder why not just use "C" and sequel server and skip it all. Just compile the ANSI C code and download it to a processor with embedded I/O? That is the way it was before PLCs.

Ladder makes things easier and simple for maintenance and non programmers to use / troubleshoot an industrial controller. Making a PLC so complicated seems counter productive to me. Even after I figure it all out, I would never find a maintenance guy who could use it.

Step 7 looks like fun for engineers though. I am having fun digging through all the odd details, if I were not under so much of a time contraint, it would more fun.

Thanks again,
 
OK I just tried turning off the "type check of address" in options. But all it does is stop the nag message from popping up that tells you "type conflict"

The entry is still in red.

So for an example , how would you compare the analog input in input 4 to see if it is less than 1000 where 1000 is a constant.

Or try checking to see if the Analog input is between two constant numbers , like is analog 4 between 100 and 200.

AIW4>100 and <200.

I just tried using the "limit" block FC22 for this purpose. FC 22 has a Min and Max and input. And it says it is looking for "data type ANY"



S7 will not allow it. Or so it seems. I may be missing something.

And I am using ladder, not STL. But it looks like I may end up using STL.
 
The comparison instructions will accept constants. I think the problem is in your addressing- "AIW" is not correct. Try "PIW", and you'll be fine.

Also, 5.0 is a real number, and you will not get correct results if compared against an integer. Use "5" instead.

VB Script is not used in a PLC. WinCC is a scada package, which is what you were referring to.

After looking at the STL and how direct and to the point it is, I wonder why not just use "C" and sequel server and skip it all. Just compile the ANSI C code and download it to a processor with embedded I/O?

I don't know, I think STL would be a lot easier. But if you can somehow do this in C and SQL, go for it.
 
Here's an example using FC22, the variables have been declared in the temp area.

fc22009.JPG
 
Thanks,

I did notice the PIW issue, but it still will not accept a 5 in a compare.

Well it will allow the 5 but it is red so it is not accepted and will not compile.

I also am using WinCC so I may have muddled them and allowed some overlap in my comments.

I did not mean to imply that I could write it in C and SQL, but basicaly that is what we have , some text and a database and a compiler. My comment was to point out that I feel that STL is just a small step away from a Lower level language.

I also wonder at how so much can be done so directly with STL but Ladder seems to take so many extra steps.

Probably still me making it harder than it is at this point.

Oh something just occurd to me , do you mean to say I need to use "5" with the quotes to indicate a constant?

I think most of my issues are little things like that if tht is the case, I will check and see if that works.

I unlocked the function blocks in a sample program just to observe the contents. I found that the input of function block 105 is expected as an integer and is converted to a real and then the other numbers for the comparison are expected as real numbers.

Then all the math is done with real numbers.

I am sure if go through the process of writting my own block I will understand why it is done this way.

I have not had time to explore what "any" means in regards to a data type.

Thanks again this is a great place to find information.

Once I get this monster under control, I will be glad to leave some help for others. maybe even write a short getting started with S7 list of misc advice for AB users.
 
The constant should be entered without the quotes. Let's try something else to see what's going on: Switch to STL, and enter the following code:

L PIW512
L 5
>I
= M10.0

Then switch to ladder. I just tried it, and it worked fine. Let me know what happens.
 
L D[AR2,P#0.0] vbmenu_register("postmenu_293879", true);

Yes this is similar to what I have discovered to be the case. And it is the source of my questions / confusion.

In your first network you move 100 and 200 and PIW4 into memory locations.

Then in the next network you reference those memory locations.

All are int data type.

This is exactly my question / issue.

I would expect to be able to do all this with only the second network.

I would expect to be able to enter IW4 directly at the input of FC22 and then enter "100" and "200" directly as the min and max respectively and then have the RLO continue to the right and have the limited value moved into what ever location is selcted as the output.

What I expected to be true is not what I have found to be true. (No direct use of IW$ and no direct use of a constant without defining a memory location and moving a value into it.)

I was able to make it work using a technique similar to the one you have illustrated above. I just wanted it to be more streamlined and simple.

I do not wish to lamment the limits of one over another or make unfair comparisons. But it is simple different in other software.

One of the biggest differences with Step7 is that the RLO goes through the block and still gives you an output to use elsewhere.

In AB the "limit" function evaluates if the varible input is between the 2 constants min and max. If true you get RLO if not , no RLO. But no "limited value" output. And ability to make your own blocks, so I see allot of possibility here once I get past the beginning pain.

One other thing, what is the advantage of putting the data in the temp area? It looks interesting. Like it could make the block somewhat modular and "portable".

Thanks for your time.
 
As FC22 accepts ANY data types, you have to enter a variable name and cannot enter a constant. This explains the max/min values. FC22 checks the data type of the input variables at runtime to verify that they are all the same, hence I created the iValue temp and moved PIW4 to it. That way FC22 will work if PIW4 is a word or an int.

You could equally write your owm version of FC22 that accepted integer parameters and then you could enter constants. (You could even do a wrapper FC that in turn calls the Siemens FC22)

Here's an example wrapper in source code. (Create a new STL source code object in the sources folder, open it, paste in the code, then compile, fc222 will appear in your blocks folder)

Code:
FUNCTION FC 222 : INT
TITLE =
VERSION : 0.1

VAR_INPUT
  MN : INT ; 
  IN : INT ; 
  MX : INT ; 
END_VAR
VAR_TEMP
  fc22Data : STRUCT  
   MN : INT ; 
   IN : INT ; 
   MX : INT ; 
   RETURN : INT ; 
  END_STRUCT ; 
END_VAR
BEGIN
NETWORK
TITLE =
	  L	 #MN; 
	  T	 #fc22Data.MN; 
	  NOP   0; 
NETWORK
TITLE =
	  L	 #IN; 
	  T	 #fc22Data.IN; 
	  NOP   0; 
NETWORK
TITLE =
	  L	 #MX; 
	  T	 #fc22Data.MX; 
	  NOP   0; 
NETWORK
TITLE =
	  CALL FC	22 (
		   MN					   := #fc22Data.MN,
		   IN					   := #fc22Data.IN,
		   MX					   := #fc22Data.MX,
		   RET_VAL				  := #fc22Data.RETURN);
	  NOP   0; 
NETWORK
TITLE =
	  L	 #fc22Data.RETURN; 
	  T	 #RET_VAL; 
	  NOP   0; 
END_FUNCTION
 
Last edited:
S7Guy vbmenu_register("postmenu_293884", true);

That seemed to work just fine.

See the attached image.

On the first netwrk your code from STL to ladder. Very Nice.

On the second network, my issue.

I understand the use of PIW4 now, but what I have read indicates using PIW instead of IW is much slower.

Now why is it not allowed to use the number 5 or 100 as an input into the min or max fields?

After looking inside the block , I see that they are using real numbers.

Now if I look in the help file of the Scale block , I see that I can use

HI_LIM Input REAL I,Q,M,D,L,P, Constant Upper limit in engineering units.

So asyou can see, the documentation says I can use a constant. But shows it in red when I try use a constant.

I assume I am not entering the value as Step7 wantsit. But I can't find anywhere that clarifies the issue of how to enter what.

I have already tried everything that I thought made sense and several ways that I thought would not work.

If I goto the menu for ladder compares I must choose GT_I, GT_D or GT_R.

It looks as if Step7 wants to only compare like data types. If that is the case , I will need several additional steps for lots of tasks. Which is ok if I know that it is required.

Right now I am just trying to figur what is possible and how to get it.

Thanks for your time.

Thsi forum is a big help. I hope I can give something back, but I doubt I could help you guys with much.
 

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