LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

*IDN? works in VISA test panel but VI does not

I can test my instrument connection with the VISA test panel:

V1.PNG

 

But when I try this:

V2.png

 

I get this error:

V3.PNG

 

What could I possibly be doing wrong?

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 1 of 13
(7,432 Views)

Is this a RS232 or some other interface? Do not you need some sort of init before committing the IDN command with the VISA Write? Like VISA Open, or VISA Configure Serial Port?

0 Kudos
Message 2 of 13
(7,409 Views)

It's connected through ethernet and uses LXI so like a GPIB instrument it has not required a VISA open since about LabVEW 8 or so.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 13
(7,399 Views)

If you quick drop, is that the constant you get for end of line?  I get one with a down arrow and enter looking thing (By picture, I'd assume eol/cr, but it's named end of line)  If you use this one, does it work?

 

Have you tried looking at the output string in a // codes string indicator?

0 Kudos
Message 4 of 13
(7,396 Views)

@natasftw wrote:

If you quick drop, is that the constant you get for end of line?  I get one with a down arrow and enter looking thing (By picture, I'd assume eol/cr, but it's named end of line)  If you use this one, does it work?

 

Have you tried looking at the output string in a // codes string indicator?


Yes and this one (Line Feed) is the \n code just like the VISA test panel sends.

V4.PNG

 

If it was the wrong terminator I would expect a different error, probably a timeout.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 5 of 13
(7,393 Views)

True.  I missed the error.  If you open up any of the VISA examples, I'd expect to see the same error if we're looking at addressing.  Do you?

0 Kudos
Message 6 of 13
(7,384 Views)

I would try launching I/O Trace and compare the result from both cases. 

Ben64

Message 7 of 13
(7,378 Views)

Not sure of this but I think that if you're using the VXI-11 protocol you need to explicitly open the VISA connexion.

 

Ben64

0 Kudos
Message 8 of 13
(7,355 Views)

@ben64 wrote:

I would try launching I/O Trace and compare the result from both cases. 

Ben64

 


1.  viWrite (TCPIP0::LCRY0614N49625::... (0x028B4920), "*IDN?.", 6, 6)
Process ID: 0x000006FC         Thread ID: 0x00002330
Start Time: 07:28:13.514       Call Duration 00:00:00.002
Status: 0 (VI_SUCCESS)
Buffer Contents
00000000:  2A 49 44 4E 3F 0A                                *IDN?.

2.  viRead (TCPIP0::LCRY0614N49625::... (0x028B4920), "*IDN LECROY,WR44XI-A,...", 1024, 42)
Process ID: 0x000006FC         Thread ID: 0x00002330
Start Time: 07:28:13.571       Call Duration 00:00:00.001
Status: 0 (VI_SUCCESS)
Buffer Contents
00000000:  2A 49 44 4E 20 4C 45 43 52 4F 59 2C 57 52 34 34  *IDN LECROY,WR44
00000010:  58 49 2D 41 2C 4C 43 52 59 30 36 31 34 4E 34 39  XI-A,LCRY0614N49
00000020:  36 32 35 2C 36 2E 38 2E 30 0A                    625,6.8.0.

3.  viParseRsrc (0x12B19590, "TCPIP0::LCRY061...5::inst0::INSTR", 6, 0)
Process ID: 0x000022E0         Thread ID: 0x00001CF0
Start Time: 07:28:20.144       Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)

> 4.  VISA Write ("TCPIP0::LCRY061...5::inst0::INSTR", "*IDN?.")
> Process ID: 0x000022E0         Thread ID: 0x00001CF0
> Start Time: 07:28:20.160       Call Duration 00:00:00.006
> Status: 0xBFFF0011 (VI_ERROR_RSRC_NFOUND)
> Buffer Contents
> 00000000:  2A 49 44 4E 3F 0A                                *IDN?.

5.  VISA Close ("TCPIP0::LCRY061...5::inst0::INSTR")
Process ID: 0x000022E0         Thread ID: 0x00001C38
Start Time: 07:28:41.512       Call Duration 00:00:00.001
Status: 0 (VI_SUCCESS)

I can see a couple differences, the main one being the VISA test panel DOES NOT USE VISA?

1-viWrite and 2-viRead are the VISA test panel, 4-VISA Write my VI and that is where the error occurs. 

 

There is a couple subtle differences 

1.  viWrite (TCPIP0::LCRY0614N49625::... (0x028B4920), "*IDN?.", 6, 6)
3. viParseRsrc (0x12B19590, "TCPIP0::LCRY061...5::inst0::INSTR", 6, 0)

4. VISA Write ("TCPIP0::LCRY061...5::inst0::INSTR", "*IDN?.")

 

I still don't know what to make of this.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 9 of 13
(7,324 Views)

Have you tried using VISA Open before the VISA Write?

 

Ben64

0 Kudos
Message 10 of 13
(7,315 Views)