Discussion:
illumination controller
(too old to reply)
darkownsu
2008-08-07 03:40:06 UTC
Permalink
Hi, my name is Jon. I need to submit a Light Illumination Controller
project within these few days but i just started with LabVIEW so i need
immediate help asap. I am using a NI USB-6008 digital I/O. I need to
create a prog to send pulse wave signal into illumination controller
PCB board so light up the LEDs. The pulse wave signal will travel
through a microprocessor and then it will automatically generate PWM to
activate the LEDs. My guessing is the PWM will affect each LEDs
lighting power since the LEDs are incident, dim_up, dim_down and
transmitted. Basically i need 4 output buttons, 1 output power and 6
input LEDs for my prog. I also need a counter that can count up to 1
million to check how many times will switching the power on and off
triggle the settings pf the lights back to default.

Please help me A.S.A.P

Thanks.
J_Thomas
2008-08-08 15:10:14 UTC
Permalink
Hi darkownsu,


Welcome to the NI discussion forums. I will do my best to
provide you with some example programs and ideas for your program, but I just
wanted to set the expectation that you are unlikely to find one example program
that does everything that you want it to do.


There are basically two ways that you can program your
USB-6008 using the NI-DAQmx driver.  The
first way is to use the DAQ assistant (from the block diagram, right-click and
go to Measurement I/O >> NI-DAQmx >> DAQ assist). The DAQ assistant
offers a configuration based dialog box that you can use to setup a simple
counter operation, or a digital read, or a digital pulse.  The DAQ assistant is quick to setup, but
doesn?t offer as many operations and doesn?t support many of the advanced
functionality you can do with the lower level VIs.


The second way is to use the NI-DAQmx lower level VI?s.  There are found on the same palette on the
block diagram as the DAQ assistant, but I would start by looking in the NI
Example Finder. Open LabVIEW and then go to Help >> Find Examples.  In the lower right hand corner of the NI
Example Finder select the drop down menu under Hardware and select Add
device.  Find the entry for the USB-6008
and use the arrow to add it to the right hand side of the window.  Click OK. 
Back on the NI Example Finder use the drop down menu under Hardware to
now select the USB-6008.  Put a check
mark next to limit results to hardware. 
On the right hand side you can now browse to examples suited for your
hardware.  Go to Hardware Input and
Output >> DAQmx and look through the Counter Measurements, Digital
Generation, and Digital Measurements folders for examples about how to do
various kinds of measurements.


For example, the Count Digital Events.vi in the Counter
Measurements >> Count Digital Events folder shows an example program to
count digital edges on a counter.


I would also recommend searching NI.com and the discussion
forums for examples.  For example here is
a <a href="http://forums.ni.com/ni/board/message?board.id=70&amp;message.id=5527&amp;view=by_date_ascending&amp;page=1" target="_blank">discussion forum</a> that talks about using PWM with the USB-6008.




&nbsp;


The best way to learn LabVIEW and programming hardware is to
go through examples like these:


For LabVIEW:


<a href="http://zone.ni.com/devzone/cda/tut/p/id/5243" target="_blank">Developer
Zone Tutorial: LabVIEW Introduction Course - Three Hours</a>
<a href="http://zone.ni.com/devzone/cda/tut/p/id/5241" target="_blank">Developer Zone Tutorial:
LabVIEW Introduction Course - Six Hours</a>
<a href="http://digital.ni.com/express.nsf/bycode/exzsvg" target="_blank">Top 10 Requested
White Papers and Tutorials for NI LabVIEW</a>


&nbsp;


For programming hardware:


<a href="http://zone.ni.com/devzone/cda/tut/p/id/2835" target="_blank">Developer
Zone Tutorial: Learn 10 Functions in NI-DAQmx and Handle 80 Percent of Your
Data Acquisition Applications</a>
<a href="http://zone.ni.com/devzone/cda/tut/p/id/3116" target="_blank">Developer Zone Tutorial:
Complete Data Acquisition Tutorial</a>
<a href="http://zone.ni.com/devzone/cda/tut/p/id/4656" target="_blank">Developer Zone Tutorial:
Using the DAQ Assistant to Automatically Generate LabVIEW Code</a>
<a href="http://digital.ni.com/public.nsf/allkb/BB06D0620FDD7ADB86256D2700557BFC" target="_blank">KnowledgeBase
2XE9HRIP: Physical Channels, Virtual Channels, and Tasks in NI-DAQmx</a>


&nbsp;


I will also just mention that the USB-6008 has limited
functionality compared to some of NI?s more advanced DAQ boards. The USB-6008
is an excellent low cost device well suited for many applications, but it is
possible that you may run into a hardware limitation depending on your program
requirements.




&nbsp;Hope this helps.
darkownsu
2008-08-14 08:40:22 UTC
Permalink
Thanks for the help. I have read through each of the link, but somehow I don't quite understand the pulse part. What i need to do is use DAQmx USB-6008 to send in single pulse meaning 0, 1, 0 into my PCB board( I am using Port 0). I will also need a power button to On and Off the pulse signal and 6 LEDs. What will happen is that whenever I switch on the power button, all the LEDs will light. Then when i press the button again, the only 3 LEDs will light, the others will turn off. When i press again one more time, only 2 LEDs will light. This is a sequence that my PCB board's LEDs will respond to the signal. So basically I need a VI to write in single pulse and also a VI to be able to read the signal so that the LEDs can respond accordingly. Please help me with this asap.

Jon.
Newbie in LabVIEW
Dennis Knutson
2008-08-14 14:40:10 UTC
Permalink
To create a pulse, you need three separate DAQmx Writes (or three separate DAQ Assistants) wired sequentially. Something like the code below. Place it inside a case structure with your front panel Boolean wire to the case selector and put all of that inside a while loop. You use a DAQmx Read or a DAQ Assistant to do the read and wire the data from that to an indicator.&nbsp;


Simple Pulse.vi:
http://forums.ni.com/ni/attachments/ni/70/9373/1/Simple Pulse.vi
darkownsu
2008-08-15 00:10:29 UTC
Permalink
Thanks Dennis. But can you send me again the VI in labVIEW 7.1 version?
Dennis Knutson
2008-08-15 13:40:20 UTC
Permalink
Sorry, I can't save to such an old version. Image is bleow.&nbsp;If you want to execute something more than once, it has to be inside a loop. Check the <a href="http://www.ni.com/academic/lv_training/how_learn_lv.htm" target="_blank">LabVIW basics training</a>


Basic Pulse.PNG:
http://forums.ni.com/ni/attachments/ni/70/9385/1/Basic Pulse.PNG

darkownsu
2008-08-15 00:40:19 UTC
Permalink
hmm..&nbsp;
&quot;You use a DAQmx Read or a DAQ Assistant to do the read and wire the data from that to an indicator&quot;Where do i place that DAQmx Read? inside or outside the while loop? &nbsp;Message Edited by darkownsu on 08-14-2008 07:28 PM
Loading...