Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

How to turn on this LED?

The picture of LED is attached. I was given a 6040E I downloaded the software run the self test and calibrated it. 

 

What I did and did not work.

1) I connect the +5 pin to the 5V power source, the ground to digital ground, and LED1 to digital output port 0 line 1

2) In the software I go to data neighbour hood -> create new task -> Ni-Daqmx Global Virtual Channel -> Generate signals -> digital output -> line output -> port 0 line 1 -> enter name -> run the code with the name checked in the software. Result: LED not on. Why?

 

0 Kudos
Message 1 of 7
(7,223 Views)

^Sorry, the above method works it was just the light was very dim. Anyways can anyone tell me how to turn on the LED for 5 seconds only? Right now whenver I run the code the LED will lid on, it will not lid off even when I stop running the stimulation. It will turn off it I check invert and run the stimulator again. 

0 Kudos
Message 2 of 7
(7,220 Views)

Hello Hunkeelin,

 

Please provide some more information:

How much do you know about the PCB you are wiring to, did you make it?

Is it possible to draw out a simple wire diagram/schematic of how you believe you have this LED wired (since you are just showing us wires going to a board, we have no idea about the wiring on/internal to the board)?

Also, what is the power rating of the LED?

Matthew R.
Field Applications & Systems Engineer
National Instruments

Certified-LabVIEW-Developer_rgb.jpg

Certified-TestStand-Developer_rgb.jpg


0 Kudos
Message 3 of 7
(7,203 Views)

it is in the attach image, Power source, ground and a digital switch that is connected to port 0 line 1

0 Kudos
Message 4 of 7
(7,196 Views)

Hello Hunkeelin,

 

After looking at you drawing, It appears as though are trying to just directly wire the LED to the PCI-6040E. If that is the case, from what I know about DIO and LEDs, I believe you are going about this wrong. 

 

Firstly, LEDs should never be directly wired into a circuit without some kind of current limiting resistance. As you should know, an LED is a Diode (that’s what the D stands for), which controls the direction of current flow. The intensity of the light being output is proportional to the current flowing through it. All LEDs have a current rating which denotes a limit for the amount of current that can pass through the LED. If you exceed this limit, you will damage LED.  In order to ensure the current flowing through the LED is within its limit, a resistor must be added into the circuit, between the LED and ground. The value of the resistor must be calculated, and in order to do that you will need the current rating of the LED.

 

Secondly, LEDs are have a cathode (-) and anode (+). The DIO line will provide a high (+ 3~5V) source to the circuit on its own, when turned on through programming, and should be directly connected to the anode. There should not be another +5V line connected to the LED (although 3 pin LEDs exsist, I do not think that's what you have based on the picture). The cathode of the LED should then be connected to ground via the properly chosen current limiting resistor. Since this LED appears to be surface mounted, you will need a multi-meter with a diode setting to determine the direction of the LEDs polarity and determine which lead is the anode, and which is the cathode.

Just be aware, depending on the LED’s current rating, your DIO card might not be able to drive the LED (aka provide enough current).

Matthew R.
Field Applications & Systems Engineer
National Instruments

Certified-LabVIEW-Developer_rgb.jpg

Certified-TestStand-Developer_rgb.jpg


0 Kudos
Message 5 of 7
(7,185 Views)

Oh I simplify it, but it has resistance in between to stop the hazard. Look at my first post, an image is attached of what it really looks like. So to the original question, how can I jsut simply turn on the LED for 5 secs? Either through labview/C? If so how? I am more interested in controlling the thing with C. 

0 Kudos
Message 6 of 7
(7,180 Views)

Hello Hunkeelin,

 

Well then, your simplification picture was a misrepresentation and not what I was asking for. You’re wiring aside, here is a simple example of DIO using CVI: http://zone.ni.com/devzone/cda/epd/p/id/4995#0requirements

 

I would suggest that you set up a timer to stop the task after 5 seconds. Here’s a link for learning how to use the timer: http://zone.ni.com/reference/en-XX/help/370051V-01/cvi/uiref/cviprogramming_with_timer_controls/

 

I hope this helps.

Matthew R.
Field Applications & Systems Engineer
National Instruments

Certified-LabVIEW-Developer_rgb.jpg

Certified-TestStand-Developer_rgb.jpg


0 Kudos
Message 7 of 7
(7,172 Views)