10-12-2018 03:38 PM
Hello,
I'm fairly new to LabVIEW but was able to put together and automated system using cRIO and scan (if I can do it, anyone can). Now, I'm trying to make a fail-safe mechanism with float switches. I was tinkering around on a new VI to figure it out but I'm running into an issue. I get the first three float switch indicators to turn off the pump but the last array doesn't work. I've swapped the indicators around to ensure it was faulty wiring but I still run into the same problem.
Best,
Josh
Solved! Go to Solution.
10-12-2018 03:41 PM
I cannot see your VI (running LV 2016), but if you are auto-indexing through a for loop, then it will only run as many times as the smallest of all array sizes or count terminal inputs. This is just a guess, if you upload a back-saved VI or picture of the diagram I can take a look.
10-12-2018 05:30 PM
Why not just Or the array and see if you the result is true. If it is, turn ff the pump.
10-15-2018 08:46 AM
Thanks for the input. I'll show you what I'm trying to set up as a safety mechanism. I have a multiple pump setup (6 pumps) that all run on a timer with 30 second intervals. I'll show both VIs. I was doing a trial safety VI to get an understanding of how it works before I put it into my VI that will actually run. Is there a reason why the number four array doesn't input? I'm guessing I would have to put all the pumps in one big case structure that feeds from the array of float switches, correct?
10-15-2018 08:46 AM
Thanks for the input. I'll show you what I'm trying to set up as a safety mechanism. I have a multiple pump setup (6 pumps) that all run on a timer with 30 second intervals. I'll show both VIs. I was doing a trial safety VI to get an understanding of how it works before I put it into my VI that will actually run. Is there a reason why the number four array doesn't input? I'm guessing I would have to put all the pumps in one big case structure that feeds from the array of float switches, correct?
10-15-2018 10:28 AM
When you convert an array of Booleans to a number, the resulting value is a bitwise representation of the individual elements. So, if you have a 4 element Boolean array the first element in the array is the least significant bit of the number. The last element of the array is the most significant bit of the number. So, here are some examples of the values you will get.
A[T, F, F, F] = 1d = 0x1 = 0001b
A[F, F, F, T] = 8d = 0x8 = 1000b
A[F, F, T, F] = 4d = 0x4 = 0100b
In your case statement you have no option 8. which would correspond to your 4th Boolean control in your array. Your case statement would also need to account for cases when more than one Boolean is set. A single case can handle multiple values by using a comma delimited list. For example, a case that would trigger whenever the first Boolean is true would be "1", "3", "5", "7".