LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2 com port parallely

I am working on a application in which I may need to read value from one com port and need to write the value to other com port and vice versa. During testing I will be doing this lots of time....It might possible that after reading data from one com port and after few proceesing I need to write to other ports and vice versa.

 

Is using two parallel while loop is good approach?

--------------------------------------------------------------------------------------------------------
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 1 of 13
(2,973 Views)

?

--------------------------------------------------------------------------------------------------------
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 2 of 13
(2,961 Views)

Hi Ranjeet,

 

as an active participant in the forum you should know that it is considered rude to bump threads within 2 hours…

 

Well yes, I would use separate loops to handle the COM ports.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 13
(2,955 Views)

I know..It was by mistake..My monitor was off

--------------------------------------------------------------------------------------------------------
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 4 of 13
(2,952 Views)

I also thought so ,but managing the data will be difficult.. you see I need to read data from one com port and write to other com port.

--------------------------------------------------------------------------------------------------------
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 5 of 13
(2,950 Views)

Hi Ranjeet,

 

you surely heard the words ActionEngine, FGV, queue, notifier, KeyValuePairs, (and several more) before…

 

Who said it would be easy? 😄

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 13
(2,944 Views)

Yes few of them......What is ActionEngine and KeyValuePairs?

 

Any link will be great !!!!

--------------------------------------------------------------------------------------------------------
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 7 of 13
(2,937 Views)

Hi Ranjeet,

 

do you know how to use Google?

 

AE

KVP

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 13
(2,934 Views)

Yes I know how to use..If you send the link there is no harm.

--------------------------------------------------------------------------------------------------------
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 9 of 13
(2,927 Views)

Personally, I would 4 loops here.

1) Read COM1

2) Read COM2

3) Send COM1

4) Send COM2

 

So you have two loops just for reading the serial ports.  They should use a queue to send the data to whoever needs to process it.  You have another two loops just for sending data that needs to be sent.  They get the data to send via queues.  This is a version of the Producer/Consumer.


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 10 of 13
(2,918 Views)