Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

'Visa Write' function gets stuck when an instrument is off in a LabVIEW PDA application

Hello,
 
    In a LabVIEW PDA application, we use the NI-VISA functions to communicate with a IEEE488.2 instrument over USB. The NI-VISA functions work fine when the instrument is ON. I notice that when the instrument is switched OFF, the 'Visa Write' (& 'Visa Close') function gets stuck halting the PDA application which should not happen.:( I saw that even using 'Set VISA timeout' with 'Visa Write' does not help under this condition. Please note that this getting stuck problem is not there in LabVIEW Desktop application. Can a NI-VISA PDA expert suggest a solution or even a workaround to solve this getting stuck problem? This is a bit of an emergency.
 
Note: Version of LabVIEW that we are using: LabVIEW 8.5 Professional Development System for Windows Vista/XP/2000, and LabVIEW 8.5 PDA Module for Windows Mobile, and NI-VISA 4.2.
 
Thanks and Regards,
Subhashini
 
0 Kudos
Message 1 of 10
(4,972 Views)
Hello,
I noticed that you are using Windows Mobile and VISA 4.2?
If that is the case, then you are not using the correct VISA version for your device.
You may want to consider downloading and installing VISA 4.3.

Here is a list of the current VISA versions, notice the supported Operating System.
Let us know if this helps.
Christian A
National Instruments
Applications Engineer
0 Kudos
Message 2 of 10
(4,925 Views)
Hello Chris,
    Thanks for ur response. I downloaded and installed NI-VISA 4.3 on the PDA. Does not help. 😞 When the instrument is switched OFF, the 'Visa Write' function gets stuck halting the PDA application. Has anyone reported this problem before? Please suggest a solution for this problem.
    I see that there is a 'NI Spy' application on desktop. Is there a 'NI Spy' application for PDA? If yes, then we can see what's going on in PDA when the instrument is switched OFF.
 
Thanks and Regards,
Subhashini
0 Kudos
Message 3 of 10
(4,904 Views)
PDA's have limited resources, disconnecting your device while your application is running could be cause the code to actively wait on the resource being used by
the device. Why is your instrument disconnect/switched off when your application is running.
Can you paste a copy of your code for me to take a look at?
Christian A
National Instruments
Applications Engineer
0 Kudos
Message 4 of 10
(4,863 Views)
Hello Chris,
 
    Thanks for ur response. The requirement is that the application should recover communication with the instrument when the instrument is switched OFF & then ON. I will try to post some portion of the code shortly. Meanwhile, can u please tell me if there is a 'NI Spy' application for PDA? I want to see what's going on in PDA when the instrument is switched OFF.
 
Thanks and Regards,
Subhashini
0 Kudos
Message 5 of 10
(4,858 Views)
Hello,
There is no NI Spy program for Windows Mobile devices.
Please post your code here along with model of your touch panel and we can go from there.
Christian A
National Instruments
Applications Engineer
0 Kudos
Message 6 of 10
(4,834 Views)
Hello Chris,
 
    Thanks for ur response.
 
    Since i wanted to eliminate problems that could be caused by my actual PDA application, i modifed the LabVIEW PDA VISA example "Basic TCPIP or USB VISA Write and Read - PDA.vi" to show you the problem with VISA functions on PDA when the instrument is switched OFF. First, VISA Open (with my instrument resource name) is called & then in a while loop (with an execution delay of 1 sec), VISA Write (with *IDN?) is called & then VISA Read is called to read the response. Again, i notice that when the instrument is switched OFF, the Visa functions get stuck (instead of returning with error) halting the PDA application. I also used 'Set VISA Timeout' as in the attached "Basic TCPIP or USB VISA Write and Read - PDA_Timeout.vi" but that also did not help.
 
    Please note that on desktop, both the modified "Basic TCPIP or USB VISA Write and Read - PDA.vi" & "Basic TCPIP or USB VISA Write and Read - PDA_Timeout.vi" work fine i.e. when the instrument is switched OFF, the Visa functions (Write/Read) return with error as desired.
 
    The test case that i used is:
1. Switch on the instrument. Wait for a few seconds.
2. Run the VI on desktop OR run the application that uses the VI on PDA. The writing request/reading response happens properly.
3. Switch OFF the instrument. On desktop, the Visa functions (Write/Read) return with error as desired. On PDA, the Visa functions get stuck halting the PDA application.
 
    The PDA that we use is acer n300 Windows Mobile 5.0 PDA. I wait & hope that you will suggest a solution asap.
 
Thanks and Regards,
Subhashini
 
0 Kudos
Message 7 of 10
(4,802 Views)
Hello,
Thank you for the code.
We do not have that PDA model but we will test with what we have.
I will respond back as soon as tests are completed.

Thank you.
Christian A
National Instruments
Applications Engineer
0 Kudos
Message 8 of 10
(4,756 Views)

Hello Chris,

    I hope your tests are completed now...Did you also notice the problem that i described? Could you analyse this problem? Thanks.

Thanks & Regards,

Subhashini

 

0 Kudos
Message 9 of 10
(4,593 Views)
Hello,
We have tested this on the PDA's we have available to us however these did not have Windows Mobile 5, they were running Pocket PC 2003 .
I have some suggestions for you to try in order for us to narrow this cause for these errors.

The VISA engine uses the same time out for both reads and writes so you dont need to set it again.
Can you remove the while loop from your code and disconnect the cable before the first write.
Let us know if you get a time out error.

Now try it this after you disconnect it after the write but before the read (to do this you may need to add some sort of delay).
Let us know if you get a time out error now.

Also do you have another PDA you can test your application on.
Let us know how these go.


Christian A
National Instruments
Applications Engineer
0 Kudos
Message 10 of 10
(4,572 Views)