LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Occasional GPIB Error -1073807342/-1073807300

Hi
I understand that globals could slow down the application. However, this was a convenient way for storing the sessions for all the instruments and it doesnt seem to impact the application in any way. I have been monitoring the CPU usage and it consistently stays well below 15%. Also this particular global is used in a number of test steps which are independent of each other, only sharing the CSA session between them.
0 Kudos
Message 11 of 14
(803 Views)
I think that your use of globals may be the root cause of all your problems. The VI CSA_Get VISA Resource will return a null VISA resource whenever there is an error in. I haven't gone through every VI but is it possible that somewhere an error condition is not trapped, this VI is called, and then the next VI would report an error because of an invalid name? Try removing the case statement you have in this VI. I think you'd be better off not using any globals at all but as long as you do, why not have this function always return the resource name? Pass through the error in to error out. Eliminating this function altogether would also work better. Even when it works, it doesn't seem to accomplish anything except making copies of the variable.
Message 12 of 14
(798 Views)
Hi Dennis
THanks for the response. Typically, in the code I have, if there is an error in the GPIB communication, I retry the GPIB Read/Write. However, I should have made it clear in the posted VIs that this is not exactly the code I have. If there is an error in VISA read/write, I actually reset the error before retrying. So the output of the CSA Get Resource in my application will never be null. However, I will double check this. But thanks for the advice.
Also, I have noticed in all the responses I have received, I have been asked about using globals. Maybe, I should rethink the way I have done some things.
Thanks
0 Kudos
Message 13 of 14
(790 Views)
Hi
I again got the error. At this point, I tried a couple of things. Without closing my application:
1. I opened up MAX and typed in the Query that gave me the VISA Read Error in the LabVIEW application. MAX returned me the correct value for the query.

2. I opened up a New VI, and in a sequence structure did the following:
Frame 0 tktds7k Initialize.vi - Hard coded GPIB0::1::INSTR
Frame 1 VISA Write (with my query) - Hard coded GPIB0::1::INSTR
Frame 2 Wait for 2 seconds
Frame 3 VISA Read - - Hard coded GPIB0::1::INSTR
This gave me the invalid resource error

3. I then modified this VI, and added
Frame 0 tktds7k Close.vi - Hard coded GPIB0::1::INSTR
Everything else the same; so:
Frame 1 tktds7k Initialize.vi - Hard coded GPIB0::1::INSTR
Frame 2 VISA Write (with my query) - Hard coded GPIB0::1::INSTR
Frame 3 Wait for 2 seconds
Frame 4 VISA Read - - Hard coded GPIB0::1::INSTR

This gave me an error on the tktds7k Close.vi, but I hit on the option to Continue and the VISA read was a success. I got the correct value for the query. I am not sure if this exercise meant something, (at least I dint quite understand whats going on), but if any of you do, I sure would appreciate the input.
0 Kudos
Message 14 of 14
(780 Views)