FieldPoint Family

cancel
Showing results for 
Search instead for 
Did you mean: 

Slow update of Shared Variables on FP-2015

My application consists of a VI running on an FP-2015 which collects and transmits data from/to various I/O modules (DI-301, aI-111,Do-401 etc.) and passes this data to a Host PC using Shared Variables.  It runs embedded on the FP-2015 so that it can react to certain conditions I/O conditions and implement the appropriate safety measures independently of the host pc.  When I try to change some of the values of the shared variables from the host PC, it seems to take a long time for them to update on the Fieldpoint controller.  For instance, if I try to change the value of a Digital Output on the DO-401 from the Host machine, it can take anywhere from 1-3 seconds before the I/O point actually toggles.  I am using an Array of Booleans as the shared variable type.  I am pretty sure the code is running at the correct speed at that this delay is caused by the shared variables because if I remove the shared variable and toggle the digital outs from high to low and low to high, they switch at the appropriate rates.  Has anyone had any problems with using shared variable on a FP-2015?  (The shared variables are hosted on the PC, not the 2015)
 
Also, I have seen some postings which say the FP-20xx do not have enough memory to run the shared variable server.  Should I be OK if the server is running the Host pc?  The link below says the shared variable engine will not work properly on the FP-2015 because it does not have enough memory but the second link below says 32mb are required (although 64 are recommended), which the FP-2015 has.  Any confirmations whether the shared variables will work properly on the FP-2015.  In all, I presently have 6 shared variable, each on being an array with a length of 20 elements.
 
 
 
Thanks
 
Damien
0 Kudos
Message 1 of 5
(4,864 Views)
Damien,

You should be able to install and use the Shared Variable Engine on the FP-2015 because it has 32 MB of RAM, as you said. 

You may be seeing the 1-3 seconds because the RT VIs are running at too high of a priority, or if there is not wait in your loops.  Your application may be "starving" the CPU, in which case lowering its priority and/or adding waits to loops can give the network processes time to run and process the shared variable values you are writing from the host.

One other thing to check, is to run a small RT VI that does nothing except write a value from a boolean shared variable to your DO channel.  Write to that shared variable from a VI on your PC, and see if you still see really long reaction times.  Simplifying the application will help determine if it is a problem with the shared variables, or if you can possibly modify your RT application in a way to give you better shared variable performance.

-Tommy
0 Kudos
Message 2 of 5
(4,857 Views)

Thanks Tommy, I appreciate the advice.  However, I think I will be abandoning the network-published shared variables for now.  Before I left the office yesterday, I found the "communication wizard" for the Real-Time module.  It allowed me to select my top-level VI and it automatically set up a communication routine to transmit all the controls and indicators from the RT target to the VI running on my host PC.  It allowed me to select from multiple communication protocols (I selected TCP) and everything is working well now.  I would have liked to use shared variables because they seem to be so simple to use but I do not want to waste time trying to hunt down a problem I may never fix.  For now, out with the shared variables, in with TCP.

PS.  I didn't change any of my code, (I was using timed loops in case you were wondering), and by changing over to TCP communication all my delay problems were solved.  This reinforces my suspicion that the delays were caused by the shared variables.

 

Damien 

0 Kudos
Message 3 of 5
(4,855 Views)

Following up on this, I am quite sure I know what your problem is. I experienced a huge delay when using SV on cFP2120 controller, untill I set a timedelay on the cFP. Do this: right click on the cFP controller in your project and select "Bank Network Module", then change the pause setting from its horrible default value of 0ms to say 100 ms. This will give the SVE on your cFP target enough time to run and your SV's will get up to speed. It took me a week to figure this out !.

 

søren jensen

Message 4 of 5
(4,652 Views)

Just to say THANKS to you soren... your post solved my problem. I was getting mad about the slow update of the shared variables. Thanks again.

 

Robst.



Robst - CLD

Using LabVIEW since version 7.0


0 Kudos
Message 5 of 5
(3,847 Views)