Min/Max check with Pointer S7

simhall

Member
Join Date
Mar 2008
Location
Sweden
Posts
5
Hi,

I would like to do a min/max check on ~50 Floating point values. I would prefer to use a pointer to avoid to call the min/max check block more than once (I assume that the only one set point is changed on the HMI during one scan cycle).
this is how it is done now (~50 times):
Code:
      L     "Set_point".Valve_DT3         //DB80
      L     "Cmp".Valve_DT3               //DB81
      ==R   
      JC    NDT3
      CALL  "Min Max Limit Check"         //FC21
       MN     :="Set_point_Min".Valve_DT3 //DB82
       IN     :="Set_point".Valve_DT3
       MX     :="Set_point_Max".Valve_DT3 //DB83
       RET_VAL:="Cmp".Valve_DT3
      L     "Cmp".Valve_DT3
      T     "Set_point".Valve_DT3
NDT3: NOP   0

any suggestions?

Thanks
 
Because of the memory overhead created by ~50 calls to FC21. It would be cleaner to have one call to FC21 at the end of the block with pointers to the the data blocks as arguments.
But it might not be possible since I use different data blocks in the call?
 
If you have run out memory and need to make the code smaller then pointers with a loop will do the job. Copy the relevant blocks to a library and post the archived library.

I would create some temp variables and use those in the call to FC21, the temp variables would be loaded from the DBs using pointers.
 
Last edited:
If you create a library and copy the blocks to the library, the resultant zipped file is small (23.9k) compared to a complete project (578k).

Here's your project blocks copied to a library.
 

Similar Topics

I've got a 4-20ma pressure transducer connected to an analog card on an AB PLC5. Under the setup for the card, I have to set a raw minimum and...
Replies
12
Views
7,421
Hope everyone is refreshed and ready to get back at it after new year! I'm struggling to find where or if i can set the min and max values of a...
Replies
1
Views
1,129
Hello, I am trying to modify a working program that uses parameter files for the different control items in the system. So for PID Loops there a...
Replies
12
Views
8,229
I have 16 cb_E connected to OP16 via fiedbus and the cb-E connected to l60 controllogix via en2t ethernet. using generic module in IO config so I...
Replies
2
Views
1,737
I'm really trying to test the limits of what SE can do with E-sig buttons for a customer. They want all the existing buttons converted to E-sig...
Replies
1
Views
1,780
Back
Top Bottom