FieldPoint Family

cancel
Showing results for 
Search instead for 
Did you mean: 

problem with shared variable

I am a newbie to labVIEW, after working on this program for 3 months with the help of NI people, the good news is, I finally can get a running program. The bad news is, the program is especially slow and 3 parallel loops only 1 ran. My code includes modbus, however, modbus works much faster than the shared variables of fieldpoint.
 
  Hence qn:
1) Why are the shared variables not working? I am using network published variables as my host computer passes value to the FP target and I set a buffer for the program. The program entails read and writing of shared variables, however, it was made sure that only 1 variable is allowed to read and write at one time.
 
2) Why only 1 of the 3 parallel loops will run? They are having the same time wait function, no loop should eat up the whole time share of the processor.
 
Attached are my program.
 
Really hope someone can help.
 
:1
THanks a million!
0 Kudos
Message 1 of 3
(3,619 Views)

Hi cfp!

Are the three parallel loops you're talking about then ones in cFP - Temperature Control? If so, they're not parallel at all. You're wiring the error cluster from the top loop into the middle loop and then into the bottom loop. This causes a data dependency of the bottom loop on the middle loop and the middle loop on the top loop.

Remember that a node (such as a VI, function, or loop structure) can not execute until it receives all its inputs. Furthermore, a node can't release its output values until it's completely finished executing. In the case of a while loop, this means the terminal condition must be met and the while loop has stopped executing. This means that the middle loop must wait for the top loop to finish before it can even start. And the bottom loop must wait for the middle loop to stop before it can start.

Delete the error cluster wires between the loops and you should have three bona fide parallel loops. Consider some other method of transfer between the loops for your error information if it's pertinant to your code, such as local variables, queues, notifiers, etc.

Jarrod S.
National Instruments
Message 2 of 3
(3,596 Views)
The same situation applies for cFP - Heater Control, too, by the way. Hope this helps!
Jarrod S.
National Instruments
0 Kudos
Message 3 of 3
(3,595 Views)