Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I use DAQmx digital write to write to the DO pins of ELVIS

I have been tring to run a stepper motor by successive writes to DO 0, 1, 2, 3.  I can do this using the ELVIS DO writer vi, but the shortest time between writes is about 60mS which gives be about 10 RPM on my stepper.  I want a faster rotation rate and I was hoping that if I used the DAQmx digital write that I could speed this up.  I found a sample vi which is suppose to bypass ELVIS and an enable a DO write to the DO pins on ELVIS.  But I have as yet been unable to get it to work.  Can anyone help?
 
ELVIS has only 8 DO pins whereas my USB 6251 has three 8 bit ports.  Is port 0 of the 6251 attached to the ELVIS DIO pins?
 
 
0 Kudos
Message 1 of 4
(8,118 Views)
Hello,

There is a way to speed up the DIO communication.  You are correct that you will need to not use the ELVIS VIs.  These are meant for static DIO.  I have modified an example program available on our website to perform correlated digital input (attached it below).  This could easily be modified for correlated digital output.  I simply added the code required to use a counter to control the digital rate.

The example I modified comes from here.  This KB also tells you that port 0 is used to communicate with the ELVIS.  In order to use the DAQmx Vis you need to bypass the ELVIS communication using the VI and the switch on the front of the ELVIS.

I have also attached a digital pwm example. It demonstrates how to perform correlated digital output and how to update the digital values.

I hope this helps,

Jesse O.
Applications Engineering
National Instruments


Jesse O. | National Instruments R&D
Download All
0 Kudos
Message 2 of 4
(8,099 Views)

Jesse O.
Applications Engineering
National Instruments

Would you be able to post these two programs in LabVIEW 8.0?

Also I discovered that when you do bypass Elvis in the way suggested DAQmx port 0 maps to the ELVIS DI pins not the DO pins, for both digital reads and writes, this surprised me.  In addition when I was writing to port 0 DO, pins 2 and 3 on ELVIS DI mapped to pins 3 and 2 of the DAQ DO.

Peter

0 Kudos
Message 3 of 4
(8,090 Views)
Hello Peter,

First I have modified the the bypass example below.  It now does digital output.  When you run this example it will generate on the DI lines.  Digital lines on all M Series devices are bidirectional.  However ELVIS does not give you direct access to these lines when you are operating in 'Normal' mode.  When you switch to 'Bypass' mode, the 8 digital lines have a connection to the 8 DI lines.  You can find more information on this inside the NI ELVIS user manual found in your start menu (Start >> Programs >> National Instruments >> NI-ELVIS >> NI ELVIS User Manual) in appendix f.

I have resaved the VIs for LabVIEW 8.0, so you should be able to open them now. 

I hope this clarifies things,

Jesse O.
Applications Engineering
National Instruments
Jesse O. | National Instruments R&D
Download All
0 Kudos
Message 4 of 4
(8,074 Views)