02-09-2013 08:13 PM
I have written a VI with 24 buttons, one for each output of the USB-6501, to turn on and off 24 relays. Now I want to add more buttons that turn on and off mutliple outputs. Let's call these buttons Presets and with a press of the Preset button some outputs turn on and some turn off. Get it? The VI I have included a screenshot of is used to test a transmission controller and rather than manually selecting relays one at a time I want a Preset button that sets up the relays instantly for the next step of the test.
The VI I have written uses tasks created in NI MAX.
I am a Labview beginner so please try to keep your solutions easy to understand....if possible.
Thanks,
Kevin
BTW I am enrolled in Core 1 and 2 next month in Richardson, TX.
Solved! Go to Solution.
02-09-2013 08:35 PM
Hey,
You're basically talking about using property nodes to change the value of the controls. This is demonstrated in the attached VI and is discussed more thoroughly here:
Control References: Overview
http://www.ni.com/white-paper/3159/en#toc4
--Ryan S.
02-09-2013 08:47 PM
This vi is 2012 and won't open in 2010......
02-10-2013 11:35 AM
OK, I downloaded 2012 and opened your vi...it does exactly what I want it to do.....but how do I make it talk to my USB-6501?
02-10-2013 03:02 PM
I hope that image of your block diagram is not your real VI. It is just silly to use individual buttons wired to so many DAQmx Writes. You should only have a single DAQmx Write and it should be inside an event structure so that it only executes when a value changes. You can use an array of Booleans on the front panel or build an array on the block diagram.
Once you have made those changes, then you can add another event for the preset button and write to a local variable instead of a property node.
02-10-2013 03:28 PM
Thanks for the tip Dennis but I have no idea how to do what you suggest. Could you possibly show me an example, please? Keep in mind I am very new to Labview.
02-10-2013 03:35 PM
Help>Find Examples. That should be the first place you look. Check under Hardware Input and Output>DAQmx>Digital Output. In 2011, there is an example called Write Dig Chan that does exactly what I mentioned for the DAQmx Write. The event structure is demonstrated in numerous places.
02-12-2013 03:08 PM
Here's an example -- you'll learn about clusters, arrays, events, etc. in the class but this will give you a head start. Code is attached but I took a screenshot to give people an idea of how simple the diagram becomes:
As your learn about them I'd also suggest making the cluster a TypeDef and doing some error handling but I omitted them from the example to keep things as simple as I could.
Good luck learning LabVIEW, it's worth it!
~Simon
02-12-2013 03:33 PM
This looks PERFECT!! I'll try it tomorrow and see how it goes. Thanks!
02-14-2013 06:45 AM
This is perfect!!!!!!!!!!!!! Thanks a ton SimonH! I figured out how to change the presets and tweak the settings so it will talk to my USB-6501. I plan on adding a USB-6009 analog I/O to the setup next.
Kevin