07-09-2014 04:42 AM
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?
07-09-2014 06:44 AM
?
07-09-2014 06:46 AM - edited 07-09-2014 06:46 AM
07-09-2014 06:50 AM
I know..It was by mistake..My monitor was off
07-09-2014 06:53 AM
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.
07-09-2014 07:00 AM - edited 07-09-2014 07:00 AM
07-09-2014 07:07 AM
Yes few of them......What is ActionEngine and KeyValuePairs?
Any link will be great !!!!
07-09-2014 07:09 AM
07-09-2014 07:20 AM - edited 07-09-2014 07:20 AM
Yes I know how to use..If you send the link there is no harm.
07-09-2014
07:25 AM
- last edited on
05-09-2025
02:24 PM
by
Content Cleaner
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.