Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Intrument Gives error when Labview VI is loaded

I have a minor issue with one of my instruments that i control with labview. I can control it via Serial or GPIB control. When i load up my vi for the first time and my instrument is set to GPIB address 1 there is a slight delay loading up the program and I get an error light on my instrument. This means some info is being sent on the GPIB bus. After the slight delay the program finishes loading and the error light goes off telling me something else was sent to my instrument. This error occurs ONLY when my instrument is set to address 1. Any other address and everything works as expected. To combat this error in my vi i just send a *cls to clear everthing before i write again because the error seems
to send something that will mess up my first sent command. I ran NI spy to see what is happening when i load my VI's.

This is what NI SPY shows labview is doing on the GPIB card when i load up my VIs

1. viOpenDefaultRM (0x00154348)
2. viGetAttribute (0x00154348, 0x3fff018f, VI_TRUE)
3 viGetAttribute (0x00154348, 0x3fff0190,2 (0x0))
4 viSetAttribute (0x00154348, 0x3fff0190,2 (0x0))
5 viFindRsrc (0x00154348, "?*INSTR", 0x00157108,3 (0x3), "COM1")
6 viFindnext (0x00157108, "LPT1")
7 viFindNext (0x00157108, "GPIB0::1::INSTR")
8 viClose (0x00157108)
9 viSetAttribute (0x00154348, 0x3FF0190,0 (0x0)

Step 5 is where i get the error and labview hangs for a second. After it passes my error light goes off and it will continue to load. This issue only occurs when i have my instrument set to GPIB address 1. There seems to be some kind of conflict that occurs. Could it possibly be the software used in the instrument?
0 Kudos
Message 1 of 3
(3,184 Views)
The viFindRsrc VISA call finds all VISA resources connected to your computer. Line five is where LabVIEW polls the Serial Port, not your instrument, so I'm not sure why you would get an error there.

Since the error only occurs when your device is at PAD 1, I'd suggest checking for address conflicts. Is your GPIB0 device at address 1? Do you have any other devices connected to you system?

Also, what are all of the getAttribute and setAttribute commands? I don't get those when I run VISA Resources VI.

I hope this helps!
0 Kudos
Message 2 of 3
(3,184 Views)
Hi. Thanks for you help. I have someone looking at the assembly language code that is used in the equipment itself. It seems that there are some problems with that which may be connected with the problem i am having. We still do not know why it only happens with channel 1 though. But My GPIB card is address 0 and this is the only instrument on the bus to answer your questions.
0 Kudos
Message 3 of 3
(3,184 Views)