NI Home > Community > NI Discussion Forums

LabVIEW

Showing results for 
Search instead for 
Do you mean 
Reply
Member
viveksriram.yg
Posts: 5
0 Kudos

Interfacing psoc3 device with labview through usb communication

Hello,

 

We are trying to interface PSOC 3 (latest product by Cypress) device with LabVIEW through USB comunication to enable direct configuration of PSOC 3 chip from LabVIEW GUI. But we are facing some problems in installing VISA driver for psoc3. Following is the detailed description-

 

We are programming PSOC 3 (cy8c3866axi-040) chip as a USB HID device. After programming the chip, we use VISA DRIVER DEVELOPMENT WIZARD to create driver for PSOC 3.   In this wizard after entering VID and PID of chip we create '.inf' file. We paste this file in window/inf folder and install it (creates '.pnf' file). Now we connect our PSOC 3 using USB cable to PC. In device manager, we update our USB Human Interface Device driver. We proceed step by step in following manner in Hardware Update Wizard-      'no, not this time'   next    'install from a list or specific location (advanced)'     next     'don't search. i will choose the driver to instal'     next     we select our device in list.

But then it shows Device Cannot be Started error. Also in 'Measurement and Automation Explorer' the newly installed device doesn't appear.

 

so can anybody please tell us if we are missing some steps or our PSOC 3 device should have specific characteristics to create using NI-VISA. This is very urgent for us so try to reply as soon as possible.

 

 

Knight of NI
Dennis_Knutson
Posts: 34,112

Re: Interfacing psoc3 device with labview through usb communication

If you have programmed it for HID, why do you then want to change the driver? There is nothing that says you have to use VISA.

 

You might want to search the forum for posts on using HID.dll.

Member
viveksriram.yg
Posts: 5
0 Kudos

Re: Interfacing psoc3 device with labview through usb communication

Thanks Knutson,

 

I agree that we can directly call hid.dll library file. But if we use NI-VISA to configure our driver, then also it should work. But it shows "device cannot be started " error. Can you suggest why it is not working out ?

 

 

Trusted Enthusiast
rolfk
Posts: 4,723
0 Kudos

Re: Interfacing psoc3 device with labview through usb communication


viveksriram.yg wrote:

Thanks Knutson,

 

I agree that we can directly call hid.dll library file. But if we use NI-VISA to configure our driver, then also it should work. But it shows "device cannot be started " error. Can you suggest why it is not working out ?

 

 


Since it is a HID device, it gets claimed by the HID driver from Windows and VISA can't grab that device anymore easily. Go with HID.DLL. Going with VISA you do not only have to implement the protocol on top of HID but also the HID low level protocol itself.

Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions
LabVIEW ArchitectLabVIEW ChampionLabVIEW Instructor
Member
viveksriram.yg
Posts: 5
0 Kudos

Re: Interfacing psoc3 device with labview through usb communication

Thanks Rolf,

 

Can you please tell how to use "call library function node" in labview for hid.dll library file. In this function node only subroutine (of hid.dll) names are mentioned, no prototype

 

is provided. I don't know what would be input arguments and return type of those subroutines. For example in "void  HidD_GetAttributes(void )" subroutine, what are input

 

arguments and what is return type?     

Trusted Enthusiast
rolfk
Posts: 4,723
0 Kudos

Re: Interfacing psoc3 device with labview through usb communication

[ Edited ]

viveksriram.yg wrote:

Thanks Rolf,

 

Can you please tell how to use "call library function node" in labview for hid.dll library file. In this function node only subroutine (of hid.dll) names are mentioned, no prototype

 

is provided. I don't know what would be input arguments and return type of those subroutines. For example in "void  HidD_GetAttributes(void )" subroutine, what are input

 

arguments and what is return type?     


Since hid.dll is a Microsoft DLL you should go to MSDN and search for the relevant functions. Unfortunately accessing HID devices through HID.DLL is not all there is. You also need to access SETUPAPI.DLL functions for device enumeration. That said there has been some work done both here and on lavag.org about that though I'm not sure it ever went out of the prototype status.

 

The APIs especially in setupapi are not exactly trivial to interface.I did in the past a project for a specific HID device and decided to write a DLL in C to communicate with that device and make the LabVIEW interface considerably more simple. Unfortunately I can't post the source code for that.

Message Edited by rolfk on 01-28-2010 05:05 PM
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions
LabVIEW ArchitectLabVIEW ChampionLabVIEW Instructor
Member
viveksriram.yg
Posts: 5
0 Kudos

Re: Interfacing psoc3 device with labview through usb communication

Thanks Rolf, 

 

Eventually, I want to interface LabVIEW with my PSoC3 when it will come up as a Cypress device, i.e. it binds to the Cypress driver. So, I believe it would be best if I try getting it hooked up with the VISA driver when attempting to communicate from LabVIEW. However, the problem that persists is every time I update the driver for the PSoC3 to the VISA driver, I get the Device cannot get started error (Error 10). I was wondering where the problem can be with the descriptors maybe? 

 

Vivek

Cypress Semiconductors 

Member
viveksriram.yg
Posts: 5
0 Kudos

Re: Interfacing psoc3 device with labview through usb communication

Further information about the PSoC3 side code -

 

It is defined as a single interface vendor specific class device with 2 endpoints, 1 IN and 1 OUT. 

Member
Danielsr
Posts: 3
0 Kudos

Re: Interfacing psoc3 device with labview through usb communication

Have you found out how to do this? I'm trying to get the same thing to work.