LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make property nodes operate independently of even trigger

Hi,

 

I am trying to make a channel select system that allows me to either stimulate with the original signal on a specific channel, or invert it.  To do this I set up two different banks of channel switches.  The first group is meant to stimulate the original signal, whereas the second bank is meant to invert the signal.  I don't want the same channel selected in both banks, so I made a system that will gray out and disable the complementary channel in the other bank.

 

For example, if Channel 1 in Bank 1 is selected, then Channel 1 in Bank 2 will be grayed out and disabled.  This works perfectly fine until I add my event case.  I convert the selected channels into an array and convert that into an integer.  It has to be this way for the system I am creating and other software I am working with.  I want to be able to have the channels grey out in real time before I trigger the event, which will send my newly created integer to another software platform.

 

Unfortunately, this doesn't happen as I would like it to happen.  When I select a channel, its complementary channel in the other bank does not gray out.  Instead, the complementary channel only greys out after I trigger the event.  I put both the channel select and property methods outside of the event structure, so I am not sure why this does this.

 

If anyone has any idea about why this is happening I would greatly appreciate some advice.  I have attached the VIs necessary to run my test program.  Thanks!

Download All
0 Kudos
Message 1 of 19
(2,732 Views)

Hi tbergen,

 

first and probably biggest problem: you named those controls exactly the same! There are two controls named "Channel 1" and two other controls named "Channel 2". That's a no-go!

 

You need to use distinctive names for all of your controls. Then hide those labels on the frontpanel and show the captions of those controls. Captions can be the same…

 

Next problem: THINK DATAFLOW!

There is no loop around your code, so setting the property node will happen immediatly after starting the VI. Then this VI just waits for a "Trigger" value change event…

 

3rd (but small) problem:

- RubeGoldberg: Do you know those basic rules for boolean math? An OR(NOT(X); NOT(Y)) is the same as NAND(X; Y)…

- RubeGoldberg: Why have those deactivation constants each four times on your BD? Why not use just one constant and use wires instead?

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 19
(2,713 Views)

Hi GerdW,

 

Thanks for the advice.  Adding a while loop allowed me to have the complementary controls grey out like I wanted, but it caused another problem.  At first I placed everything outside of the event structure inside of a while loop.  When I did that the controls would grey out properly, but the trigger would subsequently not work until I used the stop control on the while loop.  

 

Placing a while loop around everything (controls and event structure) left me with the same problem I had initially encountered when I made the thread where the controls wouldn't grey out until after the event was triggered.  I'm trying to make it so the controls can be updated multiple times and the event can be triggered after each time I update them.  The while loop stop condition is stopping me from being able to do this.  Is there a better method to go about this?

 

Also, thanks for the advice on cleaning up the circuit.  I wasn't even thinking about simplifying that stuff at the time I made it.

0 Kudos
Message 3 of 19
(2,698 Views)

Hello tbergen1,

 

Could you upload your updated .vi please?

 

Regards

 

Ernesto
Application Engineer
National Instruments

0 Kudos
Message 4 of 19
(2,650 Views)

Hi Ernesto,

 

I attached my updated VI.  To summarize the problem again, the while loop allows me to gray out and disable the appropriate controls, but I cannot execute the event without manually terminating the while loop.  The goal is to be able to have the controls grey out and disable in real time while being able to execute the event multiple times so I can keep updating the channels if I want.  Any advice you have would be great.  I'm all ears!

 

Thanks,

 

tbergen1

Download All
0 Kudos
Message 5 of 19
(2,644 Views)

The event structure should be inside your While Loop.  Of course the event won't execute until the stop button is pressed.  The Event structure is dependent on the while loop finishing.

 

You have a second problem.  You are set to lock the front panel until the event completes.  So if you trigger the event, the front panel locks.  If you haven't already hit the stop button, you have no way of  hitting it now because the front panel is locked.

0 Kudos
Message 6 of 19
(2,628 Views)

I achieved minor success by making my trigger control the stop button of my while loop, so when I use the trigger the while loop is stopped and the event executes.  I am able to grey out the channel controls in real time with this method, but I'm only ever able to execute the event once.  After the first time I am able to update the channels again, but the event only ever outputs the same value despite the controls telling it to change.

0 Kudos
Message 7 of 19
(2,624 Views)

I'll repeat  "The event structure should be INSIDE your while loop."

0 Kudos
Message 8 of 19
(2,617 Views)

I actually just solved my problem.  It wasn't that my event was only executing once, it was that my event code was giving the same value for different inputs.  I can now execute the event multiple times after altering the channel configuration and get the appropriate results.  If there is a more efficient way to do this I would love to hear it.  I'm not very skilled at labview at the moment, but I am trying to learn.  Thanks for all the help, everyone!

0 Kudos
Message 9 of 19
(2,616 Views)

We can't suggest improvements until you show us the latest code.

0 Kudos
Message 10 of 19
(2,609 Views)