05-13-2011 05:08 AM
Hi,
I've been struggling with this for the past few days. I am having a problem with slow updating of shared variables on my RT project....but only after building the application into exe's.
The application consists of an RT target (cRIO 9073) sampling inputs at a rate of 1sec. I have a host PC running the front panel that updates with the new acquired values from the cRIO. These values are communicated via shared variables.
Once the cRIO samples the inputs, it writes the values to the shared variables, and then flags the data as 'ready to be read' using a boolean shared variable flag. The hostPC polls this boolean shared variable and updates the indicators on the front panel accordingly.
Now, this worked fine during development, but as soon as I built the RT exe and host exe's, it stopped working properly and the shared variables ended up being updated very slowly, roughly 2-3sec update time.
To give you some more background:
What strikes me is that it works fine before building exe's and its not like the cRIO code is processor intensive, its idleing 95% of the time.
05-13-2011 09:21 AM
Are you saying the the NSV's hosted on the cRIO are updating at 2-3s instead of the programmed 1s interval as verified by the DSM?
If so then you may have some unexpected timeout occuring within the cRIO timed loop. Do you wire the error terminals on your NSV nodes? Perhaps
you are getting some sort of warning message from the SVE that would indicate a problem. Also you might look into binding your PC HMI indicators directly
to your cRIO NSV's. This would be much more efficient than polling.
05-16-2011 02:34 AM
Thats exactly what I'm saying, it takes 2-3seconds to update the values.
I have tried taking out the polling on the PC side, and registered an event on the changing of that shared variable and that doesn't do anything to change the slow update time. Even if I stop the PC, and just monitor the shared variables in DSM it updates slowly.
I also tried utilising the "flush shared variables" vi to try to force the update....that does nothing.
I wire all the error nodes religously. Still no luck.
Its very strange, I'm not too sure whats happening here. These things should be able to update in 10ms.
05-16-2011 08:53 AM
On some cRIO's I have seen a problem when the gateway address is set to 0.0.0.0 which you would think would be ok. But on some older BIOS's this create havok with the
DSM and NSV's. You might want to try to set the gateway to the IP address of your PC host which is generally innocuous. Other than that I would suggest creating a simple 1s timed loop that flashes the user led and toggles a simple NSV at the same time to verify that it is not another sort of timeout issue in what you think is a reliable timed process.