LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Adapting custom driver for a robotic device that is interfacing with an FPGA

Hi,
I have a custom driver for a robotic device that I'd like to interface with an FPGA that is reading the digital encoder signals. I am a novice at programing driver files so any help would be much appreciated.

Thanks!
0 Kudos
Message 1 of 9
(5,959 Views)
Neel-

Before anyone on this forum can help you we are gong to need a lot more information. What kind of FPGA are you using? Do you already have a driver or do you want to write one in LabVIEW? Do you need to program the FPGA in LabVIEW? How do you want to interact with teh FPGA? etc...

Xaq
0 Kudos
Message 2 of 9
(5,943 Views)
Xaq -

Sorry I didn't include sufficient details. We're using a PXI-7831R that is programed in LabView to read in position and force values from a PHANTOM device. We'll also send force feedback values back to the FPGA from our program on the Windows machine. Sensable has a driver to work with their parallel port interface, but we're using a breakout box to connect to the 68-pin I/O connector on the FPGA.

So I anticpate having to create a dll in LabView and then editing our program on the Windows machine to use this new driver.

--Neel
0 Kudos
Message 3 of 9
(5,912 Views)
I should add that the program on the windows machine written in MS VC 7. It creates a virtual interface for the PHANTOM device and is based on the CHAI3D project.
0 Kudos
Message 4 of 9
(5,909 Views)
Neelk-

Thanks for the additional details. It sounds like there are going to be two problems you will run into. The first is interfacing the PHANTOM with your 7831R. If the PHANTOM has a traditional parallel interface then it should be simple DIO. The hard part is knowing what data to send/recieve from the PHANTOM device. Do you already know what the communication looks like?

The second challenge is creating a DLL from your host VI that you can call from your Windows program. In order to do this, you will need to break your host VI into several smaller VI's that pass the FPGA reference, error cluster, and data back and forth to create individual function calls in teh DLL. When you get to this point, we can discuss it further. First, I suggest tackeling the parallel I/O.

Xaq
0 Kudos
Message 5 of 9
(5,885 Views)
Hi there,

I am working on the same project as Neel, but I am a bit more familiar with this part of things so he has asked me to fill in the gaps. We are using an NI breakout box to interface the DIO of the PXI module to the parallel port of the Phantom. We do indeed have a pinout from the Phantom's parallel port that will allow us to properly route signals between the PXI's DIO and the Phantom's parallel port through a custom-made cable wired into the breakout box (which is a breakout of the 68 pin DIO connector).
0 Kudos
Message 6 of 9
(5,871 Views)

Hey Xaq,

Well we had some other side projects to work on, and I'm no back working with the Windows/FPGA interface. I have one VI that is able to determine the relative position of the PHANTOM device. We're doing this by using 3 loops (one for each motor), running in parallel. So from LabView I have the x,y,z location of the device. As a first pass I want to build a dll that allows my C program to query to position at any time.

A couple problems here:

We probably need to break up the vi into several sub vi's, but I'm not sure where to start. Should the contents of each loop be placed into its own file?

Also we've just upgraded to 8.2, and I'm noticing the method for building dll's has changed significantly. I was not involved with the conversion process, and I'm a bit confused about the tree structure. Under My Computer we have the FPGA target (this comes from our original *.lep project). If I go to Build Specifications here, the only option is to create a new Source Distribution. If I go back up a level to My Computer, the Build Specifications allows me to build a shared library, but now I can't find the vi listed for the FPGA target.

Please let me know what I should do next. Thanks!

--Neel

0 Kudos
Message 7 of 9
(5,217 Views)
NeelK-

You mentioned in an earlier post that you wanted to build your LabVIEW code into a DLL to be called from Windows. You will need to build your host VI into a DLL, you do not need to build your FPGA VI into a DLL. When building your host VI into a DLL, I would recommend breaing it up into some common functions such as initialize (that will open the and run the FPGA VI or bitfile), read/write (that reads or write values from the front panel of the FPGA VI), and close (to close any open refernences).

Building the DLL will be done under the build spec under My Computer (since you are building the host VI into the DLL and that executed under windows). There's plenty of good information about the DLL building process int eh labVIEW online help here:

http://zone.ni.com/reference/en-XX/help/371361B-01/lvhowto/building_a_dll/

Xaq


0 Kudos
Message 8 of 9
(5,189 Views)
Thanks Xaq, that clears up a significant amount of my confusion. I'll let you know if I have any other problems.
0 Kudos
Message 9 of 9
(5,185 Views)