LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW and Cypress FX2

Has anyone had any experience programming EZ-USB FX2 devices in LabVIEW?
I have a specific question. The communication with the device driver is accomplished through the calls of CreateFile to create a handle and DeviceIoControl using the handle frome CreateFile. The functions are obviously called through the call library function node and the functions from the kernel32.dll.
However, I have problem specifying the control codes for the function. In text based languages this is accomplished using macros without ever seeing the numerical values. In LaVIEW, I have to supply the numerical value of the control code since macros cannot be used in LabVIEW. All I have is a define from the general purpose device driver source code but this does not he
lp me much since I need the actual numerical hex value to feed to the library function node. This is an example of the IOCTL define:

#define IOCTL_Ezusb_GET_PIPE_INFO

CTL_CODE(FILE_DEVICE_UNKNOWN,\ Ezusb_IOCTL_INDEX+0,\ METHOD_BUFFERED,\
FILE_ANY_ACCESS)

What would be the hex equivalent of IOCTL_Ezusb_GET_PIPE_INFO for example.
0 Kudos
Message 1 of 2
(3,704 Views)
hi

there has to be a header file (*.h) delivered with your driver. in that header file the values for the defines are defined, e.g. #define Ezusb_IOCTL_INDEX 0x0800. search for Ezusb_IOCTL_INDEX etc. on the www or contact the vendor of the driver for a download of the header file(s). some defines may be defined in microsoft specific header files, e.g. FILE_ANY_ACCESS. look for all included header files in the example programs delivered by the vendor. search for that defines on the web or at www.msdn.com. another solution is to write a dll which exports the values of the defines as a structure with named elements. then you don't need to know the values of the defines at all.

best regards
chris
Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
Message 2 of 2
(3,704 Views)