LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems running RT vi with shared variables from host PC

I am running cRIO-9012 (VxWorks), LV 8.2, with XP SP2 host PC.
 
Using various examples and postings elsewhere in NI help, I've put together a simple project (attached) where I am trying to use a host vi and the VI Server to run an RT program which is resident on cRIO.
 
GOAL:  Use host vi to run programs on cRIO, using network-published shared variables to communicate to and from the RT program.  I don't want to manually deploy these RT programs.
 
PROBLEM:  When I try to run the RT vi ("c:\ni-rt\startup\Untitled.vi") from the host (see "Run RT vi from Host.vi"), I get error 1003 from the invoke node / Run VI = "The VI is not executable. Most likely the VI is broken or one of its subVIs cannot be located."
 
But I cannot find the problem with my RT vi. 
 * I made a source distribution to compile it for VxWorks, and FTP'd the file to the proper spot.
 * This same arrangement works as soon as I take the shared variable out of Untitled.vi.  I can run it from the host PC without error (though obviously, too, without receiving any data).  Because of this, I'm suspecting the problem is related to the shared variable.
 * I use the "Library Deploy to RT.vi" (from NI help) to deploy the variable before I attempt to run the program.  This step seems to execute without error, but I don't know how to verify that the library was actually deployed.
 * I can run Untitled.vi from another application on cRIO using Run RT vi from RT.vi.
 * Once Untitled.vi has been loaded into memory, Run RT vi from Host.vi can run it with no problems.
 
By the way:
 * I do have following software installed on cRIO:
   - Network Variable Engine 1.2.0
   - Variable Client Support 1.2.0
   - OS 2.1, LV RT 8.2 (and more...)
* Network-published shared variable stats
   - no binding, no buffering, not a single-writer
   - not an RT-FIFO
 
I appreciate very much any help you are able to provide!
 
0 Kudos
Message 1 of 17
(11,613 Views)
Hi David,

First of all, thank you for posting a very detailed description of your setup. A few things:

Where exactly did you get "Library Deploy to RT.vi" ? I'm not seeing that on my real-time palette. Does this VI run without errors?

Also, to check whether a library has deployed successfully, I recommend you use the variable manager, available under Tools»Shared Variable»Variable Manager from LabVIEW. Then you can right-click on RT Systems to add a system, and enter the IP address of your cRIO. You'll then be able to see all currently deployed libraries.

Hope that helps.

Best regards,
-Sam F, DAQ Marketing Manager
0 Kudos
Message 2 of 17
(11,590 Views)
 

http://sine.ni.com/devzone/cda/epd/p/id/4802 

Thanks for your response, Sam.  Above is the link where I found "Library Deploy to RT.vi".  It does run without errors.  Perhaps with the Variable Manager you suggested, I'll be able to see whether it does its job.  Unfortunately that vi is password protected, so I can't see what it's doing.

I'll post again once I've run the Variable Manager. - David

0 Kudos
Message 3 of 17
(11,578 Views)
Hi David,

I have an idea what is going on. This provided VI on the developer zone is supposed to work on desktop (Windows) PCs that do not have LabVIEW but have the LabVIEW Run-time engine, and it enables them to deploy a library programmatically.

Unfortunately, I don't think that this VI will work on LabVIEW Real-Time targets such as CompactRIO. The only way to deploy shared variables on a real-time target is via the Project Explorer (right clicking on a library and saying deploy all). The good part is that a library will stay deployed in the shared variable engine until you explicitly undeploy it... meaning that you can reboot the CompactRIO as many times as you want, and the shared variables will be deployed in its engine each time.

Best regards,
-Sam F, DAQ Marketing Manager
Message 4 of 17
(11,574 Views)
What you said corroborates with what I found using Variable Manager -- I was surprised to see quite a raft of old variable libraries residing on my cRIO (which I then cleaned up).  And this sort of permanently-deployed variable will work fine for my application.
 
Now then:
(1) If the variables are indeed deployed / resident on cRIO, why do I get this error 1003 when trying to remotely start the vi ("Untitled.vi")?  Again, I don't see what can be wrong with the extremely simple application, unless the source distribution build process did not correctly compile it for VxWorks.  As I mentioned, I can run the (uncompiled) vi on the RT target directly from Project Explorer without error.
 
(2) Does it matter where in the Project Explorer a shared variable is created (before it's deployed)?  If I use a network-published SV to communicate between a host program in the project and a compiled RT vi resident on cRIO flash memory, must the project library be created in the host portion of the project?
 
(3) Relatedly, if I want to use a network-published SV to communicate between a host vi and RT vi within the same project, must this SV be created in two different libraries (one in host portion of project, one in RT portion)?
 
I looked for these answers in various NI tutorials (e.g., "Creating Shared Variables...") but couldn't find these answers.  Perhaps the answer to (2) is the answer to (1)...  I appreciate your help very much. - David
0 Kudos
Message 5 of 17
(11,569 Views)
Hi David,

Has anybody replied to your questions? I'm experiencing similar problems...

Some time ago with Labview 8.0 I developed a cRIO application where a Windows laptop had to communicate to an embedded real-time application. The Windows hosted the shared network variables, and I could communicate with the cRIO real-time target with no problem.

Now I'm developing a similar application but with a PXI real-time target. I tried the same architecture, so the laptop hosted the variables. I could communicate to another VI running in Windows but not to the  real-time target. I got error -1950679035 so it looks like the shared variables were not deployed. Then I made a copy of the shared variable library, bind the shared variables of the copied library to the shared variables of the library hosted by windows. The result I get is warning -1950679034 ("The shared variable has no value.") for a little while and then error -1950679022 ("The process was not found or is not responding.").

I don't know if this thread is still alive, I may post a new one for the problems I'm having.

The documentation I read always talks how to deploy shared variables that are hosted by the real-time target but I don't see a clear answer on how to deploy shared variables to a real-time target that are hosted by another machine.

Raimon Pousa
0 Kudos
Message 6 of 17
(11,200 Views)
Oops, further browsing NI documentation I found http://digital.ni.com/public.nsf/allkb/3B4E447A1B6E4F46862570F900475112.
And my problem was the Windows firewall. With the firewall disabled everything works well.

Hope this helps whoever run into this issues...
0 Kudos
Message 7 of 17
(11,179 Views)
David,

To answer your question about error 1003, the key understanding is that LabVIEW on your host computer is a development system and the LabVIEW in the cRIO controller is a run-time version. The primary behavior difference in this instance is that a run-time engine can not re-link VIs. If the dynamically launched VI has any sub-VIs, it needs to know where to find them. The run-time engine can not search for VIs (including vi.lib VIs) because they are not resident in the RT controller, and searching/relinking is a Development Environment capability, not a run-time capability. I found a good forum post that has some good questions and answers that might answer some of your questions. 

I have linked this post below. The last several post have some good general tips

 http://forums.ni.com/ni/board/message?board.id=170&message.id=118121&requireLogin=False

Regarding your questions on Shared Variables I would take a look at the Shared Variable White Paper as I believe this will help answer your questions. Hope this helps.

Regards,

Steve

Message Edited by Bassett Hound on 05-24-2007 01:32 PM

0 Kudos
Message 8 of 17
(11,178 Views)
I've had several systems that worked when I hosted the shared variables on the RT side, but not on the Windows side.  Thanks to this thread, I've verified that it is the Windows Firewall that is causing the problem.  Does anyone know what program to make an exception for so that I don't have to completely disable the Firewall but can still host the shared variables on the PC?

Thanks,
   DaveT
-------------------------------------------------------------
David Thomson Original Code Consulting
www.originalcode.com
National Instruments Alliance Program Member
Certified LabVIEW Architect
Certified Embedded Systems Developer
-------------------------------------------------------------
There are 10 kinds of people: those who understand binary, and those who don't.
0 Kudos
Message 9 of 17
(7,299 Views)
 

Hello David,

I followed this document https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000YIKqCAO&l=en-US . It provides the services you have to include in the Windows Firewall exceptions in order to be able to use shared variables and DSC. I hope it helps, it worked for me!

Raimon Pousa

0 Kudos
Message 10 of 17
(7,290 Views)