LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

programmatically deploy shared variable inside stand-alone RT application ( cRIO-9014)

Solved!
Go to solution

Hello,

 

I have an issue here regarding to use single-process shared variables inside stand-alone  RT application for cRIO-9014  


I simplified my LV application ( LV2010 ) into two for testing the use of shared variables.  see the attached file.

 

1) only run on host PC:     testHost
2) only run on cRIO-9014:  testRTcRIO

 

for both, I crated stand-alone executable and source distribution.

 

for testHost,
a). I copied ..\builds\testcRIO\Host Source Distribution to  d:/ni-rt/xmlrpcFEU
b).I run ..\builds\testcRIO\Host Application\startup.exe
c). xmlrpcFEUlog-host.txt is generated.

 

for testRTcRIO,
a).using FileZilla to connect to the RT target over network,  I copied ..\builds\testcRIO\Source Distribution\c\ni-rt\xmlrpcFEU

    to /ni-rt/xmlrpcFEU on the RT target
b). I also copied  ..\builds\testcRIO\Real-Time Application\c\ni-rt\startup to /ni-rt/startup on the RT target
c). from Max, I restarted the cRIO-9014,
d). xmlrpcFEUlog-RT.txt is generated.

 

It can be seen that the shared variable is not working inside RT target. but worked OK on PC. the method to deploy programmatically does not work.  any suggestion?

 

another thing is:
can I use telnet to the RT target 9014 and start RT application  directly? what is the command inside RT from telnet terminal?

Currently, I can telnet into cRIO-9014,  but, what can I do with it?

 

================
220-National Instruments FTP
220 Service Ready

530 Please log in with USER and PASS
USER
331 User name ok, need password
PASS
230 User logged in
help
211-    USER    PASS    ACCT    TYPE    STRU
211-    MODE    CWD     XCWD    PWD     XPWD
211-    CDUP    XCUP    PASV    RETR    REST
211-    PORT    LIST    NLST    QUIT    SYST
211-    STAT    HELP    NOOP    STOR    APPE
211-    STOU    ALLO    MKD     XMKD    RMD
211-    XRMD    DELE    RNFR    RNTO    SIZE
211     MDTM
===========================

 

Regards

 

 

xiaofeng

Download All
0 Kudos
Message 1 of 11
(6,051 Views)

Hi Xiaofeng

 

Thank you for the detailed explanation you have provided, so as I understand it you are using shared variables within an RT target, but the code is not functioning as expected. You are deploying programatically which seems to be the functions causing the error. You also mention using Telnet and whether this is compatible with RT and what functionality is available.

 

Firstly is there a reason you have chosen to use telnet over FTP? As FTP is better supported by the target. You can use telnet to communicate on the RT, but first a telnet server will need to be deployed on the controller to allow the telnet functionality. The reference help file gives details on the available tasks for telnet services.

 

I have been looking into shared variables also.

I have taken this from an article on our internal system.

 

Currently programatically deploying a shared variable from a real-time target is not supported.  You must either:

  1. Manually deploy shared variables from the Project Explorer window by right-clicking on them and selecting Deploy All.
  2. Programatically deploy the library from the host PC using the application invoke node and specifying the real-time target IP address (See below).

Note: This information is current as of LabVIEW 2010.

 

There are a number of articles available that discuss different aspects of your shared variable problem that will be a good reference for you.

I have also found a few examples online regarding deployment of shared variables.

 

Have a look at this information and then get back to me with any questions or queries that you have.

 

Thanks

Stephanie L
Applications Engineer
National Instruments UK and Ireland
0 Kudos
Message 2 of 11
(6,028 Views)

Hi, Stephanie

 

thanks for your quick reply.  I did read all articles/examples you mentioned before posting out my question.  

 

The reason that I like to be able to deploy the shared variables inside the stand-alone RT application is that  we want to use the compactRIO alone once the software is delivered to our client. There will not be a Host PC to deploy anything to the RT target. all communication between the compactRIO RT software and other non LV software is through TCP/IP using XML-RPC.     

 

In fact, what I want to do is a sort of global structure within the RT application for passing information between subVIs.   

 

I did some tests again, see the attached file. I found that the problem is probably due to  malfunction of  Controls[] Property for cluster inside RT OS,  although the LV Help states that Controls[] Property is OK for RT OS.

I placed an initialised Cluster in my TestXMLRPCServer.vi,  But using property Node to get controls[] gives Zero item.  In my test case, it shall give 9 if I run the same application on Host PC.

 

Can you have a look at the attached proj file and point out anything I do wrongly?  

I can use FileZilla or FTP to the RT target, but is there a way to start RT application remotely without rebooting the compactRIO?

Many thanks for your time

Regards

Xiaofeng

 

 

 

  

Message 3 of 11
(6,015 Views)

Hi Xiaofeng

 

Thank you for the update, I have taken some time to look at your project and have noticed a few things that you may be aware of, but I would like to give you some ideas. When looking in your project I right clicked the variables in the project finder and asked to find caller, in the recent file you sent the configparameter variable, although placed in a vi, was not recognizing a caller, I replaced the node in the vi with the same variable and the caller was then recognized. I have also noticed that you do not initialize the variables at the start of the application, not initializing may cause old data to be stored and used unexpectedly.

 

Your second question is regarding the ability to remotely start a vi without rebooting. I have had a look into this, there are a few ways of accessing the stand-alone application on the device remotely, but starting the application remotely is trickier. How you set up your application will depend on how much control you need over the RT application. One suggestion is to set up a startup.exe which will run on start up and run the vi. The vi server may be another function which could be useful.

 

I have taken this from an internal article, it may be a method you could look into.

 

"Remotely run RT application: 
Attached are an example applications built in LabVIEW 8.0 and LabVIEW 8.2 intended to replace what was done in LabVIEW Real-Time 7.1. The application allows you to point to an RT target and specify a RT application which you have built. The application will

  1. FTP the RT application to the target.
  2. Run it via VI Server.
  3. Connect to it via remote panels.

After it is complete, it will delete the files from the target if the option was selected. The application can be called using a batch file or a shortcut with command line arguments to easily download and run specific applications on a RT target. The source for the utility is also provided in the attachment and it requires the Internet Toolkit to run."

 

I have also found a vi server example that may help with development.

 

If there is anything else please let me know.

 

Thanks

Stephanie L
Applications Engineer
National Instruments UK and Ireland
0 Kudos
Message 4 of 11
(5,989 Views)

Hi, Stephanie

 

thanks again.

 

 

all the remotely starting RT applications you mentioned  are through a Host PC having LV installed.  What I am looking for is to start the RT application somewhere from other machine ( i.e.. Linux or Unix ) with no LV installed.  Maybe this is off the main stream.  Anyway, it is not my main issue for the time being.

 

back to the main problem again.

 

 

I tried to have a very simple test example modified from "Getting Started with the Labeled Real-Time Module" NI doc to explain what I  found.

 

see the attached.   it is simple VI inside the project, I took away sub dir.  

 

if I highlight testCluster-RT.vi, click "RUN", I get the following in the Eventlog file 

 

  11/26/10 01:23 PM No of Cluster items == 9 No Error

However, if I build executable and click "Run as startup" ,I get the following in the Eventlog file ( the same as I reboot RT target)

 

  11/26/10 01:40 PM No of Cluster items == 0 No Error

 

 

is there something during build specfication  I missed out?   I just can not see the difference between the two methods.

 

or  cann't we use Cluster inside RT application? 

 

 

your help is very much appreciated.

 

Regards

 

 

Xiaofeng

 

 

 

 

 

Download All
0 Kudos
Message 5 of 11
(5,980 Views)

Hi, stephanie

 

I found a few lines from "LabView Real-Time Module User Manual" 2003  Part Number 322154D-01

 

it says:
.>>>>>>>
Modifying Front Panel Objects of RT Target VIs
When a VI or stand-alone application runs on an RT target and there is no
front panel connection with host LabVIEW, you cannot execute VIs that
modify a front panel. For example, you cannot change or read the
properties of front panel objects with property nodes because there is no
front panel.
You must establish a front panel connection with the RT target or open a
remote front panel connection to read any front panel properties or for any
front panel property node changes to reflect on the front panel objects.
The following features do not work on an RT target with no front panel
connection:
• Front panel property nodes and control references
>>>>>>>>>>>


does it mean that I will never be able to use cluster's property nodes and control reference  inside stand alone RT application ?

 

any way around this?


regards

 

 

Xiaofeng

 

0 Kudos
Message 6 of 11
(5,970 Views)

Hi Xiaofeng

 

Thank you for keeping me updated with your progress, I have spent this morning looking further into function compatibility with realtime and accessing the target from a PC without LabVIEW.

 

Front panel references will indeed not work in a built LabVIEW RT executable due to the lack of the front panel. You can use the new Data Value Reference to pass a reference to your data cluster into your subVI, this will avoid making unnecessary copies of the data in the cluster.

Since you can't use the cluster datatype in shared variables you could try using flatten to string VIs, to convert the data before storing, but this will add additional code each time you need to reference the data.

 

With regards to accessing the target from a PC without LabVIEW, you could create a host vi as an executable and then install this and the runtime engine onto the machine which requires access to the target.

 

Installation walkthrough

building an installer

shared variables in executables

LabVIEW run-time 2009

LabVIEW run-time 2010

 

These links should help you with the last step, let me know how you get on and if you have any further queries.

 

Thanks

Stephanie L
Applications Engineer
National Instruments UK and Ireland
0 Kudos
Message 7 of 11
(5,937 Views)

You can use the system replication tools to copy all of the files on a RT target to another target.  This includes all of the shared variables as well as the startup code.  if you are using network shared variables then you can retarget them using the .alias file that resolves project process names into ip addresses.

0 Kudos
Message 8 of 11
(5,924 Views)

Hi, Stephaine

 

many thanks for your time.  I will try your suggestions if I can. I have not used the new data value reference, and am thinking of using variant.   I will try and let you know soon once I am able to get to work place to test on RT target ( bad weather). 

 

 

 

xiaofeng

 

 

 

0 Kudos
Message 9 of 11
(5,907 Views)

You could also use an action engine to pass any sort of data structure around to different vi's within your RT app.

0 Kudos
Message 10 of 11
(5,903 Views)