LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronize Loops w/QSM?

I'm using an Event-Driven QSM for a project.  I had to pull one of the states out due to performance issues with the serial port.  It's now it its own loop, but I still want to control the port opening and closing from the state machine.  How do I prevent the parallel loop running before I'm ready?  I tried simplifying my current application and attached it?

Thanks!


Message Edited by Derek Price on 05-15-2008 07:05 AM

Message Edited by Derek Price on 05-15-2008 07:06 AM
Download All
0 Kudos
Message 1 of 13
(3,740 Views)
Hi Derek,
insert your code from the parallel loop into your idle case. See the attached example.
 
[edit] You don´t have to change the timeout, because you send the message every time. Smiley Happy [/edit]
I make a new example.
 
Hope it helps.
 
Mike


Message Edited by MikeS81 on 05-15-2008 01:19 PM
0 Kudos
Message 2 of 13
(3,736 Views)
Hi Derek,
here is the other example.
 
Hope it helps.
Mike
0 Kudos
Message 3 of 13
(3,735 Views)
Derek

Here is yet another example.
Visualize the Solution

CLA

LabVIEW, LabVIEW FPGA
0 Kudos
Message 4 of 13
(3,732 Views)
VADave has the best answer for your question, but for future reference you might look into the Rendezvous vis and see how they work.  They could be a better answer in a future application.
Randall Pursley
0 Kudos
Message 5 of 13
(3,713 Views)
Mike S81 - I actually had it setup that way before, but there were performance issues with the serial port that made me put it into its loop.

VADave has a solution closer to what I was looking for.  However, I want the state machine to control the initialization and closure of the serials ports, in case I need to close and reopen a port.  How do I make sure that the serial port in the parallel loop is initialized in the state machine first?

Randell - how do I choose from all the synchronization tools - queues, rendezvous, occurrences, etc.?  What makes you recommend the rendezvous?

Thanks,
Derek
0 Kudos
Message 6 of 13
(3,704 Views)
Hi Derek,
make sure that the dequeue element from the "data" queue runs before the dequeue element from "your" queue. You can insert it, into the error wire.
Mike


Message Edited by MikeS81 on 05-15-2008 04:43 PM
0 Kudos
Message 7 of 13
(3,699 Views)
Hi Mike,

I'm still a little confused.  In this simplistic example, the VISA configure is happening external to the parallel loop and not within the main state machine loop.  There may be times where the serial port needs to be changed during run-time, but I'd have to restart the program in this case.  How do you enforce ordering - making sure that the parallel loop is not run before the VISA configure in the state machine is initialized?

Thanks
0 Kudos
Message 8 of 13
(3,659 Views)

Hi Derek,

yes you are right, with the example from VADave you have to restart your program. Where do you have performance issues with my example?

Mike



Message Edited by MikeS81 on 05-16-2008 12:38 PM
0 Kudos
Message 9 of 13
(3,657 Views)
Derek

I made a modification to allow reinitializing the serial port without restarting.  You could replace the Init Serial Port Boolean Control with synchronization logic like Randall suggested.


Message Edited by VADave on 05-16-2008 06:48 AM

Message Edited by VADave on 05-16-2008 06:49 AM
Visualize the Solution

CLA

LabVIEW, LabVIEW FPGA
Download All
0 Kudos
Message 10 of 13
(3,643 Views)