05-21-2009 07:24 PM
We have a PXi target running Labview Realtime 8.5 and we use a series of shared variables to communicate between the target and the client software. The code has been developed (and extensively used) over the last 2 years and has not presented any problems with the shared variables when deployed from the Project Explorer (for both the target and Laptop based client software). However, when trying to run an executable version on the PXI real-time target of exactly the same code the shared variable engine seems to fail on initial loading. Since it is an executable it is difficult to display any errors but it seems that the crash happens right at the beginning of the program when we try to initialize a number of shared variables. Sometimes it does load but probably only 10% of the time. When connecting the Debug tool to the code and restarting the executable it is runs with no issues. Once however we did manage to capture and error (error -1950678982 The shared variable client-side read buffer is full).
I have checked a number of posts in the Knowledge Base (for example How Do I Deploy Network Shared Variables from a Compiled Executable?) but it has still not solved the issue. Any thoughts and suggestions?
Adrian
Solved! Go to Solution.
05-26-2009 08:35 AM
Hi Adrian,
To confirm: are you in fact using an Invoke Node to deploy your shared variable library from within your executable? Do you have buffering enabled? Are you using RT FIFO? In what order are you starting your host/target? Which is hosting the variables?
05-27-2009 10:28 AM
05-28-2009 12:24 PM
Hi Adrian,
Will asked a good question. What is hosting the shared variable the host or the target? If they are on the target check to make sure that they are deployed in the Shared Variable Manager before you run the executable. If your shared variables are hosted on your real-time host machine then you should be using the invoke node to deploy the shared variable.
Please let us know where the shared variable library is located.
05-28-2009 12:52 PM
05-29-2009 11:43 AM
The wait with the sequence structure is the way I would do it (if someone has better way please feel free to chime in). I would also place an error indicator right after the deploy invoke node for debugging.
Please give me an update after you get a chance to test this.
06-01-2009 01:21 PM
Finally back in the lab and I was able to test the Invoke Node code again. I did get Error 1043 as I remembered from last time. This error seems to indicate that the Invoke Node Library:Deploy Library Method is not supported in Real-Time. However, the help indicates that it is supported by Real-Time Operating System but I am not sure if this includes the case when running as an executable. I also read somewhere that the SVE can give misleading errors sometimes so just to make sure that I am using the method correctly here are the inputs to it:
- left the IP address empty
- the path for the library is C:\ni-rt\startup\data\Shared_Variable_Library.lvlib. Is this correct? Does it have to be a relative path or not include the library name?
The version of Labview RT I am using is 8.5 as reported by MAX. At this point I am stuck from the looks of it...
06-01-2009 01:24 PM
06-02-2009 07:04 PM
Hi Adrian,
Right click on your shared variable library in Project Explorer and select save as. Now just save the library to you C:/ drive. Now put this code at the start of your program (use the IP of your target).
You shouldn't have to wire anything else to it. Let me know if this gives you any issues.
06-03-2009 08:34 PM
I have been testing it for a few hours now and I can't make it fail again. The big difference in my implementation was to use your suggestion and not wire the error cluster throught the method since the error it generates was causing a number of issues later on. So let me then summarize the final configuration that seems to work:
- running and executable on a Real-Time 8.5 target, booting it up while not connected to a client. Shared variable library hosted on the target and needs to load by itself.
- I added a flat sequence structure on the 'main' vi (the top executable vi) with an Invoke Node method (as shown above) in the first structure together with a timer of 10 sec and the rest of the code in the second part of the structure. The shared variable library was copied to the target in a data directory and the path provided to the method (same path as above) and the IP address was that of the target.
I found out that it takes about 8-9 seconds for the shared variable engine and the library to start (I am sure more is going on that just that) and it is important to wait this time before initializing shared variables or the behaviour was unpredictable. The method still generates Error 1043 (function not supported) but I simply ignore it now and it seems to work.
Thanks for your help! I will let you know if there is some instability in the future but it all looks good as of now.