PCI-6221 pwm on separate 24 channel outputs

We have a PCI-6221 board and want to produce 24 separate 100 hz pwm signals. All 24 signal will be at the same frequency but they will all have different duty cycles. What is the best way to develop these separate 24 pwm signals?

hei,
i am not familiar with the word "pwm". explain.
i guess you want to use the DIO signals, at 100Hz? this card has about 1MHz frequency. therefore depending on the accuracy of your waveforms, you can go to lower time base.
Once this is set, you can use DAQmx for addressing either all channels together, or one at a time. i would opt for the "1-channels n-samples", where your 1 channel is actually the whole combination of the 24 ports out.
in order to do that you will have to compute in advance (or at same time as you output to buffer), the whole 24bits for each cycle. that is one reason you might want to lower your timebase - lots of computation.
all you have to do now, is create a subvi wich will create 24 rows lists of values. the list will be following your timebase, say 1MHz.
then, assemble all columns into 3 words (3*8bytes), or one 32bit long. that will depend how you enter the data to DAQmx.
at the end you expect to have a single 1D array with all info for all 24 channels at a specific time. you enter that into buffer and start task.
for futur implementations, say if you want to do that for 100s of seconds, you will have to regenerate those function while it is running. we will get there as you finish the first step.
Is it helpfull?
Gabriel
... And here's where I keep assorted lengths of wires...

Similar Messages

  • How do i create 6 digital 25Hz PWM output signals with my PCI-6221 card?

    Hi!
    I´m a student, who´s trynig to control a gasturbine process for my diploma thesis. The control program should be written in LabView 8. I need to control 6 25 Hz PWM signals for the gasvalves. The  needed accuracy of the duty cycle has to be about  0.1 %.
     A  tech. engeneer from  NI  told  us , that  we can  do this by using one single digital output for each PWM.
    Now, after a while, i need to implement it into my program. But there are troubles:
    My NI-PCI-6221 standard card only has 2 couteroutputs and only the first of the 3 ports seems to be buffered (Error Nr.  201062)...
    I tried to do the programming, by manipulating the "DIO_PWM_50Hz.vi" I found in google.
    Does anyone of you have any information or helpful examples how i can create these PWM with my card, or did I get a wrong Information by the salesagent (...not the first time....)?
    Thanks for your help
    Tobi

    Here you can find an example, how to do this:
    http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=DE27921DB53A4D8DE034080020E74861&p_...
    As the text says, best would be to use the counter. As your Hardware has only 2 Counters, you would need additional hardware. Best would be to use a Counter-Card (660x), thes boards have up to 8 counters, so you coulkd control your 6 gasvalves indipendently.
    The soultion with the timed digital outputs of the m-series boards would only work, if you can use the same timing (one counter) for all 6 outputs.
    Hope this helps!

  • Trouble specifying TTL for digital outputs from PCI-6221

    Hi!
    I'm trying to generate TTL output signals using a PCI-6221 daq board - within Labview, I'm using DaqMx to create two digital waveforms and then write these. When I plug in an oscilloscope, the shapes/frequencies of the signals are correct, but the lower value is 0V, and the higher value is 1V, rather than the TTL values. Is there a way to specify these voltage levels to TTL within the software? I see from NI help that "do.logicfamily" exists to specify TLL, but when I add a property node and connect it to the channels, I do not see Logic Family as an option under "digital output." Let me know if you have any ideas!
    Thank you,
    Emily

    Set your oscilloscope to use 1MOhm impedence.  Your problem is that the maximum current for those DIO is 24mA.  1V/50 Ohms = 20mA.  So you are current limiting the digital outputs.  If you need more current, then you need to add in some digital buffer chips that can output more current.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • PCI 6221 Generating a Voltage Output

    Hello everyone,
    I am trying to use a PCI-6221 to provide an analog output voltage of 5V and use the AI to read the returned signal using labview. Does anyone know how I can do this using this hardware device?
    Thank you

    Hi lrving9,
    First you will need the DAQmx driver, here is the link for you to install the latest version.
    NI-DAQmx 15.0.1
    http://www.ni.com/download/ni-daqmx-15.0.1/5353/en/
    If you already have it, then go ahead and take a look at this examples:
    This one shows you how to output an analog DC voltage.
    Community: Output a Constant Analog Voltage
    https://decibel.ni.com/content/docs/DOC-18631
    Then do you have a connector block to connect the signals?
    If you do, then you can just create a task to read a Continuos Voltage Input, like in this example
    Community: Voltage - Continuous Input
    https://decibel.ni.com/content/docs/DOC-25105
    If you do not have a connector block and have no way to connect the AO to an AI, then you can read the internal AO channel, like shown in this link (there is an example at the bottom):
    Is It Possible to Read the Value of Analog or Digital Output Channels?
    http://digital.ni.com/public.nsf/allkb/CB86B3B174763C3E86256FFD007A2511
    Also when you install the driver some examples are installed as well, this shows you how to get to them:
    Where Are NI-DAQmx Examples Installed?
    http://digital.ni.com/public.nsf/allkb/E3BAF6FC4017960B8625755A00525D37
    Regards,
    Carolina 
     

  • Im using a pci-6221 daq-card.I want to know the difference(use)of a line output and a port output.

    Im using a pci-6221 daq-card.I want to know the difference(use)of a line output and a port output.

    Hello Hellraiser24,
    This question has actually been discussed in another thread here:
    http://forums.ni.com/ni/board/message?board.id=170&message.id=95895&requireLogin=False
    I hope this helps,
    E.Lee
    Eric
    DE For Life!

  • Best structure to measure voltage across 8 resistors in parallel via 8 separate analog channels

    Im setting up a simple circuit w/ 8 resistors in parallel. It will be connected to a PCI 6036E DAQ. I need to measure the voltage across each resistor, take x amount of samples, and then automatically move on to the next resistor and so on and also save the values to a file.  Im going to connect each resistor to a separate analog channel.  I have already setup a vi to read the voltage across one resistor and take X amount of samples, display the waveform, and also save the data to a file.  
    What would the best structure be to run this test?  I am thinking a Sequence structure, but it seems like people tend to avoid using that. Or would a case/while loop be better?
    From my understanding, the data will not pass out of a sequence structure until it is finished. this doesnt seem to be that big of a problem for me, as I only want the data at the end....
    thanks for the help!

    Use a for loop.  Put your code inside the loop, but delete the analog channel number.  Make an array constant and poplulate the array with each analog channel number.  If you wire the array to the loop (left side), you will see the terminal is a hollow box.  This means indexing.  The loop will operate on the first array element, then repeat with the second array element, and so on until all array elements have been processed.  Wire the hollow box to the point in your code where the analog channel number was deleted.  Now the loop will execute the same code using a different channel each time.  If you wire the output to the right edge of the for loop, you will again see the hollow box.  All of your measurements will be contained in an array at that hollow box.  Process the outputs as you like, maybe display the entire array, or index the array to get the individual elements, whatever.  The advantage of the for loop is that you have to write your code only once.  Everything is seen on one screen making it easier to read.  Sequence structures are not good programming practice because a lot of the code is hidden, and you have to go to different sequence frames to see the hidden code.  Also, why duplicate the code in each frame when the loop will do it all.  Good luck.
    - tbob
    Inventor of the WORM Global

  • Synchronization in PCI-6221

    Hi. I use the device PCI-6221: 1 analog output and 5 analog inputs.  I set the waveform graph for the input signals. I generated the sine signal. The input waveform on the graph changed continually its phase. What have I to do  to leave the phase unchangable while changing the amplitude or the frequancy of the output signal?
    Thank You.

    Hi Dimon87,
    Many times on a traditional scope, a waveform is displayed so that the zero crossing is triggered to be at x0. Is this what you are attempting to do? With 5 channels on a multifuction DAQ board, there is an interchannel delay (as you've discovered in other forum threads) between the channels so if you're looking for channel phase relationships, you'll be limited to this delay. It sounds like you're looping your analog output back into your 5 analog outputs so this would definitely have a phase delay between the 5 channels due to the interchannel delay. Your previous thread "Measuring the subtract of two phases" talks about this.
    PBear
    NI RF

  • Need help with counters on PCI 6221 (37 pin)

    Hi all,
    I have a system with a PCIe 1429 connected to a Basler A504 camera and a I use a clock generator (SRS CG635) set at 3.9 kHz to trig the image acquisition.
    On the same system I need to add a PCI 6221 37
    pin to acquire :
    - 2 AI at 39 kHz, synchronized with the image acquisition. (10 AI sample for each image)
    - 1 counter to measure a frequency
    Since the accuracy of my 3.9 kHz clock is much higher than what I have on the DAQ board, I figured a nice option would be to have a retriggerable DAQmx task that generates 10 pulses at 39 kHz for each pulse received from the clock and then use this to trigger the DAQmx AI task.
    Of course this can only work if the "trigger" sources that I define for these two tasks don't take the two counters I have on the board.
    So let's describe the DAQmx tasks :
    - here's the one that generate the 39 kHz on counter 0, from the 3.9 kHz that I input as a trig source on PFI 4
     - here is the analog input task for which I set the trigger on PFI 6.
    Question is : can I "softwarely" tell the board to route the output counter (Ctr0) to PFI 6? And if yes, how?
    Thanks in advance for any help!
    When my feet touch the ground each morning the devil thinks "bloody hell... He's up again!"
    Solved!
    Go to Solution.

    Sorry, no can do on the counters.  The M-series boards would use up both counters for the task of generating a finite pulse train so there'd be no counters left for freq measurement.  From what I've read, the newer X-series boards only use 1 counter for finite pulse trains (and also have 4 total available.) 
       FWIW and for future reference, software routing of signals *will* work though there are some restrictions on which signals can be routed to where.  The M-series boards are generally very flexible though, and you can double check the routing options in MAX.  Also, in general, there's no particular problem running 2 tasks of the type you proposed simultaneously.  Note though that the term "trigger" has a more specific meaning in LabVIEW-land than it may have in normal life.  Here you were using the counter output as an "external sample clock" which is distinct from using it as a trigger.  Triggers initiate tasks, then sample clocks cause samples to be taken during them.
    Anyway, here's a possible workaround which doesn't require you to generate any counter pulses, so you can perform your freq measurement and still have a spare counter left over.
    1. Configure your AI task to use the external 3.9 kHz signal directly as its sample clock.
    2. Also configure your AI task so that the channel list contains at least 10 duplicates of each of your 2 AI channels, along the lines of "ai0,ai0,ai0,...ai1,ai1,ai1,..."   Or you could alternate them back and forth if you want.  You'll have to trade off the importance of the time difference between the two AI channels vs. the risk of the crosstalk-like effect from mux'ing back and forth on each sample.  Myself, I'd probably make a channel list with 12 dupes of ai0 followed by 12 dupes of of ai1 and later ignore the first 2 conversions on each channel just to be more sure the ADC has settled after muxing between them.
    3. Finally configure your AI task to use a specific timing for its "convert" or "channel" clock.  Since the timebase for your AI board is independent of the more accurate external 3.9 kHz clock, you should err on the side of caution.  For example, supposing you were going to take exactly 20 scans within each sample interval, I'd pick a convert clock rate that's a bit higher than the apparent minimum of 20x3.9kHz=78 kHz.  Probably something in the 80-100 kHz realm.
    -Kevin P

  • How to get counter values from pci 6221 card?

    Hii
     I am using PCI 6221 card .. In that i am using the ctr o .. In my application i am using Linear encoder to measure the Lift movement.. so from software how to access the counter values i.e how much mm it moves... 

    Measure Angular Position.vi in the LabVIEW examples will be a good starting point. Adapt it to Linear Encoder by clicking on the selector below DAQmx Create Channel.vi.
    You can also create a corresponding DAQmx Global Channel (or task) in MAX and then use it in your code.
    Feel free to post back if you need further help.
    Message Edité par JB le 10-31-2008 02:15 PM

  • How to entirely develop an application with PCI-6221 in Borland C++ Builder V6 in DAQmx?

    Hi,
         I am sorry that I have asked a huge question.
         But the main questions I want to know is :
         1,In Borland C++ Builder 6,Which version of DAQmx is the best one we will use?  DAQmx V8 don't support BCB6.
         2,Would you please give an example source file to use *.Lib in BCB6?
         3,In other computer,not including developping environment ,which items of DAQmx we have to install,PCI Card Driver?
    Which dll?How to make the installation the smallest?
         Thanks for your possible answer.

    Why DAQmx8 doesn't support C++ Builder 6 ?
    I've just used LabVIEW with DAQmx8 create dll file for C++ builder 6. My application is to use PCI-6221 generate Analog output. ( just DAQ assistance ).It works well.  

  • How can I configure NI PCI 6221 and DAQ SCB-68 for pressure sensors?

    Hello
    everybody,
    I am using the measuring board (NI PCI 6221) and DAQ
    SCB-68 for the data acquisition.
    With the DAQ-Assistant I created AI for the voltage of
    pressure sensors. In a big indicator panel from this DAQ-Assistant I see the
    voltage for both sensors in the correct size. But if I set sensors in the
    blockdiagramm to control the signals for sensor one I get a wrong voltage size
    and for sensor 2 nothing.
    How can I configure this data acquisition equipment to
    get the correct signals?
    Thanks a lot for your help.

    I do not know the type of sensor you are using. But pressure transducers may have a very low output voltage(in the mVolt range). They also need an excitation voltage. Here is an introduction. http://focus.ti.com.cn/cn/lit/an/sloa034/sloa034.pdfThen working with pressure sensors I always use 3 stages in the circuit.
    1 Instrumentation Amplifier as a preamp
    2 filterstage
    3 Final amp and output buffer
    (you may combine stage 2 and 3)
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)

  • Play a QuickTime file with eight separate audio channels

    I'm trying to play a QuickTime file with eight separate audio channels but they only play in stereo......  the same QT file will play all 8 channels separately in Qlab, which has separate level controls for each channel, and which "sees" my Digidesign 002 audio interface.  But QT does not recognize the interface, nor does Audio MIDI Setup utility, apparently.....  it will play all 8 channels mixed to stereo through channels 1 and 2

    The following will answer both your questions a) and b).
    Click on your master timeline and press cmd+0 (zero) to bring up Sequence Settings, then click on the Audio Outputs tab on the right. Click on the Outputs option and change it to 6. You can leave them as Stereo pairs.
    Now, back on your timeline, you need to make sure all your audio is organised so each track. A1, A2, A3, A4 etc has all the relevant media on it.
    Then, on the left of the timeline you see the Destination toggle buttons, then you see the Padlocks to lock tracks, then you have the Toggle Auto Select squares. If you right-click on the Toggle Auto Select squares you bring up a little sub-menu, at the top of this list you'll see Audio Outputs, which will show the stereo channels for that particular track. As you've changed the number of Audio Outputs in the Sequence Settings, the list will show: 1&2, 3&4, 5&6. You just tick whichever channels you want.
    In your case, you have dialogue on the first 4 tracks, no problem, just go down through tracks 1,2,3 and 4 as described above and assign these to Audio Outputs 1&2.
    Then just go down through your music and effects audio tracks and assign them accordingly.
    Now, when you export your timeline as a self-contained media file, it will have different audio channels.
    I hope that makes sense. When you change the number of audio outputs as described in the first step, I believe the rest of it is fairly self explanatory, once you know where the settings are.

  • How to make a ramp for a stepper on PCI-6221

    Hello!
    I'm looking for a solution/example in ANSI-C to make a ramp for a stepper that is connect at PCI-6221 CTR-port.
    The function I'm actually using is:
    DAQmxErrChk (DAQmxCreateCOPulseChanFreq (taskHandle, "Dev2/ctr1", "", DAQmx_Val_Hz, DAQmx_Val_Low, 0.0, 1000.0, 0.5));
    DAQmxErrChk (DAQmxCfgImplicitTiming (taskHandle, DAQmx_Val_FiniteSamps ,1800));
    So this works fine when the stepper have to run constantly. But for my application I need the use of a ramp. To change the frequency value I have to write in a running Task, but that is (IMHO) not possible? Please correct me, if I'm wrong.
    I don't not know how to change the value unless to stop the task and start it with new value. But this method is not a solution, cause i always stop the motor and start it with a higher frequency from zero. So what I'm actually do is to look after the correct NI-function for my problem.
    If someone has an idea/example/solution, please post it. I'm thankful for all kinds of feedback.
    Best regards,
    Oliver

    Unfortunately, ramping a stepper is not straightforward using the counter hardware.  Under finite generation, the freq cannot be changed on the fly.  And under continuous generation, where freq *can* be changed on the fly, it must be done under software-timed control.  Also,  under continuous generation, it will be pretty tricky to both change the freq on the fly *and* control the exact total # of steps.
    If you need a well-controlled ramp and a well-controlled # of steps, I'd suggest you start figuring out a scheme to use the hardware-timed digital output port (see also "correlated dio").  The big downside is that you'll need to generate a large buffer of digital states to define your pulse train because you'll probably need to output at something approaching a MHz.  Out of those million samples per second, probably only about 0.1% of them represent transitions.
    When these kinds of apps come up, I always put in a good word for one of NI's Alliance partners - Viewpoint Systems, who sells a digital board that works much more sensibly for these situations.  With the DIO-64, you create buffers containing only the timestamps of the transitions and the digital state at those transition times.  So to generate 1000 steps in a second, you'll buffer 2000 states rather than 1,000,000.  You'd also get ~20x better quantization error for your available step rates.
    I've been requesting a buffered counter output capability from NI since before Y2K, so I'm no longer holding my breath...
    -Kevin P.

  • Displaying and saving multichannel waveforms using PCI-6221 DAQmx card

    I am trying to obtain voltage readings at 8000 kHz from 9 channels using a PCI-6221 DAQmx card. The waveforms are to be displayed on individual charts while being saved. I have run into problems when I have 4 channels reading in at the same time. The charts stop displaying the data. Since the program will be running within another program where video acquisition is being done, space/buffer size is a very large consideration. If anyone can offer any suggestions about being able to display and save this data without losing seconds of information, the help would be appreciated.
    Thanks,
    Nina

    Hello Nins,
    The first thing to notice is that you are going far beyond the specifications of the 6221 if in fact you are sampling at 8000 kHz. Something I can tell you is that when you are performing fast acquisitions and processing the data at the same time, it is sometimes advised to have an acquisition loop (procucer loop) and a processing loop (consumer loop) and transfer data between the two. That way, you can put a wait in the consumer loop and use a waveform graph to plot the data rather than using a Chart wich requires memory.
    Hope this helps some...

  • PCI-6221 high CPU usage

    I'm currently using a PCI-6221 DAQmx card to continuously acquire readings from 9 channels at 5000 samples per channel per second. Using a timed while loop, I reduced the CPU usage to ~50%. When I add the additional control code for two other devices (that use ~4% of the CPU each), the CPU usage goes up to 100%. I tried to increase the DMA on the PCI card, but it doesn't appear that I can alter it on this card. I'm setting the "DAQmx Read" control to "Analog 1D Waveform N Channels N Samples." Also, when I remove the waveform indicators on the front screen, it doesn't lower the CPU much. If anyone can offer suggestions for lowering the CPU usage without sacrificing the above mentioned data collection parameters, I would appreciate the help greatly!
    Nina

    Alan,
    The CPU usage for the 9 EMG signals is ~50%.  The second input is video acquisition using an IMAQ 1411 card acquiring 30 samples per second with real time display.  The third input is a serial connection which samples at 1Hz.  Each of these codes uses approximately 4% CPU when running separately.  Each has the option of saving the data while still continually displaying on the front panel. The video acquisition utilizes the grab image setup along with notifiers for saving the data.   To link  the saving of the files (using case structures) to a single control button on the front panel , I created local boolean variables. The EMG readings use a timed while loop.  The serial connection uses a timed while loop cycling at the same frequency.  The video acquisition uses a while loop contained within a for loop.
    Thanks for your continued help!
    Nina
    Message Edited by nins on 07-06-2005 02:47 PM

Maybe you are looking for