From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

queued state machine doubt

VeeJay:

 

I think Ravens Fan was recommending that you dequeue elements differently in your second loop.  Instead of dequeuing elements inside your case structure, move the dequeue element function outside the case structure, unpack it as shown in message 7, and then use the command portion to control your case structure.  Is this the type of functionality you are looking for?

 

Elizabeth K. 

National Instruments | Applications Engineer | www.ni.com/support 

0 Kudos
Message 11 of 14
(421 Views)

Hi Elizabeth,

 

Thank you for your reply. The reason I was dequeuing the elements inside the case structure is because there was a coke machine queued machine example on ni.com and I was just trying that out.

 

I am currently using references between my 4 parallel loops and passing information around. Information I get from RS232 serial port cannot be separated as Command and data. I make that distinction because all I get from the port is bytes. My RS232 driver loop reads byte by byte and if that byte corresponds to say 160 decimal or 164 decimal, I know that the next 4 bytes are data, so inside the case structure of my driver loop, I read 4 bytes again from Serial port and so forth. SO far, I have the program working using references, but not with queues.

 

Jay

I may not be perfect, but I'm all I got!
0 Kudos
Message 12 of 14
(405 Views)

@VeeJay wrote:

 

I am currently using references between my 4 parallel loops and passing information around. Information I get from RS232 serial port cannot be separated as Command and data. I make that distinction because all I get from the port is bytes.  

Jay


Sure you can.

 

Your command is DecodeSerialData.  You pass with it the bytes that you get from the serial port.  Inside the DecodeSerialData case, you read the data, decode it down to the serial command and its data.  And do what you need to based on the serial command code that is embedded in the data.

 

Or you can let the serial acquisition loop acquire the bytes and decode the serial stream itself.  Then send the appropriate command and the corresponding data into the queue.

0 Kudos
Message 13 of 14
(396 Views)

So would you think that the RS232 driver vi that I attached can be done in a better way using a queue easily? I would love that.

 

Thanks!

 

VJ

I may not be perfect, but I'm all I got!
0 Kudos
Message 14 of 14
(385 Views)