LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

trouble with occurence

For the first time, I used the occurence to synchronize two measurements in rough time, as shown in the attachment.

 

The from top to.. .vi (master) contains some while loop, message queue (for messaging status) and in the end of sequence, "set occurence" was placed to fire the signal of synchronization.

The slave routine is waiting for ~ 2 minute to run the sequence loop as you can see in the attachment.

 

My problem is that the message queue was ignored though synchronization itself had no problem.

In highlight execution (slow running for debugging), the message queue seems to be normal.

In (fast) normal execution, I need to put some time-delay but cannot be understood where do I put this delay.

 

(I change the position of "Generate Occurrence" outside loop, but it was useless.)

 

Can you guess what makes it this trouble? 

Have you ever heard about this kind of delay issue?

 

labmaster.

0 Kudos
Message 1 of 4
(2,855 Views)

When I see such VIs, with no error wires connecting subVIs (have you heard about error handling before?), and the usage of Flat Sequence Structure, my first thought is always that the proper data flow principle is violated in some way(s). Such codes are often vulnerable to have race conditions, and other problems...

 

Maybe you could describe what is your exact goal, what you mean about syncing two measurements? Maybe someone can advise a better method to fulfil your requirements, there are good proven design patterns which can be used quite easy with some mods if necessary (Producer/Consumer, etc...).

0 Kudos
Message 2 of 4
(2,825 Views)

Thanks for your comment.

I checked this is not related to race condition because there were no queue process just before and after this point. All messages were presented through the queue message.

I used producer and consumer loop to get the measurement. This code is the part of continuous loop for getting data.

 

labmaster

 

 

0 Kudos
Message 3 of 4
(2,813 Views)

It is much more likely you get help from someone if you attach your VI or snippet, instead of a partial screenshot.

0 Kudos
Message 4 of 4
(2,801 Views)