Dariusincj
Member
Studio 5000 Ladder logic, i have a dint. We will call it Station. I want to see if there is a cleaner way of saying if bit .1 is true, then a dint array we will call SQOArray, SQOArray[1] = 1. If bit .2 is true the SQOArray[2] = 2. But then if bit .3 is true SQOArray[3] = 4, bit .4 is true SQOArray[4] = 8.... if you see what i'm trying to do is use my dint array in an SQO so i can sequence valves for each bit that is true. But if bit 2 is not true, then i leave it a 0. It's mostly used for a pump system. Not sure if this makes any sense. I have instructions now that if bit .1 is true then move a 1 into SQOArray[1], and so on and so forth. So that my SQOArray[0] thru [30] is equal to 0, 1, 2, 4, 8, 16...
Tell me if i'm crazy in trying to do this or if i just need to write out all the move statements.
Tell me if i'm crazy in trying to do this or if i just need to write out all the move statements.