another Siemens SCP equavalent

irondesk40

Member
Join Date
Jan 2008
Location
nc
Posts
630
Have another project coming up that we are looking into possibly being done with Simens S7-300 plc.
Have read some post on here about using the equivalent of the scp instruction like what is used with AB plc's.
To be honest, just not quite getting it.
Have a meeting this Wendsday with our local Siemens rep to schedule a training class.
I have a small sample of a program that I played with on my bench during lunch the other day that was done with a mircologics plc using the SCP instruction.
I have attempted to do the same with the Siemens software that I recieved last week, but to be honest, not very much luck at the moment.
I have posted a copy and if someone could just simply show the same type of code for the first SCP instruction would be worth its weight in gold at the moment. Not asking for anyone to do it for me, just lead in the right direction.
Hopefully, in the next few weeks will get to attend a Siemens training class for a few weeks, in the past you could order a plc, experiment with it, but now, that is almost out of the question due to time constraints, especially when over half the group has been let go for different reasons over the years as our company keeps cutting back.
Thanks in advance for any thoughts or direction.
 
I am not familiar with SCP but it looks just like "Scale" - FC105.
Fc105 is a standard block in the siemens library. Depending on what you have as your input (4-20mA, lets say)Then you put your engineering units into the scale block 4mA = 0 and 20mA = 167gallons. Really it looks very similar. You can multiply and divide in ladder to but I'm sure someone will post after me saying it is simpler in STL!
 
Here's an example of scaling an analogue input. The input is configured in the h/w editor to be 4-20mA. (The PIW value will be 0-27648 for 4-20mA if you want to do your own scaling or simulate the input)

FC105 from the library is used for scaling inputs. Click on the overviews, drill down to the standard library and drag FC105 onto your network.

fc105ex009.jpg
 
thanks to everyone on this site, great resource. FC105 works.
Now, only question I have is that if I am reading the manual correctly, the FC105 is looking for a value 0-27648.

With the ab, you can use the scp to take any numbers, for example if you have a value of 1230-14000 and it is not a analog input, you can still use the scp to give you a output from 0-100%, 0-8000 gallons, etc.

Do not have a siemens plc to connect to yet, but wondering can you do this same procedure with the fc105, or is it always looking for a input value of 0-27648.

Hate to ask so many questions on this site, but have so many things going on just dont quite have enough ram and hard drive in my head, if you know what I mean. Trying to read everything, but rely on this site and mrplc quite a lot.
I actually find something on here that I think i may need in the future and print them as pdf files and save for future reference.

THANKS TO EVERYONE FOR YOUR INPUT
 
The Siemens analogue input cards (apart from temperature measurement, resistor or PT100) always deliver a range 0 - 27648 (or possibly -27648 - 27648, if the input is bipolar, can't check that at the moment though).

Obviously, if you have some other signal, not coming directly from an AI, then you could always scale it to match the 0 - 27648 first before feeding the result to FC105. Whether this is worth the trouble, rather than simply doing the scaling yourself anyway, is another quesetion.
 
Here are the scale FCs I was telling you about.

I did not need bipolar scale so these are not. You could modify them easily enough if wanted to.

FC1000 through FC1009 are all scales. Some are int to real some are real to real some have alarm outputs if the output exceeds a certain point and some are just different combinations of these. I had several situations where having the right scale block made the whole program flow so much better. I was going to have to write the code anyway, so why not wrap it up in a FC in case I wanted to use it again latter.

FC1010 and 1011 are just to change a real to an integer and int to real. 101 and 1011 are used in 1000 to 1009 so you need these too. I kept running into situations where I had to convert. The rounding errors due to math were too large if I just did the math with integers but I did not need to continue using the larger reals everywhere after that point.

The analog in is an integer. So if you want to do any mul and div math and several steps of it as in a scale function, you have to convert to real to get any accuracy.

The FCs are in attached text files.

Open a source file in S7 manager or create one with the number of the function "FC1000.AWL" for example. Open the FC1000.AWL and simply paste the text into the source file, compile, save and then it should show up in your program edit window of S7 under "FC blocks" on the left in the project tree.

Feel free to use swap edit spindle or mutilate these blocks as you like.

If you open the blocks in the editor, and select ladder from the view menu, it should be easy to follow what I did.

These blocks limit the input also so the result can not be outside the upper and lower values.

And in response to your post they also allow using an offset like 12-36 = 0-100 or 1200 to 32000 = 25-75.

Just looking at each should make it obvious what they do, but if you have any questions or need a special block, let me know.
 
Berger and crumb trails and witches in gingerbread houses

Before you spend 100USD on Berger, spend some time reading the Siemens help files and search the Siemens site and do a google search for S7, I found several good sources of info on the net.

If you find the S7 help files difficult to understand, you be amazed at how many words Berger can use while avoiding any clarification of the topic disscussed.

There is one book by an American which is written like AB help.

Left page is what and why and the right page is the How. With example. In native English. And easy to follow. I forget the title I don't have it with me.

But even that book I did not use too much.

The only things that really need to be understood for an AB user are , data typing and the odd quirks of DT when compared to AB. Then the custom FC and FB.

The rest is a matter of searching the project tree for functions and put it into a rung and then hit F1. Repeat until you find the one that does what you want. After searching the Library for a week or so............don't laugh, I read them all, then you have a better understanding of when you need to write your own.

No need to spend hours writting stuff you already have for free.

DOn't expect Berger to solve any problems though, once you understand how S7 works on a basic level, then Berger gives you nice details and specifics, but it is not the clearest explaination for a new user.

You will need to understand European English too.

If I hve time , I can post an example or two.



http://www.plcdev.com/siemens_simatic_step_7_programmers_handbook


http://www.scribd.com/doc/12586568/Siemens-Simatic-S-7-300-400-Working-With-STEP-7

I have both of Berger's and the one by Clarence T. Jones

http://duniaengineering.wordpress.c...-s7-300s7-400-programmable-logic-controllers/

I liked the last one best as an American ex AB user , it reads well.

http://www.amazon.com/s/ref=nb_ss_b...books&field-keywords=step7+in+7+steps&x=0&y=0
 
thanks for assitance.
Have had to put this on back burner for the last month, been spending my time in dominican republic. We have a plant that a contractor installed a custom control system for a waste water plant using Omron, and the contractor has went out of business and to make a long story short, PLC and part of the controls got shorted out and it acutally caused the plc itself to catch on fire. Wrong size breakers etc., but has kept me pretty busy. No copy of program with any comments ( which sucks).
Hopefully will be able to get back on the siemens pretty soon. Have downloaded all of the post for reference and got a copy of bergers book, and you are correct, not the best reference I have ever seen, at least not for me, someone with no siemens experience.
 
Here are the scale FCs I was telling you about.

I did not need bipolar scale so these are not. You could modify them easily enough if wanted to.

FC1000 through FC1009 are all scales. Some are int to real some are real to real some have alarm outputs if the output exceeds a certain point and some are just different combinations of these. I had several situations where having the right scale block made the whole program flow so much better. I was going to have to write the code anyway, so why not wrap it up in a FC in case I wanted to use it again latter.

FC1010 and 1011 are just to change a real to an integer and int to real. 101 and 1011 are used in 1000 to 1009 so you need these too. I kept running into situations where I had to convert. The rounding errors due to math were too large if I just did the math with integers but I did not need to continue using the larger reals everywhere after that point.

The analog in is an integer. So if you want to do any mul and div math and several steps of it as in a scale function, you have to convert to real to get any accuracy.

The FCs are in attached text files.

Open a source file in S7 manager or create one with the number of the function "FC1000.AWL" for example. Open the FC1000.AWL and simply paste the text into the source file, compile, save and then it should show up in your program edit window of S7 under "FC blocks" on the left in the project tree.

Feel free to use swap edit spindle or mutilate these blocks as you like.

If you open the blocks in the editor, and select ladder from the view menu, it should be easy to follow what I did.

These blocks limit the input also so the result can not be outside the upper and lower values.

And in response to your post they also allow using an offset like 12-36 = 0-100 or 1200 to 32000 = 25-75.

Just looking at each should make it obvious what they do, but if you have any questions or need a special block, let me know.

These blocks might just be what I have been looking for to solve my problem. I followed your steps to compile the blocks (STL Source?), however when i attempt to download them to the PLC, I get a message that the blocks can not be copied? I have a 315-2 DP CPU (315-2AF02-0AB0). I'm not sure what's wrong, any ideas?

- DanJack
 
DanJack.
When you get an error message like that, then there will be an additional button with "info" or "help on message".
By that button you will get some meaningful reason as to why the download fails.
 

Similar Topics

Hi Guys. Apologies for the long winded script but I want to give you the full script I imagine some of you guys have been in the same situation...
Replies
9
Views
2,203
Dear All, I have a machine of stone cutting CNC. with Siemens 810D system. I am very tired to maintain(Servo drive failure) it now wants to...
Replies
8
Views
4,872
Hi guys I need to transfer a tia license for a couple of days from one pc to another via usb and then back again after wards. What is right way...
Replies
10
Views
6,825
Yes, I'm sorry, I'm starting this topic again. In my defense, I promise I tried to read on this forum and using other sources to get a good idea...
Replies
8
Views
4,293
Hi all, I need some assistance. Does anyone know if it is possible to or how to copy a HMI project from one program to another program...
Replies
5
Views
4,897
Back
Top Bottom