NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
RomanD
Posts: 25
0 Kudos
Accepted Solution

Cypress AN2131 USB Controller

Hi all,

 

I am trying to control a Hygrosens (www.hygrosens.com) USB-OUT32-IN32-Card (http://shop.hygrosens.com/en/acma-acma-7/acma-acma-3/Digital-Combo-I/O-Card-OUT32-IN32.html) via LabVIEW. There is a Cypress AN2131SC USB controller on it. The guys from Hygrosens shiped a DLL and some documentation with it, but the only thing that works is that I get an error after trying to establish a communication, that my device is not opened.

I already tested the card with software which was also shiped, the card is not the problem.

 

Attached is my VI and the DLL-File.

 

 

Kind regards, Roman

Active Participant
Wetzer
Posts: 322
0 Kudos

Re: Cypress AN2131 USB Controller

Hello RomanD

 

Since the DLL is a binary, additional informations on return values and parameters are required.

Wrong datatypes and order of parameter can cause the DLL Call to fail.

There is a good Example for working with DLLs shipped with LabVIEW. The Example is called "Call DLL.vi"

I also guess that in order to the connect to the device several function calls have to be executed in a destinct order.

To better understand this a example in another Programming Language might be usefull.

You can copy the Functions to call and their order from the text based example to LabVIEW.

 

I took a further look at the USB Controller used. There also is a .NET Assembly available for this Controller:

 

http://www.braintechnology.de/braintechnology/usb1_1dll.html

 

Regards

 

Moritz M.

 

 

 

Member
RomanD
Posts: 25
0 Kudos

Re: Cypress AN2131 USB Controller

Here is some description, which I found on the Hygrosens website (www.hygrosens.com):

 

To open the device (the card), the function, "OpenDevice" is used. This expects as a parameter the desired DeviceNumber of type byte, the driver name (EZUSB) of type string and two empty strings that are irrelevant to the use of the cards, but must be passed by because they are not optional parameters. If successful the function returns the DeviceID is the addressed device. To determine, that the function was successful, is possible with the function "GetDeviceError". This function also expects as parameters DeviceNumber and returns the last error that occurred in the form of a 4-byte wide unsigned value. If no error occurred, 0 is the return value. The error constants are described together with the function declarations in the appendix.
I also attached the documentation. Unfortunatley it is in german. I will translate it, if some can help me or has a hint for me!
Member
RomanD
Posts: 25
0 Kudos

Re: Cypress AN2131 USB Controller

Hello Moritz,

 

thank you very much for your reply! I shortly attached a part from the documentation which I found on the Hygrosens site, which describes how to open the device.

You are right, there are several function calls before it is possible to communicate with the card. These are stated in the previously attached file. If I understand it right, it has to be done like this "OpenDevice" and then "SetDeviceEnabled".

At this moment I am not sure if my parameter declaration is right. I would be very grateful, if you could give me some more hints!

 

 

Roman

Member
RomanD
Posts: 25
0 Kudos

Re: Cypress AN2131 USB Controller

Thanks to Moritz, I have also found this one: http://www.braintechnology.de/downstat18/download.php?file=labview.zip But after downloading it, there is a control missing. Has anybody an idea?

Member
RomanD
Posts: 25
0 Kudos

Re: Cypress AN2131 USB Controller

I have found some more information:

The DLL (written in Delphi 5) is designed to use the Cypress USB controller AN2131 and AN2135. Selected concept allows the use of the DLL in connection with Delphi, Visual Basic and C + +. There are test programs for all three languages. For C + + is a wrapper class wrote that even the C + + programmers have a simple access to the extensive functionality of the DLL.
I think, it is not possible to use this DLL-File with the Call Library Function Node!?
Active Participant
Wetzer
Posts: 322
0 Kudos

Re: Cypress AN2131 USB Controller

Hello RomanD,

 

since this seems to be a "normal" DLL you should be able to call it using the Call Library Function Node.

There is a good example shipped with LabVIEW: "Call DLL.vi" To find it simply type DLL in the LabVIEW Example Finder.

 

Regards

 

Moritz M.

Member
RomanD
Posts: 25
0 Kudos

Re: Cypress AN2131 USB Controller

Hello Moritz,

 

thank you again for your reply! On the "Braintechnology" website I also found a .NET DLL-File (http://www.braintechnology.de/downstat18/download.php?file=net2.0_an21xx_dll_v194.zip). This one is working well with LabVIEW!

Member
Birke88
Posts: 1
0 Kudos

Re: Cypress AN2131 USB Controller

Hello Roman,

 

i´m trying the same with the Relais 8in-8out from Hygrogens. Can you upload your .vi file? The .NET DLL file isn´t working.

 

Regards

Alex

By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page