LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to check and control the PWM in usb 6008

may i know how to check and control of the PWM of the usb 6008 in labview? the tread that some1 posted regrading about PWM but it is design under labview program, what i need is the PWM come out from my usb 6008 may i know how to check n control it? i need the PWM to control my speed of fan,when input voltage is higher it will turn the fan fast or vice versa
0 Kudos
Message 1 of 29
(8,132 Views)
If you have read some thread about PWM and the USB 6008, you should post a link to that thread so someone knows what you are talking about. Have you seen the post at http://forums.ni.com/ni/board/message?board.id=70&message.id=5527&view=by_date_ascending&page=1 where there is some example code and it also talks about how unsuited the USB 6008 is for PWM?
0 Kudos
Message 2 of 29
(8,109 Views)

Hi Jex,

I'm not sure I understand what you are looking for.  You said that the problem with the other thread was that it was "designed under LabVIEW."  Are you trying to program in a different language? 

The thread that Dennis pointed you to should get you started with the programming.

As far as checking the output, you can always route the signal externally to another input and measure the signal.  I'd recommend measuring it with a counter task.

Luke
Applications Engineer
National Instruments
0 Kudos
Message 3 of 29
(8,094 Views)
what i mean is it is possible to use the DAQ assistant and use the digital outpu of the usb 6008 to show the pulse wave at the oscilloscope ?setting the delay in the labview will change the pulse of the usb 6008? i already look through the thread and if i just set the delay time on the labview program is it possible to see the changes on the PWM on the scope
0 Kudos
Message 4 of 29
(8,091 Views)

Hi Jex,

Yes, changing the time delay should change the pulse width of the signal.  It sounds like that should work for you.  Let us know how it goes.

Luke
Applications Engineer
National Instruments
0 Kudos
Message 5 of 29
(8,086 Views)
i nvr try yet, this is just my idea to work my project, somore i dunno how to set the delay time on labview program yet, is it just use the time delay function icon and fee into the DAQ assistant then it will work?
0 Kudos
Message 6 of 29
(8,083 Views)
I'm sorry jex, I was incorrect in my previous post.  Pulse width modulation requires a constant period, so you won't want to change the time delay.  You will change the pulse width by simply changing the duty cycle.
For your application, you can have an input DAQ Assistant reading your analog input and use a custom scale to convert the voltage to a desired duty cycle.  Then replace the duty cycle control in the example program with the scaled output.  You could probably leave the rest of the code the way that it is, as shown in the image below.
 

Message Edited by Luke G on 06-20-2007 12:37 PM

Luke
Applications Engineer
National Instruments
0 Kudos
Message 7 of 29
(8,072 Views)
can help me explain what is yor code doing about, my project is going to present and i need to explain cause i dunno what is I32 icon & the time output use for, how u store the data inside the array ? can help me to explain what is array act in labview, cause i study i cant understand what is the array use for in LabView i think it is quite different from what i learn in C++ n java i mean the concept is same but i cant imagine how the array will store inside 1 by 1, and below is my attachment, i feel that my code wll be easier, my connection got problem? My project consultor require me to add an array inside + DAQ, i dunno how to add an array and once i replace my DAQ into the wave chart it seems cannot coonect y it happen?
0 Kudos
Message 8 of 29
(8,001 Views)
Hi Jex,
I'm not sure what you are trying to do with the example code that you attached.  Your code isn't interfacing with any hardware, and the period of your output signal is not constant. 
 
The DAQ Assistants in my code were to read the signal from your fan and write to the controller.
 
I configured the first DAQ Assistant to acquire an analog signal.  The DAQ Assistant would be configured with a custom scale to convert the measured voltage to the corresponding pulse width.
 
The two For Loops and the Build Array function build an array of high and low values that are written to the second DAQ Assistant that outputs a digital waveform. 
 
Arrays in LabVIEW are essentially the same as any other programming language.  They are allocated space in memory and they store a series of values.
 
After reviewing your original project description, I see that you want to read a PWM signal and output a PWM signal.  I wrote that example for reading an analog signal and outputting a PWM signal.  To be honest, I do not think that the 6008 is a suitable device for this project.  The digital lines of this device must be software timed (which is very slow compared to hardware timed) and it has only one counter input (which is not enough for a pulse-width measurement) and no counter output.  For this type of application, I would recommend considering a device that has two counter inputs and two output counters.
 
Please let us know if we can offer an more help.  Good luck with your project.
Luke
Applications Engineer
National Instruments
0 Kudos
Message 9 of 29
(7,964 Views)
nope i mean my input is analog signal and output will be digital signal, i think 1 counter should be ok, my project is temperture control system whereby my thermocouple amplifier voltage been input using analog pin, when temperature is very high then it will turn the fan fast, i doesn't require a very accurate rpm, jz when i demo can see the fan turn faster or slower like that, my program is i set a time and in my slide contain 10 section, which means 1 sec will run 10 section, so when i slide into number 2, means that 0.2 sec will on and 0.8 sec will off the led after that i put the wavechart, when turn on send data 1 and off send data 0 , then it will become a PWM signal, so when i connect my DAQ, i wish to replace my waveform chart into daq assistant, so that i can output to the scope, but i wonder y cannot ? i know my program is not a very accurate when counting duty cycle, but as long as can see the differentiate fast and slow then is ok already

Message Edited by jex on 06-30-2007 08:45 AM

0 Kudos
Message 10 of 29
(7,950 Views)