07-31-2009 04:36 AM
Hi:
I want to read the data which is provided by the USB interrupt pipe.A general method is using the api function such as readfile(), but I donot know how to selcet the parameter type correctly in labview to represent the parameter declarasion in the API fucntion .
Then , I read the app note named "USB instrument control tutorial ". I followed the app note step by step and became misunderstanding at last.
The .inf which is generated by the visa driver develop wizard always assigned the USB driver to the
NiViUSBY.sys . No matter what transfer type it is . In my opinion, the bulk transfer and interrupt transfer will not use the same driver (So as the insochronous transfer which is not supported by the visa driver develop wizard ) .
When I assigned my USB device to the .inf which is ni-visa generated, it do not send any data to the PC.
But when I assigned it to a .inf which is provided by the USB-IC supplier, (pointed to the .sys which is also porvided by the USB-IC supplier) It send the data frequently (the actual time interval is same as the endpoint descriptor defined)
whether the driver ni-visa generated can support the interrupt transfer , if so , whether both interrupt transfer and bulk transfer share the same driver.
waiting for your help.
aaa1982
07-31-2009 08:58 AM
Is there some advise??
wating for your help
thanks
aaa1982
08-03-2009 01:41 AM
You can use Call Library Function Node to call other API functions, and doube click this node will provide you with an interface where you could configure all parameters. For more information, please refer to LabVIEW help.
VISA does support interrupt transfer mode, please refer to following link for more information, Can VISA Read be used to read USB Interrupt Data?:
http://digital.ni.com/public.nsf/allkb/D38E5A65DA54C9A2862571E900810FEA?OpenDocument
http://digital.ni.com/public.nsf/allkb/457E3ADD7D2C1E7486257323007BAC0D?OpenDocument
08-03-2009 03:17 AM
A USB Device does not send data unrequested.
You need to initialise the interrupt transfer in order for it to work. The USB hardware controller (part of your PC) then polls the port until data is ready. So when you say the device "Sends data" this is only as a response to a request previously made of the device. Maybe you are missing this step in your code?
The vendor driver may be initialising the interrupt transfers for you.
Regards
Shane
08-03-2009 07:47 AM
Hi Intaris:
" A USB Device does not send data unrequested"
Yes, the device can not initializing a transfer. But in my opinion, as a interrupt transfer, the drivier(interrupt transfer) would initialize the IN or OUT transfer frequently (The period is defined in the endpoint
descriptor).There is no extra host code requirement. (To initilize a IN or OUT transaction ). All the work host code have to do is reading the data sended by the USB device.
So I was confused about the interrupt transfer driver that NI VISA wizard generated. Is this a "real" interrupt transfer driver?
aaa1982
08-03-2009 07:58 AM - edited 08-03-2009 07:58 AM
The data stored for the Interrupt Endpoint relates to the MAXIMUM report frequency of the endpoint. This has no effect on the ACTUAL report rate. It's simply stating the CAPABILITY of the endpoint.
If an Endpoint is configured to deliver interrupts every millisecond (1000 per second) and I only request data every second, it will only report every second. There will be no bus communication during the 999 milliseconds where no information is requested.
I have written a Nugget HERE on a very similar subject.
I suggest reading it and downloading the USB Specification from HERE. The USB3.0 Specigfication is now available, but nothing has really changed in this regard over USB 2.0.
HERE is a post on the USB DEvelopers forum repeating exactly what I have said here.
Shane