LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA Read (-1073807339) while reading device id of equipment connected using serial interface

I am just sending a query and trying to read device id of all the equipments connected. Using the attached code, I can get device id's of all the equipments connected using GPIB and USB interfaces. I am having problem getting device id of a power supply which is connected using RS232 interface.

 

I am doing visa read and write operations. The only thing different in case of this power supply is it uses IVI drivers. I am not sure if I need to do it differently for these equipments.

 

http://zone.ni.com/devzone/cda/epd/p/id/540

 

I tried using this as well, but did not work.  

 

Thanks,

Nevil

 

 

0 Kudos
Message 1 of 8
(4,296 Views)

Hi nevil,

 

I would suggest trying to put a delay between your VISA Write and VISA Read. Often times the serial communication is not fast enough and can cause issues. For an example, check out the Basic Serial Write and Read shipping example. To get to this, go to Help»Find Examples and then browse to Hardware Input and Output»Serial»Basic Serial Write and Read.vi.

 

Hope this is helpful!

 

Aaron P

National Instruments

Applications Engineer

http://www.ni.com/support

0 Kudos
Message 2 of 8
(4,278 Views)

Greetings again!

 

I have a similar problem again, but this time getting device id from a USB equipment. I have a piece of code which gets device addresses of all USB equipments present and then later on I try to read the device ids using the address.

 

I tried introducing a delay between VISA write and read and also increased the timeout, but I am still getting the VISA Read (-1073807339). I can read the device id correctly in MAX.

 

I have attached the code and a screen capture of the code. Any feedback helps.

 

Thanks,

Nevil

Download All
0 Kudos
Message 3 of 8
(3,990 Views)

@nevil wrote:

Greetings again!

 

I have a similar problem again, but this time getting device id from a USB equipment. I have a piece of code which gets device addresses of all USB equipments present and then later on I try to read the device ids using the address.

 

I tried introducing a delay between VISA write and read and also increased the timeout, but I am still getting the VISA Read (-1073807339). I can read the device id correctly in MAX.

 

I have attached the code and a screen capture of the code. Any feedback helps.

 

Thanks,

Nevil


 

You are trying to read 1024 bytes on the VISA read.  Are you sure you are supposed to be getting that many?  If you aren't, then your VISA read is going to wait until the timeout expires and returns an error.

 

You should probably try to enable the termination character for your resource.  Then the VISA Read will stop once the termination character arrives.

 

0 Kudos
Message 4 of 8
(3,983 Views)

I did try adding termination characterwith my *IDN? command. *IDN?\r\n is what I wrote in.

I also tried reducing my read buffer size to lower values. The return count from MAX is 23. Still get the same error with Labview. I see the error during VISA read. The write generates no error.

 

Thanks,

Nevil

0 Kudos
Message 5 of 8
(3,951 Views)

I see what you did.  You entered \r\n as a slash r slash n.  Your constant is in normal display.  You need to set it to \ code display.  \r is the carriage return character (decimal 13), \n is the line feed character (decimal 10).

 

Since the device never received the termination characters for the command going out (CR-LF) it never returns the data.

0 Kudos
Message 6 of 8
(3,947 Views)

Pardon my ignorance. I am not sure what you mean by \code display.

 

It would help to know more about it.

 

Thanks,

Nevil

0 Kudos
Message 7 of 8
(3,938 Views)

Right click your string constant or control and you'll see the options.

 

As Ben would say "When in doubt right click"!

Now Using LabVIEW 2019SP1 and TestStand 2019
0 Kudos
Message 8 of 8
(3,930 Views)