05-29-2009 11:46 AM
This is hopefully a simple problem, but I can't figure out what to search under. I have a program with two loops (Z Only Test and Full Test in Tester Program v2). They do not run at the same time. I would like both loops to interact with an LED on the front panel (Testing). How is this done?
Under Z Only Test, it works fine. I tried to connect it to the sequence (Full Test), but it tells me I can't do that. On odd sequences, for the most part, I would like to have the LED light (TRUE). On evens, off.
05-29-2009 12:06 PM
Use a another shared variable? You already have one set up for that.
Use a local variable of the indicator since it seems you want to interact with that boolean LED from within the same VI.?
05-29-2009 12:12 PM
Do you mean make the LED a shared variable? How do you do that? I clicked on it and changed it to a variable, but I thought that was like one of the others that I have. I'll give it a try and see what happens.
I would assume whatever works for this would also work for numerical displays as well.
05-29-2009 12:36 PM - edited 05-29-2009 12:38 PM
rbergs wrote:Do you mean make the LED a shared variable? How do you do that? I clicked on it and changed it to a variable, but I thought that was like one of the others that I have. I'll give it a try and see what happens.
I would assume whatever works for this would also work for numerical displays as well.
No. I'm not even sure exactly what you mean by clicked on the LED "and changed it to a variable."
Right now you have only a single place where you use that LED. It has a terminal node on your block diagram within a while loop. I don't know how that fits into your overall program architecture as your VI is quite expansive. (Two tips, 1. Don't use stacked sequences. 2. Look into a state machine architecture)
All that happens at that point is your read from a shared variable called "Testing". I'm not sure from where else in your VI that you want to interact with that front panel indicator. Or whether it will conflict with the already written piece of code. I also don't know where this shared variable is written to. But the first idea is have the other sections of the code write to the shared variable and let this one update the front panel indicator.
The second idea is to create a local variable of the front panel indicator. Right click on the terminal within your code and select Create / Local Variable. But again, you will have to be careful with conflicts with the different portions of your code writing to the LED. This is also known as a "race condition".
(Yes you can use either shared variables to store numeric data, or create local variables of numeric controls or indicators.)
I'm a bit nervous about your code. It looks like you have a decent amount of LV experience as you have created quite a sophisticated VI there. However, it doesn't seem like it is easy to expand or modify. It takes up quite a bit of screen real estate. It doesn't use any subVI's even though a lot of the code seems to be duplicated or very similar. And it seems like it uses a lot of shared variables, probably more than necessary.
05-29-2009 01:15 PM