AnsweredAssumed Answered

[AD7747-EBZ] Reading Multiple Evaluation Boards in LabVIEW, Problems with DLL?

Question asked by William_Wilson on Mar 10, 2014
Latest reply on Apr 2, 2014 by William_Wilson

Good afternoon forums!

 

I am back with another question regarding the AD7747 evaluation board and LabVIEW. Sean Brown previously helped me out by providing a set of VIs that have the function prototypes for the ADI_CYUSB_USB4.dll library built into them. We have used these VIs to good effect and have taken preliminary experimental data confirming that the AD7747 returns the same values using our LabVIEW code as when the evaluation software is used.

 

However, for the next part of our project, we need to develop a control algorithm using 2 of the AD7747. In the final implementation we will utilize our own microprocessor with two I2C ports or an I2C multiplexer; however, for the purpose of expediting the software development we are trying to use two evaluation boards and merely modify the software we already have to develop our control algorithm.

 

I am not looking for LabVIEW support, and I do not expect that my problem lies at the level of the LabVIEW environment. Below is a screencap of the attached VI that returns the error I am consistently getting:

 

Error Returning Simple VI.PNG

I am using the same method to implement the boards as the set of example VIs sent to me used, except that the example VIs assumed that only one evaluation board was to be used. At first glance, the Search For Boards VI (search.vi) seems to return two values, the number of boards (implying that the library can handle multiple boards) and a nondescript byte-array buffer. The search.vi initializes this array with 8 elements. When one board is connected, this buffer is populated with one element in the 0th index of the array. The original implementation I am using as a working reference indexes the array at the 0th element and passes the resulting byte to connect.vi as the "path" argument for the Connect function in ADI_CYUSB_USB4.dll.

 

With no documentation on this byte array "buffer" I assumed it returned the path of all AD boards connected with the VID and PID specified to the Search_For_Boards call. When two boards are connected to the computer via two USB ports, the Search_For_Boards call returns the byte array buffer with two elements (one at the 0th index and one another at the 1st index), which seemed to corroborate my assumption. Setting up a second connect VI and passing the byte indexed at the 1st element to the path argument generates an error in the Connect function call to the DLL. This error is returned with a value of 2001 (the "Board 2 Connect Error" indicator in the block diagram above), which from my past experience indicates a generic error related to an inability to find a device at the location specified.

 

I have tried connected both boards in every single configuration to the USB ports on my computer but the error persists. The first call to Connect using the Zeroth element in the byte array buffer always seems to work. This LabVIEW VI merely passes data and retrieves data from the DLL library ADI_CYUSB_USB4.dll, and so I think the problem with connecting to multiple boards via USB lies in the library.

 

Is there support for multiple boards of the same type being communicated with at the same time? I would assume that as long as each board can be given a unique handle, there should be no problem with the concept of utilizing two eval boards at the same time.

 

Attached is the simple VI that I created to recreate the same error occurring in the more complicated code, along with the dependent VIs that Sean Brown graciously provided.

Outcomes