Function Calls - Siemens S7 22x

ltrail

Member
Join Date
Sep 2003
Location
Pennsylvania
Posts
25
I am new to programming the Siemens Step 7 Micro/Win software. But I found a useful subroutine albeit Function Call on the internet to provide scaling of analog inputs. After I copied the routines in LDR into my Networks, I realized that they ought to be in the SBR areas instead of Main. Anyway, I cannot find a block that provides the following:

EN, analog input from temperature transducer, Min Value, Max Value on left side of function block. Then ENO and Raw (Scaled) output in LDR on the right. Is this a technique for more sophisticated software than what I am useing? Or is there a method, say in STL to generate this. I want to install such in a Network in Main as a Call to a Subroutine using the input from a sensor that is unscaled. Thanks.
 
Siemens S7 Function Calls

Thanks for the LDR routine. Would you please tell me how to develp the call as you show it? What generates the "box" with variables? I could certainly use what you show but I would like to know how to create the Calls. Thanks.
 
Study what is going on in regards to the "local" data in the subroutine. Inside the subroutine you will notice at the top
are SYMBOL VAR TYPE DATA TYPE COMMENT

Just declare values there, decide what is going to be passed IN to the block and what is going to be written OUT of the block, then write your code around that.
 
Enlightenment !!!!

JWR. I've come to a milestone. I entered the data as you instructed in to the Subroutine's variable list. Nothing happened. But this evening, while looking at the main program, decided to visit the block list menu item once again. I discovered there, that the new subroutine block appeared! That was the missing piece to the puzzle. I now understand that I can create a block of any number of inputs (limited) and outputs (limited) and a block will be created and named as I desire. This is the information lacking.

My S7 224 with TP070 HMI, internet module, and analog module arrived today. Fun begins!
 

Similar Topics

So I have a program for an Omron CJ1M PLC that I have to reverse engineer for a customer. This PLC is meant to control a water pump station...
Replies
2
Views
1,823
Is this possible? I'll use this scenario as an example. I have a function block that represents the behavior of an I/O card, say a 2 channel...
Replies
8
Views
2,197
I know there is a way to do this...but I'm sufferring from brain-lock at the moment, and can't remember how :) I need to be able to pass a word...
Replies
8
Views
4,881
im having some trouble in one of my labs, what im stuck on is this... i need to turn on 3 outputs when the plc goes into run mode, using only two...
Replies
15
Views
6,245
Im trying to create a level indicator for water Tank i have used the ADD function while the pump is on and level increasing everything works...
Replies
14
Views
108
Back
Top Bottom