Creating functions in S7

WilsonNC

Member
Join Date
Dec 2010
Location
Murphy
Posts
24
I want to create some functions that will return boolean values if conditions are met. For example I have a high and low limit, and then then input. My block has 3 input variables. I called them low limit, high limit and input. The output is boolean and is called "passed"

My function works when I insert it in a rung. However is it not possible to add another block or boolean operator after my function is inserted on the same net? I would like to compare some values, if true look at some vore values, set a bit....
 
I want to create some functions that will return boolean values if conditions are met. For example I have a high and low limit, and then then input. My block has 3 input variables. I called them low limit, high limit and input. The output is boolean and is called "passed"

My function works when I insert it in a rung. However is it not possible to add another block or boolean operator after my function is inserted on the same net? I would like to compare some values, if true look at some vore values, set a bit....


you need set save at the end of your function before exiting to enable the segment to continue after its call.
 
You have two alternatives, either always make the ENO from the FC true and then use the boolean return value with contacts between the blocks, or use the ENO mechanism. Here is an example of both methods:

save001.jpg
 
I used my local variable #passed in a second net in the function as a N/O contact. The output was SAVE. Will this work, or is there a better way?
 
I used my local variable #passed in a second net in the function as a N/O contact. The output was SAVE. Will this work, or is there a better way?

It will work if your aim is to not continue on the network on retuirn where you comparrison did not pass.
 
After the '=' the RLO condition depends on the logic.

The 'SET' forces the RLO to '1' independant of the preceding logic.
 
Its just an example showing you it will continue regardless if SET SAVE is used and showing an output can be used to continue if required.
 

Similar Topics

The idea here is to provide for a brief rapid influx of message codes while preventing sequentially repeating the same message. i.e. if two...
Replies
23
Views
828
Hello everyone, In a factory where we installed Citect 7.20 the computer began to show the first signs of end of life. They never considered...
Replies
0
Views
99
Hi everyone, I'm a last year student at the university in Ghent, and for my thesis i need to write a TwinCAT program that writes data to a .daq...
Replies
0
Views
156
When I go to create a new module in Studio 5000 I can't enter any information for the IP Address or change any other fields. Is there any fix to...
Replies
1
Views
268
Hello I am kind of new to the Rockwell world, i've mainly worked with Siemens and Schneider untill now. I am to make a HMI application running...
Replies
7
Views
1,094
Back
Top Bottom