07-11-2008 11:38 AM
07-11-2008 12:06 PM
07-11-2008 12:12 PM
07-11-2008 12:20 PM
Closer, but still not there. You've just moved the create semaphore out of the subVI. You still have a new semaphore (and different) semaphore created at each location it is used.
Think of how queues are used. You Obtain a queue at the beginning of the program. Pass that reference to the location that does the dequeueing and all the locations the to the enqueueing. Destroy the queue when the program ends. You need the same situation for the semaphore. Create a single semaphore at the beginning of the program. Pass that location to each section of code where you want to prevent items from simultaneously do some action. Destroy the reference at the end of the program.
Look back at my Reply 27.
Ravens Fan wrote:
1. Wire up your semaphore reference in and out to the connector pane in the subVI.2. In your main VI, make sure you use the Create Semaphore function in the initialization part of your code. Use the green reference wire that comes out throughout your code.3. Wire that green reference wire to each of the Semaphore terminals in all the subVI's that use it.4. When your code ends, use the Destroy Semaphore function in the cleanup part of your code.
07-11-2008 12:30 PM
07-11-2008 12:33 PM - edited 07-11-2008 12:40 PM
Closer, but still not there. You've just moved the create semaphore out of the subVI. You still have a new semaphore (and different) semaphore created at each location it is used.
Think of how queues are used. You Obtain a queue at the beginning of the program. Pass that reference to the location that does the dequeueing and all the locations the to the enqueueing. Destroy the queue when the program ends. You need the same situation for the semaphore. Create a single semaphore at the beginning of the program. Pass that location to each section of code where you want to prevent items from simultaneously do some action. Destroy the reference at the end of the program.
hahaha, i think you are hitting right to my sensitive subject. i want to know how to use a queue because i see it used in more advance users and i always wanted to know how it is done.
Queue is also often used to get rid of local variables by transferring data through wires right?
right now, i have two while loop
so to start the program, i called create semaphore
and how do i get two while to end when the program ends?
there will be two wires (from two while loop) coming to 1 end program sequence?
07-11-2008 12:41 PM
07-11-2008 12:45 PM
krispiekream wrote:
hahaha, i think you are hitting right to my sensitive subject. i want to know how to use a queue because i see it used in more advance users and i always wanted to know how it is done.
Queue is also often used to get rid of local variables by transferring data through wires right?
krispiekream wrote:
right now, i have two while loop
so to start the program, i called create semaphore
and how do i get two while to end when the program ends?
there will be two wires (from two while loop) coming to 1 end program sequence?
07-11-2008 12:54 PM - edited 07-11-2008 12:59 PM
07-11-2008 01:09 PM