ControlLogix Looping Anyone offer any advice on this code??

Join Date
Jul 2007
Location
Kiruna
Posts
600
Hi Guys,

I have attached my attempt at a problem I cant seem to get my head around.

Basically I need to loop through an array of objects and determine which one has the least amount of turn offs and set a flag accordingly.

The peudsocode as I see it is as follows:

1. Get first value and store it as minimum value.
2. Get second number and compare it with minimum value
3. If second number is smaller make it the samllest number and proceed like this.

The only way I can see it working is if i initilise the loop to start at 1. This works fine and the flags are set but the code never process the first object, i.e EM_Starter[0]. Eventually this one will contain the least amount.

The next problem I have is if all the turnoffs are the same value then nothing will happen. This will happen eventually.What i need to happen is to set a Min_Flag of the first one if this occurs.

Would really appreciate if someone could take my attached code and give me some pointers. Am I even going about this in the right way even?

Thanks
 
Had a look at that one before I posted. Its not really the same for my application. Its not a contigous array as in Array[100] but rather an array of UDTs where its a member of the UDT I'm interested in.

I suppose what I am asking is how do I combat things like..On initial startup up. All EM_Starter[x].Turnoff are going to be =0. I want to set the min flag for the first one only.
 

Similar Topics

Why does the controllogix redundancy modules use a single mode fiber vs multimode fiber?
Replies
1
Views
84
Hello, I have two 16 point input cards and 1 16 point output card showing module faulted on my IO tree in Logix Designer. The fault code is...
Replies
7
Views
215
Hello, My associate and I are trying to sync up two ControlLogix racks (7-slot chassis) with identical modules. We are able to see the secondary...
Replies
4
Views
195
Trying to setup a message read via Ethernet. I have the path setup as 1, 1, 2, 192.168.66.10 I get an error code 1, ext err 315. I am beating...
Replies
9
Views
232
I have a redundant ControlLogix being set up. This program reads a value from a remote site which happens to be SLC PLC. Rockwell mentions SLC...
Replies
2
Views
96
Back
Top Bottom