LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Migration from Serial polling to Serial queue with event handler

Hi, I am trying to migrate from classical serial polling communications to serial queue with "event handler" for the buttons pressed by the user. I have placed four while loops, one for the event handler, a second one for serial reading, a third one for serial writing (depending on what button was pressed) and the last one for processing what was read from the serial reading while loop, via a queue.
My attached device reads the signals from 8 sensor ( 4 temperature and another 4 temperature plus humidity in the same sensor ) and send them via serial to Lavbiew.
First of all, only once just after running the LV program, I must turn on my attached device with an ON command plus a carriage return after that the device will respond with the number of sensors plugged to it, disabling the corresponding buttons in the front panel. Then labview must wait until I pressed Acquire Button (event handler) and send a CF command plus what sensors to acquire plus a carriage return, then the device will respond continuously to labview with the sensor readings until I press the stop button (event handler), there is also another button to exit the program, also with event handler.
I am having problems using the event handler and the queues because I am new using these structures, I have looked at  the LV examples but there is nothing concrete on using serial with event handler and queue.
Take a look at my VI and you will soon notice what kind of problems I am having, any suggestions will welcome.
Thank's in advance.
Regards.
0 Kudos
Message 1 of 2
(2,703 Views)
Hi Luisete,
 
Maybe the problem arise because you are En- and DeQueue in parallel. You do a lot of things in parallel, that is nice if you are sure that one loop doesn't have to wait for another loop. Make sure you don't dequeue before enqueue.
 
Hope this helps
 
I never knew that the standard error cluster output could be wired directly to the loop control of a while loop.
First time I see this Smiley Surprised
0 Kudos
Message 2 of 2
(2,683 Views)