Differences

This shows you the differences between two versions of the page.

Link to this comparison view

mgl:functionreferencedigio [2014/05/28 19:49]
mgl:functionreferencedigio [2014/05/29 00:14]
Line 20: Line 20:
   -Download [[http://​www.ni.com/​download/​ni-daqmx-base-3.7/​4272/​en/​|NI-DAQmx Base]]. You should use the latest version, as of this writing 3.7.0. You may need to make a free account with NI.   -Download [[http://​www.ni.com/​download/​ni-daqmx-base-3.7/​4272/​en/​|NI-DAQmx Base]]. You should use the latest version, as of this writing 3.7.0. You may need to make a free account with NI.
   -Make sure that the device (e.g. NI USB-6501 or NI USB-6211) has up-to-date firmware, by running FWUpdate (included in Ni-DAQmx Base/bin)   -Make sure that the device (e.g. NI USB-6501 or NI USB-6211) has up-to-date firmware, by running FWUpdate (included in Ni-DAQmx Base/bin)
-  -Restart matlab if you have already run readDigPort (the program has to reinit the driver)+  -Restart matlab if you have already run readDigPort (the program has to reinit the driver). Also, note that it is best to run matlab without the desktop (matlab -nodesktop) so that you can see all the console messages described below.
   -Documentation is installed and should be available from the following location<​code>​   -Documentation is installed and should be available from the following location<​code>​
 file:///​Applications/​National%20Instruments/​NI-DAQmx%20Base/​documentation/​docsource/​daqmxbasecfuncindex.htm file:///​Applications/​National%20Instruments/​NI-DAQmx%20Base/​documentation/​docsource/​daqmxbasecfuncindex.htm
 </​code>​ </​code>​
   -Follow the instructions [[:​mgl:​functionreferencedigio|above]] to compile mglDigIO and related functions.   -Follow the instructions [[:​mgl:​functionreferencedigio|above]] to compile mglDigIO and related functions.
-  -You should connect your input and output digital lines to the proper port and lines on your NI card that you want. Note that by default mglDigIO is set up to write to port 2 and read from port 1 of your NI card (but you can configure this when you run the mglDigiO('​init'​) command. You should reference your manual for the pinouts on the board you use. For the NI-6501 see [[http://​zone.ni.com/​reference/​en-XX/​help/​370466V-01/​device_pinouts/​6501pinout/​|here]]. We usually connect one digital input to: Pin 1 (black, digital ground) Pin 16 (red, port 2 input bit 0) and one digital output to: Pin 32 (black, digital ground) and Pin 27 (red, port 1 output bit 0).+  -You should connect your input and output digital lines to the proper port and lines on your NI card that you want. Note that by default mglDigIO is set up to read from port 2 and write to port 1 of your NI card (but you can configure this when you run the mglDigiO('​init'​) command. You should reference your manual for the pinouts on the board you use. For the NI-6501 see [[http://​zone.ni.com/​reference/​en-XX/​help/​370466V-01/​device_pinouts/​6501pinout/​|here]]. We usually connect one digital input to: Pin 1 (black, digital ground) Pin 16 (red, port 2 input bit 0) and one digital output to: Pin 32 (black, digital ground) and Pin 27 (red, port 1 output bit 0).
   -Run mglDigIO('​init'​) and you should see the following:<​code>​   -Run mglDigIO('​init'​) and you should see the following:<​code>​
 >> mglDigIO('​init'​) >> mglDigIO('​init'​)