LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Cypress AN2131 USB Controller

Solved!
Go to solution

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

Download All
0 Kudos
Message 1 of 9
(4,836 Views)

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.

 

 

 

0 Kudos
Message 2 of 9
(4,810 Views)

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!
0 Kudos
Message 3 of 9
(4,805 Views)

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

0 Kudos
Message 4 of 9
(4,801 Views)

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?

0 Kudos
Message 5 of 9
(4,793 Views)

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!?
0 Kudos
Message 6 of 9
(4,686 Views)

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.

0 Kudos
Message 7 of 9
(4,634 Views)
Solution
Accepted by topic author RomanD

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!

0 Kudos
Message 8 of 9
(4,616 Views)

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

0 Kudos
Message 9 of 9
(4,188 Views)