Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

communication with Prologix in LabWindows/CVI

I have an Agilent 33220A connected to a PC using the prologix usb controller. I can talk to the instrument using Hyperterminal on com port 3. When I open Measurement and Automation, under ports the controller is seen as ASRL3::INSTR.
 
I have tried to use the control test panel to send *IDN?\n in viWrite and query it using viRead and I get a 0xBFFF0015 error. I also just tried to send *TST? and there is no action on the instrument.
 
I also tried using the RS232 write function for COM3 and still cannot talk to the instrument.
 
Is the format of the commands the problem or is there another interface I need to use? 
0 Kudos
Message 1 of 7
(6,407 Views)
Hi Brdman,

Could you please perform an NI-Spy capture and upload the capture log file here? This would make it easier to troubleshoot. There are very good instructions on how you can do that here.
Rasheel
0 Kudos
Message 2 of 7
(6,391 Views)

Sorry for the delay. Here is the data from NiSpy

1.  viOpenDefaultRM (0x00DE4E20)
Process ID: 0x000001D4         Thread ID: 0x0000035C
Start Time: 09:23:35.781       Call Duration: 00:00:00.078
Status: 0 (VI_SUCCESS)

2.  viOpen (0x00DE4E20, "ASRL3::INSTR", 4, 0, 0x00DF7E48)
Process ID: 0x000001D4         Thread ID: 0x0000035C
Start Time: 09:23:36.171       Call Duration: 00:00:00.125
Status: 0 (VI_SUCCESS)

3.  viGetAttribute (0x00DF7E48, INTF_TYPE, 4)
Process ID: 0x000001D4         Thread ID: 0x0000035C
Start Time: 09:23:36.296       Call Duration: 00:00:00.000
Status: 0 (VI_SUCCESS)

4.  viGetAttribute (0x00DF7E48, RSRC_NAME, "ASRL3::INSTR")
Process ID: 0x000001D4         Thread ID: 0x0000035C
Start Time: 09:23:36.296       Call Duration: 00:00:00.000
Status: 0 (VI_SUCCESS)

5.  viWrite (0x00DF7E48, "*IDN?.", 6, 6)
Process ID: 0x000001D4         Thread ID: 0x0000035C
Start Time: 09:23:41.406       Call Duration: 00:00:00.015
Status: 0 (VI_SUCCESS)

> 6.  viRead (0x00DF7E48, 0x00DF9E08, 1024, 0)
> Process ID: 0x000001D4         Thread ID: 0x0000035C
> Start Time: 09:23:44.375       Call Duration: 00:00:02.000
> Status: 0xBFFF0015 (VI_ERROR_TMO)

 

 

0 Kudos
Message 3 of 7
(6,357 Views)
Hi Brdman,

Could you  please upload the .spy file itself? This will make it easier for me to track down what's going on. Thanks!
Rasheel
0 Kudos
Message 4 of 7
(6,344 Views)
Here is the SPY file.
0 Kudos
Message 5 of 7
(6,339 Views)
There is thread where someone is using the same controller with LabVIEW and an example program from Prologix appends a CR/LF to each command. You are appending only a LF.
0 Kudos
Message 6 of 7
(6,334 Views)

Thanks Dennis for the input. I was able to get a 34401 DMM to communicate. I am not real familiar with using VI commands but was able to get it working by using the following commands

viOpenDefaultRM (&dmm);

viOpen (dmm, "ASRL3::INSTR", VI_NULL, VI_NULL, &dmm22);

viWrite (dmm22, "++addr22\r\n", 10, ct); //assign prologix address to instrument

viWrite (dmm22, "*IDN?\r\n", 7, ct); //query instrument

viRead (dmm22, read, 100, ct); //read back query

viWrite (dmm22, "*TST?\r\n", 7, ct); //selftest instrument

 

Message 7 of 7
(6,255 Views)