05-19-2010 12:25 PM
🙂 thanks! Yup, it wouldn't be a one way street for sure. Now, regarding synchronization. The commands will not be sent until Producer 1 (Consumer 2) or Parallel process 1 receives its ACK. Will there be some sort of delay or race condition? Intertwining two queues such that the correct ACK is sent for the correct command...hmmmm... now I got to think about that for a moment.
Touche' tbob!
V
05-19-2010 01:21 PM
Give me some time, I will try to come up with a scenario today. Right now its lunch time.
05-19-2010 02:17 PM
As an example of two way queue, is the vi I have attached right? For now, I haven't included the serial communication. Assumed that the numeric is the command it receives and gets the ACK from the status Q.
V
05-19-2010 02:22 PM
modified it a little bit with notifier for stopping the loops. I notice that if the loops are in sync, output from PPL2 is read into PPL1 and displayed. Reinitializing the whole program and starting the program again doesnot give the output B0.
V
05-19-2010 02:56 PM
I changed the mechanical action of the stop button to latched when released. I also added shift registers for the queue ref and queue error wires in the top loop for the second queue. This seems to be necessary or the loop hangs. In the bottom loop, I added an enqueue in the Default case just to see if the queue was working properly. Now everything seems to be working. See attached vi.
05-19-2010 03:10 PM - edited 05-19-2010 03:11 PM
OK I get it now. But, this is just one command and one ACK. If there are more c ommands and corresponding ACK's, I would have to create a shift register for PPL 2 de-queue too? I will be opening a serial port and PPL1 will READ and enqueue and PPL2 will dequeue and enqueue the ACK and PPL1 qill again write it back to the port. Right? Cool, I think I got this concept down under my armor. Although, why did you have to add a shift register?
I have to incorporate a State Machine which will take care of different states my test will be at. This will get really exciting now.
V
05-19-2010 03:35 PM
VeeJay wrote:... why did you have to add a shift register?
The shift register passes the error condition and the queue reference between each loop iteration. What if there was an error somewhere? The error in to the queue comes from the loop left hand side. Without a shift register, this will always be a no-error condition, and you will miss any errors that occur. If the queue reference becomes invalid, without a shift register it will be a valid queue ref and will cause an error, which will not get propgated any further. With the shift registers, the state of the queue ref and error wires will be propogated for each loop iteration.
05-19-2010 03:48 PM - edited 05-19-2010 03:50 PM
Awesome! thank you. Right now I am becoming AMBITIOUS and have added a little more to the equation. Refer vi and tbob, your comments are most certainly required and welcome.The vi is not complete, but just proof of concept. I will have to perform tasks based on commands which wil be my next addition to the process.
VeeJay -> Learnt a lot in LabVIEW today 🙂
05-19-2010 05:19 PM
I think you've got the idea. Good job. Now, before it gets out of hand, clean up your wiring. Try not to make any unecessary bends, and don't hide wires. Straighten out wires that go through tunnels in case structures and loops. Make the effort now because after you get it working, you won't want to mess with it anymore. If you leave a mess of wires, you will regret it when you come back a few months from now to modify it and see a big mess of wires.
You did a good job of learning and made a sincere effort to do some coding on your own. It is a pleasure to help someone who wants to work this hard.
05-19-2010 09:37 PM - edited 05-19-2010 09:42 PM