Looking for a Logic Explanation logix5000

Big Brunsy

Lifetime Supporting Member
Join Date
Apr 2014
Location
Iowa
Posts
23
I'm needing to change the numbers the operators enter in to change the contents and specific gravity of a tank. I can't quite follow the logic that's in there now moving the contents. I was wondering if someone might want to try to explain how it's working. I can't compress the file small enough to attach so I put it on my Google Drive and turned on link sharing.

Under main task/main program/item_lookup
I can't figure out where it's taking item numbers and description from and how it's moving it into the tag for the tank.

LINK TO PROGRAM

Thank you VERY much!
 
If you look at the controller tag ITEMS you'll see it's an array of the UDT ITEMS. This looks to be the storage location of the products that can go into the tank, each item has a .ITEM which is the numeric identifer, a .DESC which is a string descriptor and finally the specific gravity value .SG.

The routine is passed a numeric value, which is the index of the storage location to find the .DESC and .SG values. The logic is a basic loop, evaluating each element in the ITEM array until it finds a match.

If you need to change values, just update the array element in the ITEMS tag.

ITEMS[23].SG currently has a value of 1.0368547. You could change the value to 1.04 for example.

They are using indirect addressing to loop through the ITEM array rather then doing a brute force method. Basically a programming loop approach rather than a case approach.
 
Last edited:
Look at Main Task/Main Program/Item Lookup rung 14. Based on TANK_ORDER's value, it will call up ITEM_LOOKUP and pass in the variable RT_1 into TANK_ITEM. When it returns from ITEM_LOOKUP, it passes TANK_ITEM back into RT_1. It looks like the program can do this 49 times based on the value of TANK_ORDER.
 

Similar Topics

I'm lookin for help with a simple 3 axis or even 2 axis servo logic(control logix) for making 4, 3" holes one at each corner and then a 2" x 2"...
Replies
4
Views
3,193
Hi , Where i can find Mitsubishi PLC Card end of line & replacement model details. i am looking for Q02CPU replacement model. Please advice. thanks
Replies
2
Views
126
I have Allen Bradley plcs, I have had Circuit breakers and other automation equipment in the past. There's no solid buyers local. How much do you...
Replies
2
Views
193
can anyone has a good program to learn plc programming online. i have the basic looking into improve my skills thanks
Replies
1
Views
137
I want to monitor a couple signals in a place where there is no PLC but there is ethernet. I know I can use an AENTR or Flex I/O and a module but...
Replies
21
Views
740
Back
Top Bottom