03-26-2010 07:36 PM
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
03-29-2010 11:23 AM
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
03-11-2011 02:30 PM
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
03-11-2011 10:45 PM
@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 equipment
spresent 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.
03-16-2011 02:45 PM
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
03-16-2011 03:08 PM
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.
03-16-2011 04:46 PM
Pardon my ignorance. I am not sure what you mean by \code display.
It would help to know more about it.
Thanks,
Nevil
03-16-2011 05:02 PM
Right click your string constant or control and you'll see the options.
As Ben would say "When in doubt right click"!