04-09-2013 09:04 AM
Does anyone have experience working with a DAQ usb-6255 or the like using Python?
I am trying to talk to it using Python but don't seem able to get my command string established; My code...
from pyvisa.vpp43 import visa_library
visa_library.load_library("c://Windows//system32//visa32.dll")
import visa
print visa.get_instruments_list() #1
MyInstrument = visa.instrument("USB0::0x3923::0x732D::017EB4E2::INSTR") #2
MyCommand = "*IDN?"
print MyInstrument.ask("*IDN?")
At #1 I get a list of instruments but none of them are the DAQ box. MAX shows it as Dev1 I get
At #2 I get ... "VisaIOError: VI_ERROR_RSRC_NFOUND: Insufficient location information or the requested device or resource is not present in the system."
Any ideas as I'm stumped?
04-10-2013 10:42 AM
Hi Paddy,
Could you post the list of instruments you are returned in #1?
Thanks,
04-10-2013 11:39 AM
Hi Paddy,
Actually, I don't think this is easily possible. The USB DAQ device is not a high-level VISA device, so will not show using the command you specified, and NI does not publish the low-level VISA commands that DAQmx uses to communicate. The post in the forum below outlines the issues you will face and shows some workarounds.
The only way to interface to the device will be to use the DAQmx driver (or DAQmx Base on linux). A good way to use this through Python is by utlising ctypes and numpy as outlined below:
http://www.scipy.org/Cookbook/Data_Acquisition_with_NIDAQmx
I hope this helps,