LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Functional globals miss out data between timed loops

Fuctional global VI  between two timed loops (One Read and one write from two loops) are not behaving in the manner expected.In this case ,  Witer(Reading from a host PC) and Reader timed loops run in 10ms timeslice.With that, at any time two more timed loops with time slices of 100 mS,100mS also run.
But after writer timed loop updates the Functional global,the reader of the same functional global not returning the value updated in the writer.Why is it so?.
 
I created the functional global as mentioned in the help.After creating, i made EXECUTION from the VI properties as "subroutine".After i made "Skip the subVI if busy" by right clicking the VI .Do i need that execution re-entrant?When i tried it looks like timed loops stops their iteration at all.KIndly help
jeyaseelan P
AutoTEC Systems Pvt Ltd,
Bangalore-46
0 Kudos
Message 1 of 8
(3,572 Views)
Not sure exactly what is happening, but NEVER make a functional global reentrant. Can you send some code?
PaulG.
Retired
0 Kudos
Message 2 of 8
(3,559 Views)
I recommend using a queue for this particular problem not a functional global. Queues suit better to producer - consumer design pattern. So create queue and pass the queue reference to both of your loops. In one loop enqueue elements to the queue and in another queue dequeue elements from the queue. If timing is important, use timeout for both operations.
--
Tomi Maila
0 Kudos
Message 3 of 8
(3,555 Views)

Thanks for the reply.

Most  of the functional globals are for taking boolean data. The writer updates  boolean data in  the func

global , for the true or false event happening from the host

PC. Like this i am using almost 15 such booleans  for co-ordinating actions across other timed loops in

RT controller. Shall i still with go for queues with one queue for every boolean?.Any other method available

for rectifying this problem  with present func global set up?

 

 

jeyaseelan P
AutoTEC Systems Pvt Ltd,
Bangalore-46
0 Kudos
Message 4 of 8
(3,536 Views)

Pls find the timed loop arrangment in the Main VI which is attached .Some Func globals receive data from

the  TCP loop for co-ordinating actions across other timed loops and some func globals write data to the

TCP loop.

jeyaseelan P
AutoTEC Systems Pvt Ltd,
Bangalore-46
0 Kudos
Message 5 of 8
(3,534 Views)
All,
By definition a functional global can't be reentrant. The whole purpose of the functional global is to store data in an uninitialized shift register. If you make the functional global reentrant, you wind up having many shift registers "floating around" in memory instead of a single memory location. Data will certainly be lost by making a functional global reentrant.
 
 
Chris C
 
0 Kudos
Message 6 of 8
(3,520 Views)


@jey wrote:
Pls find the timed loop arrangment in the Main VI which is attached .Some Func globals receive data from

It does not seem such a good idea to have timed loops within timed loops. somehow seems to defeat the purpose. 😉

Since you did not leave much other code in it, it's difficult to tell how the code is supposed to work.

0 Kudos
Message 7 of 8
(3,512 Views)
Just try queues and see if you can solve your problem with them. Queues are super fast (at least in new versions of LV) and I think they can do the job.

Tomi
--
Tomi Maila
0 Kudos
Message 8 of 8
(3,508 Views)