LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Could not perform operation because of I/O error.

Hi, I am trying to do wifi communication through TCPIP programming.

 

Programme is as follows

 

1) Application has only one button in UI for write and read operation.

 

2) Calling DefaultRM, and viOpen in application main function. (viOpen (defaultRM, "TCPIP0::10.115.4.74::80::SOCKET", VI_NULL,

                                                                                                                                VI_NULL, &instr);)

3) Calling read and write function in button click event.

 

when I click button first time I can able to read and write through TCPIP. but when I click second time I get "Could not perform operation because of I/O error".

 

Application works fine( read and write ) if we are  opening and closeing the communication channel in each click event ( means keeping open, read, write and close in click event).

 

But I want initialize DefaultRM, and viOpen in application main function and I want to perform read and write in click event without error.

 

Please help If anyone faced similar problem.

 

Regards

Manjunath.T.N

0 Kudos
Message 1 of 2
(3,300 Views)
Supposing you are not accidentally calling viOpen on a resource already opened, one possible problem can arise if your instrument handle ('instr' variable) is local to the main function and is not inherited from the button callback: how is it defined in your program? You could try putting breakponints immedaitely after viOpen in the main function and before viWrite or viRead in the button callback and see if the handle is correct.
Message Edited by Roberto Bozzolo on 10-14-2008 02:14 PM


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 2
(3,296 Views)