Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with sending digital O in M series 6229 daq card

In our lab, we have a 6229 M series daq card. We want to send digital output ,
( three square waves and their direction values for driving 3 dc motors.
We will change pulses or frequencies during application). we tried to send the signals from single lines
(altogether we need 6 lines.)  but we failed. We could only send pulses from counter ports but
unfortunately there are only  2 counter ports. Can anybody help us about this problem?
If anybody could also send a labview 7.x program for this application we will be thankful.
0 Kudos
Message 1 of 2
(3,259 Views)
Hello Ozgur Can,

You should be able to use a digital IO line/port to send your square wave.  There are some shipping examples that provide the code required to generate a continuous digital output on an M Series board (i.e. 6229).  You can find these example in NI Example finder (Help >> Find Examples).  It seems as if you want to perform a continuous digital output.  In order to do this, you must use port 0 and provide a clock source for the digital timing.  The digital output example can be found in example finder under Hardware Input and Output >> NI-DAQmx >> Digital Generation >> Cont Write Dig Port-Ext Clk.  This VI allows you to specify the output of each channel in the pattern array.  This array will then be written to the digital output buffer and clocked out of the card at the rate of your external clock.  The data you specify in the pattern array control will continuously be generated.  It does not write that array once and stop.

If you want to use the DAQ card to generate the clock required by digital IO, you can use 1 counter to generate a pulse train.  If you open the example called Gen Dig Pulse Train - Continusous from example finder under Hardware Input and Output >> NI-DAQmx >> Generating Digital Pulses you can generate a square wave at your required frequency.  In Cont Write Dig Port-Ext Clk you then specify the sample clock source to be the internal output of the counter (i.e. /Dev1/Ctr0InternalOutput). 

If you want to use the gen dig pulse train example, it must be started before the digital output example.  The method used in these two example can be combined into your application. 

Finally, if you want to update the frequency of your output you can either update the pattern array in the digital IO example by using the DAQmx digital write while the task is running, or update the clock you are generating with the counter by using the DAQmx counter write

Regards,

Jesse O.
Applications Engineering
National Instruments

Jesse O. | National Instruments R&D
0 Kudos
Message 2 of 2
(3,237 Views)