Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Real-Time... adding more FPGA CallVI functions causes SLOWDOWN

Using LabVIEW 7.1 with Real-Time (8145) and two 7831R FPGA cards. Development Computer is quick and has mucho memory - Windows XP, 2.4 GH Pentium 4, 512 MB RAM.

Now... Throughout my application I am accessing an FPGA VI that is mainly used for IO - reading sensors and controlling motors. I am using a state machine to decide the next step for the program to process. As more and more "Call VI" functions are used, the slower LabVIEW responds to simple development tasks. For example, I can add a new Call VI function, but to add the Exec Ref wire may take up to 60 seconds to connect.

Any suggestions? Thanks in advance!

- Con
0 Kudos
Message 1 of 4
(4,216 Views)
Can you describe why you are using the Call VI node instead of the Open FPGA VI Reference and Read/Write nodes. In most applications using Open FPGA VI reference followed by the Read/Write control and Invoke Method will be the most efficient way to implement your application.

The Call VI node will have a lot more overhead in the execution of the application, needing to verify the VI that is loaded on the FPGA everytime you make a call to it.

I have not used it much in development, but I would think that every time you add another copy of the Call VI it needs to reference back to all other copies of Call VI that are referencing the same FPGA VI (target of the Call VI) and that will result in the development environment taking more time when working with the Call VI.
authored by
Christian L, CLA
Systems Engineering Manager - Automotive and Transportation
NI - Austin, TX


  
0 Kudos
Message 2 of 4
(4,212 Views)
Well one of the reasons I used Call VI - is because it worked, while the Read/Write did not.

Maybe you can offer a suggestion on why that would not work after I describe my FPGA VI.

Our application uses the FPGA card for pretty much only IO. There is one big VI that has all the IO. To accomodate that, there are multiple clusters that group IO together by function. I do not have a while loop around that VI (maybe this is why the read/write doesnt work, because it only runs once?) But regarding clusters and Read/Write... from the LabVIEW help...

"You can write to a whole cluster, but you cannot write to individual elements of a cluster."

In our application I will definitely need tyo write to individual elements of a cluster. One basic thing I am doing is controlling a stepper motor driver, giving it pulses, direction, etc. I have been able to make it work using the Call VI and then Bundling by Name whatever cluster I want access to.

Are things as clear as mud now?

Any suggestions? Much thanks in advance!

- Con
0 Kudos
Message 3 of 4
(4,210 Views)

@wrath_of_con wrote:
I do not have a while loop around that VI (maybe this is why the read/write doesnt work, because it only runs once?)


You definitely need to wrap the code running on your FPGA in a While loop so that it continues running. Commonly we set the loop to run indefinitiely (wire a constant to the Loop termination terminal) and then control the operation of the VI within the loop using the front panel controls.


But regarding clusters and Read/Write... from the LabVIEW help...

"You can write to a whole cluster, but you cannot write to individual elements of a cluster."

In our application I will definitely need tyo write to individual elements of a cluster. One basic thing I am doing is controlling a stepper motor driver, giving it pulses, direction, etc. I have been able to make it work using the Call VI and then Bundling by Name whatever cluster I want access to.

To update individual elements of a cluster in your FPGA VI, you need to create individual controls on the front panel of the FPGA VI. Add the updated data to the cluster that you are maintaining within your VI. In the new While loop, create a shift register and use it to store the cluster as a state variable of your VI. Then whenever you need to update nay values in the cluster use the Bundle by Name function as you described.
authored by
Christian L, CLA
Systems Engineering Manager - Automotive and Transportation
NI - Austin, TX


  
0 Kudos
Message 4 of 4
(4,187 Views)