Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Run code on host PC, RT target, and FPGA

Solved!
Go to solution
Highlighted

Hello all,

 

I apologize if I am asking a repeat question. I searched for this a bit and couldn't find a solution.

 

I am trying to run a single VI (either on the compactRIO RT or on the connected host PC) and have it run code on the host PC, the RT target, and the FPGA code. I currently have code running on the host PC that opens the FPGA reference and runs the FPGA code, but I am not sure how to do this with a VI on the RT target. Any advice/help would be great. Thank you!

 

 

Brandon 

0 Kudos
Message 1 of 7
(4,269 Views)
Highlighted

BrandonGT,

 

Hello! This document talks about how to Programmatically Open a VI from within Another VI. Using the VI server you can open a VI on your PC from the RT and vice-versa. Is this what you were looking for?

 

If you were wanting to know how to open and run the FPGA code from the RT code, you can do it the same way you are currently doing it from the PC, the code should be the same. This tutorial on FPGA Design, Development and Programming talks about this.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ben Sisney
FlexRIO V&V Engineer
National Instruments
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
0 Kudos
Message 2 of 7
(4,256 Views)
Highlighted

This is close. I want the VI running on the host PC to run a VI from the RT on the RT. Your links are helpful but I have no idea how to use the VI server to accomplish this. Perhaps I am missing something. Any additional advice? Thank you!

 

Brandon 

0 Kudos
Message 3 of 7
(4,240 Views)
Highlighted

Hi Brandon,

try this:

On the host side:Host_Main..png

 

Make sure IP address and port of VI server matches target settings.

 

On the RT target:RT_Main.png

 

Inside RT_LoadFPGA.vi: RT_LoadFPGA.png

 

 

1st start the VI on RT target

2nd run the VI on your host

 

Regards,

Swen

 

 

 

Message Edited by swenp on 01-21-2010 08:40 AM
Message 4 of 7
(4,229 Views)
Highlighted
I still don't think this is quite what I am looking for. I want to build this to an executable that I run on my host PC. When I run it, I want it to automatically run code on both the RT and the FPGA. I am going for the simplest possible solutions as my users will likely only know to double click an icon. I'm sorry if I'm not getting it, but I have never used the VI server before.
0 Kudos
Message 5 of 7
(4,196 Views)
Highlighted
Solution
Accepted by BrandonGT

You're not far away from reaching your goal. But you need at least

  1. Compiled FPGA code (Bitfile) containig your code to run on the FPGA.
  2. A compiled executable for your RT target, set to autostart.
    You could use the code from my first post as a starting point. Compile, deploy and set it to autostart on your RT target.
  3. A compiled executable for your Host machine; the one your user will start.
    You could use the code from my first post, maybe load settings IP Address, Port etc. from Ini-File.

If you double click the exe on your host computer it will open an application reference to your RT target machine and call the VI on that target machine. Thats how you can run code on your RT. From this RT code you can download and run the FPGA code (bitfile) to your FPGA, or control the already running FPGA code by controlling a state-machine. Load more VIs to your RT targets memory and call them from your host to add more funtionality if you need to.

Message 6 of 7
(4,181 Views)
Highlighted

swenp wrote:

You're not far away from reaching your goal. But you need at least

  1. Compiled FPGA code (Bitfile) containig your code to run on the FPGA.
  2. A compiled executable for your RT target, set to autostart.
    You could use the code from my first post as a starting point. Compile, deploy and set it to autostart on your RT target.
  3. A compiled executable for your Host machine; the one your user will start.
    You could use the code from my first post, maybe load settings IP Address, Port etc. from Ini-File.

If you double click the exe on your host computer it will open an application reference to your RT target machine and call the VI on that target machine. Thats how you can run code on your RT. From this RT code you can download and run the FPGA code (bitfile) to your FPGA, or control the already running FPGA code by controlling a state-machine. Load more VIs to your RT targets memory and call them from your host to add more funtionality if you need to.


 

Ditto! You could even go as simple as have your PC code have a shared variable "start" that when ran sends a boolean true value to your RT code that is a startup executable waiting for a "start" (boolean true) signal.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ben Sisney
FlexRIO V&V Engineer
National Instruments
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
0 Kudos
Message 7 of 7
(4,174 Views)