08-14-2008 08:45 AM
Christian and Jeremy thanks!
One more thing to clarify though; if I have 2 sensor, which would require 2 message inputs, should I have them in parallel or is there a cleaner way to bundle the messages in a loop and from a single wire transfer them to the response reading loop?
08-15-2008 12:26 PM
Hi Nones,
You can put the messages in an array, and then use for loops to iterate through each message when you send them.
One thing to watch out for is what order you expect to receive the responses in. With networked communications, there is always the chance that when you send two messages, you might get the response to the second message before you get the response to the first. I usually set up this type of application so the listener thread knows what I expect to receive, but makes no assumptions as to what order the responses will come in.
I'm not sure if I answered your question thoroughly enough, let me know if I didn't, I'll continue to monitor this thread.
08-18-2008 08:34 AM
Hello Jeremy,
Here is the parallel structure that I suggested. It works with n number of sensors as long as you keep adding routines in parallel. However, if with the VI attached, I only run one sensor, the output cluster for the other will have not use. Thus, is LabView capable of only showing the output display for the sensor in use?
How would the for loops apply for this VI?
Thanks!
08-19-2008 10:28 AM
Hi Nones,
You might want to confirm what is going on by running with highlight execution. My guess is that with only one sensor enabled, the other read is waiting for a message which will never arrive, and that causes the entire loop to hang up. With your architecture, you would probably want to put each read in its own while loop.
I think if you wanted to run multiple channels in parallel, but be able to iterate through them in a for loop (as I suggested earlier), you would probably have to use the frame API instead of the channel API. If you are only going to have a few channels, I would stay with the channel API and use parallel while loops.