LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2 com port parallely

If you see my protocol then *B$  I need to send  using COM1 and from COM2 I need  to read *BOK$....Again in the next command I need *Dc1$ from COM2 and *DOK$ from COM1.. again in next I need to change the COM ports

 

Untitled.png

Now its not good as per me to use 4 while loops.

 

What say?

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 11 of 13
(233 Views)

@Ranjeet_Singh wrote:

If you see my protocol then *B$  I need to send  using COM1 and from COM2 I need  to read *BOK$....Again in the next command I need *Dc1$ from COM2 and *DOK$ from COM1.. again in next I need to change the COM ports

 

Untitled.png

Now its not good as per me to use 4 while loops.

 

What say?


Since it seems like a "laundry list" of things to do, maybe you would use some kind of state machine to process your commands and responses.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 12 of 13
(218 Views)

@Ranjeet_Singh wrote:

If you see my protocol then *B$  I need to send  using COM1 and from COM2 I need  to read *BOK$....Again in the next command I need *Dc1$ from COM2 and *DOK$ from COM1.. again in next I need to change the COM ports

 

 

Now its not good as per me to use 4 while loops.

 

What say?


Nothing wrong with having another loop that works as a state machine that sends the commands around and reads data from a queue.

 

But based on what you just showed, I would just make a simple state machine.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 13 of 13
(210 Views)