LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2 COM port swithching at once!!!

I have made one applcation in which I need to send and read data from two different COM port one after other in random manner during testing.

 

My development PC has WIN7 in which it is working fine. but other PC in which I am installing my application has XP SP3(Successful installation) in which when after sending to one com port in other when reading from different com port I am getting timeout error.. It was working before but now it is failing mostly.

 

Sequence is like this.

 

1. COM1- read + write - success

2. COM1- read + write - success

3. COM1- read + write - success

4. COM2- read + write - failed

 

I dont know what could be the reason. Previoiusly it was working fine but now its failing. Everything is same with no change.

 

Any suggestion is 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 1 of 117
(4,091 Views)

What error are you getting? 

0 Kudos
Message 2 of 117
(4,074 Views)

What error are you getting? How are you switch ports? Do you open both com ports and direct the data to the port or are you opening and closing the port as required? 

0 Kudos
Message 3 of 117
(4,071 Views)

Like I told in my question that I am getting timeout error. Also I am initializing both COM port one after other and at a time writing and reading from any one of them 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 4 of 117
(4,061 Views)

Can you show us the code that you have made?

-----

The best solution is the one you find it by yourself
0 Kudos
Message 5 of 117
(4,049 Views)

PFA... First VISA I am initializing in the startting only.. Second I am doing inside FOR loop. Sending data to char depends on intital character.  I am facing problem in the COM port which is initialized in the starting only. After few iteration I am getting timeout error for the arduino VISA

 

 

Let me know if any clarification is needed. 

--------------------------------------------------------------------------------------------------------
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 6 of 117
(4,035 Views)

What is your timeout value set too? The default is 10 seconds. If are leaving the port open and not using it for greater than the time out value you will get this error. ALso check to ensure the byte count is correct for the read function  

VISA Read Details

This function might return less than the number of bytes requested if the function reaches the end of the buffer, reaches a termination character, or if a timeout occurs. The output error cluster indicates if a timeout has occurred.

0 Kudos
Message 7 of 117
(4,031 Views)

Please check the code properly.I am not leaving the VISA open..Like I said at a time only one VISA is active i.e. at  a time I will be writing and reading from one COM port only

--------------------------------------------------------------------------------------------------------
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 8 of 117
(4,024 Views)

In the "find list" are you getting the detected devices and are you sure its not empty? 

-----

The best solution is the one you find it by yourself
0 Kudos
Message 9 of 117
(4,015 Views)

are you using usb to serial convertor?

Try to check both com ports from MAX.

are you sure you did not change the usb to serial cable which was working eariler?

 

the  code you have shown is horrible , it is very difficult to check what is happening.

now if this code is developed by you , you should start thinking about design architectures.

0 Kudos
Message 10 of 117
(4,011 Views)