07-27-2018 09:15 AM
Hello community,
I've got an issue with the front panel in this VI not displaying what the code is should be telling it what to do.
These indicators are supposed to remain green while their value is under the "threshold" when they rise above it they turn red. The code reads the numeric indicators on the front panel and controls the bg color based on their value, but for some reason 8 of the indicators are being rebellious.
4 should be red but they are green, 4 should be green but they are red.
The 4 channels that should be red because they have a value over the threshold are not plugged in to the module, I plugged them in and everything reads correctly on the front panel.
My question is why when a channel is unplugged does it change the color of the wrong indicators?
How do I fix it so when I channel is not plugged in or failed it doesn't mess up the front panel?
As always, thank you for expanding my brain!
(VI attached)
07-27-2018 09:34 AM - edited 07-27-2018 09:35 AM
Because your array of control references Is not in the same order as the data you are acquiring.
When a TC is disconnected it reads the maxed out value. You can add logic to check it is above a reasonable range and if so gray-out the indicator instead of turning it red.
Ben
07-27-2018 10:55 AM
so that would help keep the references in the same order as the data array?
Would it be worth it to adjust the array size and index out unplugged channels?
07-27-2018 01:54 PM
Ah ok, I've learned some stuff after reading the help section. There are some front panel indicators that are not labeled "TC" 206-216 and 313-316 I plan to index out those channels and have a different set of perimeters for their BG color control.
This is where the the order is getting messed up. I need to pull those channels out of the arrays and then put them back in at a different point to be data logged.
How can I pull these elements out off the arrays without deleting them?
07-27-2018 02:01 PM
Or you can cheat.
If you right-click the indicators and chose "Visible Item >> Caption" and then hide the labels the GUI can keep the current "look" but then change the names of all of the TC related indicators to start with "TC"...
Then you can keep your code like it is/was.
But make sure the channel order matches the indicator ref. order.
A good way to double check your work is to use the "label" property in your update loop to update a temp indicator and watch your code in execution highlighting. If it right delete the temp indicator. If it is wrong fix things... lather rinse-repeat.
Ben
07-27-2018 02:44 PM
@Ben wrote:
Or you can cheat.
If you right-click the indicators and chose "Visible Item >> Caption" and then hide the labels the GUI can keep the current "look" but then change the names of all of the TC related indicators to start with "TC"...
Then you can keep your code like it is/was.
But then if I label those channels with TC and hide it they will still be controlled by the BG color code that controls the rest of the channels and I don't want that.
I need to set different "threshold" conditions for those specific channels that control their own independent BG color code.
07-27-2018 02:49 PM
Unless there is a way to override the label method of changing the BG colors.
I still have to index those "floating" channels to set controls for "thresholds" for each 11 of them
07-27-2018 03:27 PM
Ben,
Been watching your youtube channel instead of working lol. Awesome channel! some really cool and useful stuff