Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't send DIO signals from DAQ toolbox to NI board

Hello,

I am trying to send digital outputs with Matlab DAQ toolbox to a NI PCI-6224 card (and through a NI SCB-68 connector block to a Plexon recording rig), but am having trouble getting the signals to the connector block.

I'm using Matlab R2007a, DAQ toolbox version 2.10, the NI-DAQmx 8.6.1 driver, and the correct adaptors ('nidaq', 'parallel', and 'winsound') are working. Furthermore, I know that the card and connector block are working because someone else is accessing it with LabVIEW for a totally different task.

I know the board ID is 'Dev1', and when I run the following code, I don't get any error messages. Again, however, I can't get it to write signals to the connector block (or measure them using NI Measurement and Automation Explorer).

>>dio = digitalio('nidaq','Dev1');
addline(dio,0:7,'out');
pval = [1 1 1 1 0 1 0 1];
putvalue(dio,pval)
gval = getvalue(dio);
delete(dio)
clear dio


I'm not sure where to go from here. Any suggestions would be very much appreciated.

Thanks.
0 Kudos
Message 1 of 5
(3,523 Views)
Hi,

I found this link that says that you need atleast version 2.8 of the toolbox for it to work with the PCI-6224.  I think that might be the problem.  Have you got any other functionality to work on this board using the current version that you have?  Could you please upgrade to that version and see if that helps.

Regards,
Raajit L
National Instruments
0 Kudos
Message 2 of 5
(3,500 Views)
Thanks.
However, I thought that might be the problem too, but I looked into the version issue and it is actually version 2.10, as in "two-ten", not 2.1, so it should work.


0 Kudos
Message 3 of 5
(3,494 Views)
Have any of the functions from the toolbox worked at all or is it only this particular task that is not working?  You also mentioned that the same board has been used with LabVIEW, was this on the same computer?  I am wondering if the toolbox is correctly associated with the DAQmx driver?

Take a look at this other forum post, where customers have successfully used the toolbox with M series devices.  Please make sure that the correct DLLs are loaded into the environment. 

Start by loading the NI dll:
funclist = loadlibrary('nicaiu.dll','nidaqmx.h','alias','myni')
(You can choose any alias as long as it is a legal variable name.)


Also, what is the version of Matlab that you are using?

Regards,
Raajit L
National Instruments
0 Kudos
Message 4 of 5
(3,473 Views)
It looks like you're doing everything correctly.  Does it work when you do it from MAX?

-Rob
-----
Rob Purser
Manager, Test and Measurement
MathWorks
rob.purser@mathworks.com
0 Kudos
Message 5 of 5
(3,470 Views)