AngryScientist
Member
I have been bashing my head up against this one for a while, so take some pity on me if I wind up coming off as very confused.
I have 4 tags containing the thickness of 4 shadows across a sensor, counted from left to right. "Sensor1.RawShadowThickness[0]" to "Sensor1.RawShadowThickness[3]" as a DINT. The shadows correspond to the thickness of wire being produced. The lowest numbered wire machine is on the left and increases by one to the right, ie: 1,2,3,4.
I am trying to figure out how I can "map" the shadow data to the wire. When all 4 wire machines are running it is a simple one-to-one map, however, if one machine goes down, and the line runs without a wire present the information becomes corrupted.
Say wire machine 2 is down, now there are 3 shadows instead of 4. Shadow one still corresponds to wire 1, but now shadow 2 corresponds to wire 3, and shadow 3 to wire 4. Every possibility of machines not drawing wire across the sensor must be accounted for.
I have a bit/bool for each machine that is high/true when the machine is drawing wire and low/false for when it is not and there is no shadow expected.
The only truth statements I can figure out is "Shadow 1 wire machine number = Lowest machine number drawing wire"
It is at this point that I lose my mind because I can not think of a way to process all possible occurrences.
Then the next issue rears its head:
How do I copy/move the data into the correct tag waiting for the wire thickness?
I'm really lost on this one. Please help!
I have 4 tags containing the thickness of 4 shadows across a sensor, counted from left to right. "Sensor1.RawShadowThickness[0]" to "Sensor1.RawShadowThickness[3]" as a DINT. The shadows correspond to the thickness of wire being produced. The lowest numbered wire machine is on the left and increases by one to the right, ie: 1,2,3,4.
I am trying to figure out how I can "map" the shadow data to the wire. When all 4 wire machines are running it is a simple one-to-one map, however, if one machine goes down, and the line runs without a wire present the information becomes corrupted.
Say wire machine 2 is down, now there are 3 shadows instead of 4. Shadow one still corresponds to wire 1, but now shadow 2 corresponds to wire 3, and shadow 3 to wire 4. Every possibility of machines not drawing wire across the sensor must be accounted for.
I have a bit/bool for each machine that is high/true when the machine is drawing wire and low/false for when it is not and there is no shadow expected.
The only truth statements I can figure out is "Shadow 1 wire machine number = Lowest machine number drawing wire"
It is at this point that I lose my mind because I can not think of a way to process all possible occurrences.
Then the next issue rears its head:
How do I copy/move the data into the correct tag waiting for the wire thickness?
I'm really lost on this one. Please help!