Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing cRIO from executable on another PC

Hello,

 

This is my setup:

2015-03-17_164322.png

 

MyVI (FPGA) is built and deployed to the FPGA, where it runs automatically. I have made a MyVI (Host) which is able to access the FPGA while it is running, and read and write to the FPGA. These two vi are working fine, and I am using the "FPGA Open VI Reference" block to make this happen.

 

Now, I want to create an executable that I can run on another PC (with no LabView). The executable would just read and write to the FPGA like MyVI (Host).  How do I do that? It seems that using shared variable is not an option. I am using the "LabView FPGA Interface" instead of the "Scan Interface".

0 Kudos
Message 1 of 9
(6,938 Views)

Hi Bladhart, 

 

It sounds like shared variables would be a good solution here, is there a specific reason you cannot use them for this application?

 

Here is a link to a White Paper that discusses using the LabVIEW Application Builder to create an application that can be deployed to a computer that does not have LabVIEW installed.  If you do this, I recommend creating also creating an installer for the application, which will install the required version of the LabVIEW Runtime Engine to the computer so the executable can be run.

Regards,
Kelly B.

National Instruments
0 Kudos
Message 2 of 9
(6,918 Views)

It is not that I don't want to use shared variables. LabView is not letting me use it.

When I am working on my host vi, I am able to find the shared variable block under structures. However, when I am working on my FPGA vi, the shared variable block is no where to be found.

 

Also if I copy and paste a share variable into the FPGA vi, it gives me an error that says: This type of Shared Variable is not allowed on the comuting device. Either move the VI to a different computing device, or change the type of the variable.

0 Kudos
Message 3 of 9
(6,913 Views)


 

Now, I want to create an executable that I can run on another PC (with no LabView). The executable would just read and write to the FPGA like MyVI (Host).  How do I do that? It seems that using shared variable is not an option. I am using the "LabView FPGA Interface" instead of the "Scan Interface".


Hey Bladhart,

Can you clarify what you are trying to do? By no LabVIEW on the other PC, do you mean no LabVIEW at all or just no LabVIEW development environment, meaning that a LabVIEW runtime can be installed.

 

Thanks,

 

Sebastian

0 Kudos
Message 4 of 9
(6,899 Views)

@speleato wrote:


 

Now, I want to create an executable that I can run on another PC (with no LabView). The executable would just read and write to the FPGA like MyVI (Host).  How do I do that? It seems that using shared variable is not an option. I am using the "LabView FPGA Interface" instead of the "Scan Interface".


Hey Bladhart,

Can you clarify what you are trying to do? By no LabVIEW on the other PC, do you mean no LabVIEW at all or just no LabVIEW development environment, meaning that a LabVIEW runtime can be installed.

 

Thanks,

 

Sebastian


Hello Sebastian,

 

Just no LabView development enviroment. Yes, we will have LabView rutime installed. Thanks.

0 Kudos
Message 5 of 9
(6,893 Views)

In that case, I think the answer is to build an application and deploy it to the other PC. You'll be able to open a reference to the FPGA from the built application and use the host interface to interact with it.

 

https://www.ni.com/docs/en-US/bundle/labview/page/developing-and-distributing-an-application.html has some information on how to do that.

 

Sebastian

0 Kudos
Message 6 of 9
(6,890 Views)

Hi Blandart,

Your FPGA is unable to communicate over ethernet directly.  You have to use the cRIO host to act as a go between.  That is why shared variables are not avaialble on the FPGA block diagram pallet.

 

The easiest method to use front panel communication between My VI (FPGA) and My VI (Host).  Then change, or add, the front panel on My VI (Host) to use shared variables.  Then write a new PC VI that reads the shared variables running on the cRIO Host.  You can compile the PC version as a runtime program and run this on a remote PC.  You will need to compile and deploy the cRIO software to run as startup.

This is commonly known as running the cRIO headless.

 

On the cRIO you will have

 

FPGA VI > Front Panel> cRIO Host VI

 

Then to communicate to the PC

cRIO Host VI> Shared Variable> PC VI

 

 

 

Hope this helps.

Cheers

Stephen

0 Kudos
Message 7 of 9
(6,869 Views)

Hello Stephen,

 

After I have compiled MyVI (FPGA) and MyVI (Host), how to I deploy both of these VIs to the cRIO and get both of them to run at startup?

 

I think I am doing something wrong where I am only either able to get MyVI (FPGA) to start or only MyVI (Host) to start, but not both.

Thanks.

0 Kudos
Message 8 of 9
(6,834 Views)

Hi Bladhart, 

 

When you call the FPGA Open Reference function from MyVI(Host), that will run the FPGA VI.  To run the Real-Time VI at startup, you can right-click on the Real-Time Build Specification in the Project Explorer and check "Run as Startup"

 

Also, I recommend reading the Compact RIO Developer's Guide for more information on how to work with the different parts of the Compact RIO, and learn about the best practices for doing so.

https://www.ni.com/en/shop/compactrio/compactrio-developers-guide.html

Regards,
Kelly B.

National Instruments
0 Kudos
Message 9 of 9
(6,817 Views)