Compare in STL S7

userxyz

Member
Join Date
May 2002
Location
any
Posts
2,768
I have a question about a compare.

I know how to write a compare... that's not my problem. But I have a compare in a function with a little deadband. At the end of this function I write SAVE if the Compare is true.

So, I have something like this:

CALL (
IN1: VALUE_1
IN2: VALUE_2
MARGE: 0.005
)


To use the result I write it like this:

CALL (
IN1: VALUE_1
IN2: VALUE_2
MARGE: 0.005
)
A BR




But, if you have something like this:

A I0.0
A I0.1
A I0.2
...

And you want the compare call between 0.1 and 0.2, how can this be done ?
 
I fail to see the use of this in a pure A (and) sequence. Since the order of statements is irrelevant.

In any case, it's good practice (in my view) to do the call just prior to when you need the result. So it'll be:

CALL (
IN1: VALUE_1
IN2: VALUE_2
MARGE: 0.005
)
A BR
= #temp

A I0.0
A I0.1
A #temp
A I0.2
.....

This way you have very little chance of the #temp value/status being changed by other statements.
And also keep the boolean logic together, easier to troubleshoot......
 

Similar Topics

Hello I am currently learning on my own how to program a Siemens S7-300, and I have hit a bit of a snag with a FB I am making that will compare...
Replies
5
Views
5,415
DEAR FRIENDS, CAN SIEMENS PLC'S ( OR MAY BE ANY BRAND PLC ) MAKE DIFFERENCE (COSIDERING THE SCAN TIME ) WHILE SCANING A SAME CODE IN LADDER OR...
Replies
5
Views
2,286
Help please. Im new to Omron and have a machine down. I have a compare = for barcode label scan. I've attached two pics. On the Mnemonics you can...
Replies
4
Views
599
Hi everyone! Accidentally closed it and it wont appear again. Checked and unchecked the option and seem to make no difference. Running v7.10.00...
Replies
16
Views
1,813
I'm working on an array that contains a UDT of 5 Items Array[4] DataType[0] - Part 1 - Part 2 - Part 3 - Part 4...
Replies
1
Views
813
Back
Top Bottom