Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

nidaqmxbase linux: dio examples build, but do not run

I've downloaded and installed nidaqmxbase-1.5.0-f2.iso. I'm trying to read digital ports on a USB-6501 device. The device is detected by lsdaq and daqmxbase_listdevices. I've built the dio examples by executing 'make' (with no errors), but when I run them they fail at the call to DAQmxBaseCreateTask with error -200170 which, according to README.txt, means "Physical channel specified does not exist on this device". I've also tried running mxbaseconfig. It apparently also fails to detect the device - at least nothing is listed in the appropriate field on the user interface.

I'm using Mandrake 10.1, kernel 2.6.8.1-25mdk.
0 Kudos
Message 1 of 6
(3,274 Views)
Hi GPollack,

What is the device number you are getting from lsdaq?  What it sounds like is happening is that you are getting a different device number than is coded in the program.  Since the device you are trying to look at in the program does not appear to exist it is throwing the error that you are seeing.

Make sure that everything matches up and you should eliminate your error.

Regards,
0 Kudos
Message 2 of 6
(3,249 Views)
Sorry, my description of the problem was incorrect. The error is generated by the call to DAQmxBaseCreateDIChan, not the call to DAQmxBaseCreateTask. lsdaq reports the following:
--------------------------------
Detecting National Instruments DAQ Devices
Found the following DAQ Devices:
NI USB-6501: "Dev1" (USB0::0x3923::0x718A::01187C83::RAW)
--------------------------------

I've tried modifying the value of 'chan' from the value in the example's code ("Dev1/port0") to "Dev1/port1", "Dev1/port2", "Dev1/port0/line1", etc., but the same error, -200170, is always generated.
0 Kudos
Message 3 of 6
(3,236 Views)
Which example are you trying to use?  You should only get that error if you are trying to address a physical channel that does not exist.  Does the example ever work for you?  Have you tried using a different computer to see if you can get the same problem on the other machine?

0 Kudos
Message 4 of 6
(3,219 Views)
I've been working mainly with ReadDigPort, but I get the same error with the other example programs. The documentation states that lsdaq should be run first before running the programs, and I've done this. I assume that running lsdaq is supposed to store some configuration information somewhere - is that correct? As I can tell, no file is generated, or altered, when lsdaq is run.

I don't have another system on which to test things.
0 Kudos
Message 5 of 6
(3,218 Views)
Does the example work with the default values?  Or does the problem only manifest itself when attempting to change a setting in the example program?
0 Kudos
Message 6 of 6
(3,192 Views)