Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Pattern generation with PCI6220

Hall sensor feedback for a brushless DC motor generates a 3-phase digital pattern with 1s and 0s spaced at 120° intervals of motor rotation.  The frequency of each phase is directly related to motor speed.
 
Has anyone used a 622x to generate a pattern like this?
      ___       ___
___|     |___|     |__  Phase A   DIO0
    ___       ___
__|     |___|      |___  Phase B   DIO1
  ___       ___
_|     |___|     |___     Phase C   DIO2
 
 
I would like the pattern to be able to change frequency "on the fly," so the clock source should be independent of the task.  If it's not possible with a 622x series card, is it possible with a different type of card?
0 Kudos
Message 1 of 4
(3,616 Views)

Hi,

 

Thank you for posting to the NI forums.  For this application, you will need to use correlated digital I/O.  This allows the digital output task to be clocked by a counter of which you can change the frequency during runtime.  There is a Developer’s Zone example program that shows how to setup correlated digital I/O.

 

Performing Correlated Digital IO with an M Series Device in LabVIEW

 

This example is designed to work with M Series devices like the 622x series.  Although the example program may not have the exact functionality that you’re looking for, it will show you the basics of setting up correlated digital I/O. 

 

I hope this helps.  Post back if you have further questions.

 

Ed W.

Applications Engineer

National Instruments

0 Kudos
Message 2 of 4
(3,596 Views)
From experience, yes you definitely can generate such patterns using correlated DIO on an M-series board using one of the on-board counters to generate the clock signal.  The counter clock would be a separate task that allows you to change the rate on-the-fly.
 
If you configure DAQmx Timing for continuous sampling, you only need to define a short buffer containing the 6 unique digital states and the board will be able to handle continuous regeneration of those states cyclically with no CPU drain.
 
If you need to change direction on the fly, it'll get a bit more complicated and will require some interaction from your application software.
 
The example Ed linked to should be a good start for proof-of-concept.  It appears the example generates the timing clock from the AI subsystem which you'll eventually want to switch over to a counter or even the AO subsystem.   The reason is that AI sampling rate can't be changed on the fly whereas counter output frequency can and AO output rate can.
 
-Kevin P.
 
ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
Message 3 of 4
(3,587 Views)

Thanks for the help.  I tried some of the code examples in LV7 but couldn't make them work as expected.  I haven't  tried m_series_correlated_dio yet.   The project I want this for is "on hold" for awhile, so at the moment I'm not desperate to make this work.

If the project revives I will revisit this.  We have a relatively simple custom circuit board available to perform this function with two DIO output lines and not much programming.  We may decide it's more cost effective to use that, although it would be nice to have a more versatile solution.

0 Kudos
Message 4 of 4
(3,561 Views)