LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Switching between FPGA and USB interface

I have an application where I am controlling a prototype instrument using FPGA.  As the instrument firmware becomes available, the interface to the device will be over USB.  I have a USB driver (dll) that I use to talk to the instrument when it is running firmware.  I would like to modify my GUI so that I can select either the FPGA or USB interface to the instrument depending on which type of instrument is connected to the PC.

 

Are there some clever ways of making an abstract instrument interface that will, under the hood, connect and talk over either FPGA or USB selectable and changeable at run-time?

0 Kudos
Message 1 of 5
(4,773 Views)

10Degree,

I may not understand you 100%. But, I am envisioning a Boolean switch (FPGA/USB) on the LabVIEW Front Panel (GUI). This Boolean switch would be wired to the Case Selector of a Case Structure on the Block Diagram. That Case Structure would contain code for either the USB DLL or FPGA reference.

Charlie M. CLD
0 Kudos
Message 2 of 5
(4,701 Views)

Charlie,

Thank you for your reply, and I apologize for taking a while to get back with further questions.  After some consternation, I did implement a solution as you suggested.  I have a switch on the front panel where the user can specify the type of connection (USB or FPGA) to make for communication to the instrument, and then a case statement in the block diagram with a case for USB and one for FPGA.  I was wondering if you could advise me on another point.

I need to compile this application to an EXE that may or may not run on a computer with the FPGA system in place.  I have an instrument I/O thread in my block diagram that uses Open FPGA VI Reference to communicate with the FPGA and uses an ActiveX control to communicate over USB.  If the FPGA is not present, can I still use the open fpga vi and handle errors?  Your thoughts?

Thank you,

-cb

0 Kudos
Message 3 of 5
(3,973 Views)

Hi again,

If you don’t have an FPGA target connected to your PC or network, than you need to code your application so that it does not run the Open FPGA VI Reference. You may want to have your code run through a case structure that asks: FPGA target present? From the front panel, the user could specify yes and browse to their target or no. In the “no” case of the case structure, the error wires simply go straight through.

 

Charlie M. CLD
0 Kudos
Message 4 of 5
(3,922 Views)

Hi again,

If you don’t have an FPGA target connected to your PC or network, than you need to code your application so that it does not run the Open FPGA VI Reference. You may want to have your code run through a case structure that asks: FPGA target present? From the front panel, the user could specify yes and browse to their target or no. In the “no” case of the case structure, the error wires simply go straight through.

 

Charlie M. CLD
0 Kudos
Message 5 of 5
(3,921 Views)