11-25-2011 10:49 AM
Hi all, I'm using a 6221 PCI card with LabVIEW 2010 (no add-ons) with the CB-68LPR connector block and I want to use an analogue voltage input signal of between 0 V and 5 V from an LDR to alter the brightness of an LED so I can maintain a stable level of illumination for a webcam based image capture and processing system.
I can get the analogue voltage input from the LDR (set up as a voltage divider circuit) using the DAQ assistant via the Ain 0 channel on using pins 68(AI.0), 67(AI GND) and 14(+5 V) and write it to a graph and numeric display but I don't know how to write the value out to a pin that can be used for PWM I am thinking of using pin 40 PFI 13 P2.5 and a digital GND (pin 13).
I've looked at example code that has been written to produce a PWM signal but these programs don't output the signal to a device/circuit they are just "nothing stuff" that output the PWM signal to a graph.
Can anyone help me out or point me to the tutorials/code examples that are for real world applications?
Solved! Go to Solution.
11-29-2011 03:18 AM
Hello,
PWM can be done in DAQmx using a counter output task.
I think the 'PWM-Counter Output.vi' example goes quite a long way to doing want you want I think. This is found in the LabVIEW shipping examples.
I also found it here:
http://zone.ni.com/devzone/cda/epd/p/id/1710
This might be worth a read aswell:
http://zone.ni.com/devzone/cda/tut/p/id/2991
Let me know if this is of any help.