Siemens Step 7, compare array [1..10] (REAL)

ason

Member
Join Date
Oct 2005
Location
Home
Posts
317
Hey i have a array [1..10]
that holds an other array with [1..10] real

I wonder if there is an easy way to compare those 100 values?

I want to set a bit if the value is in the range 100.0-150.0
 
SCL is the easiest language to use when working with arrays.

It isn't clear what you wish to achieve, do you and to set a bit true if any value in the array is > 100.0 AND < 150.0?

Nick
 
Second wote for SCL.

If you only have STL, then post exactly how the data is formatted (what addresses). Then I am sure that someone here on the forum (LD maybe ?) can whip up some code for you to paste into you project.
 
I got help from a workmate,
he did it in SCL..
i havnt the in/outputs here, but this is the code

Code:
// check value
  wrong_value := FALSE;
  FOR i := 1 TO 10 BY 1 DO
    FOR j := 1 TO 10 BY 1 DO
      IF test[i].prov[j] >= value_min AND test[i].prov[j] <= value_max THEN
        wrong_value := TRUE;
      END_IF;
    END_FOR;
  END_FOR;
 

Similar Topics

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
249
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
550
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
680
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
627
Please excuse the basic question, but I've never worked on Step 7 before (until now, only dealt with Mitsubishi Q-series PLCs)... What is the...
Replies
16
Views
3,336
Back
Top Bottom