Digital Multimeters (DMMs) and Precision DC Sources

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA write-ok, read-error

I am trying to make an interface for a digital multimeter
The communication is simple, you have to send a char and the multimeter should send the data.
I know that the data is succesfully sent because the multimeter shows that he is sending the data.
I am useing the serial port with VISA.
The problem is that i get a read error "I/O error"

What should I do?
0 Kudos
Message 1 of 9
(9,703 Views)
Hello,

Have made sure to specify the same resource for the read? If you are able to open and write correctly, you should really only receive a "communication" error of some kind, such as a timeout error if you don't receive as many bytes as you expect, or a parity error if you receive different parity than expected, or framing error if you specify a different baud rate than the data was sent with. In any event, repost with your development environment (LabVIEW, C++, etc.), and if you can post a small, simple piece of code which gives you the error (and perhaps a screenshot of the error as well) I can make sure there's nothing theoretically wrong. I have also attached a screenshot of C and LabVIEW example code which implement a loopback test (writing to and reading from the same port by connecting pins 2 and 3, and running a program such as shown).

I look forward to your repost!

Best Regards,

JLS
Best,
JLS
Sixclear
0 Kudos
Message 2 of 9
(9,693 Views)
I have already triyed to do a loopback test and it worked just fine. The multimeter is not in my posesion so i can't send you yet a picture with the error but i will. Thanks.
0 Kudos
Message 3 of 9
(9,685 Views)
Hello,

Great, I look forward to your repost. However, in the mean time you may want to look into any potential issues with that multimeter; if the loopback test worked then you have verified that both your serial hardware is functional, and that VISA is able to access it and communicate with it successfully!

Thank you,

Best Regards,

JLS
Best,
JLS
Sixclear
0 Kudos
Message 4 of 9
(9,665 Views)
I finaly managed to get to the multimeter. I have atached a picture of the error dialogbox with the error code, if this can help you to help me.
0 Kudos
Message 5 of 9
(9,642 Views)
I finaly managed to get to the multimeter. I have atached a picture of the error dialogbox with the error code, if this can help you to help me.
0 Kudos
Message 6 of 9
(9,638 Views)
Hello,

I am not sure of what is causing the error. We know the serial port and NI-VISA are operating correctly because you can perform a loopback test successfully. Is it possible that the cable you are using or the instrument does not have the appropriate pin out? Could you post an NI-Spy capture; I'd like to see the commands leading up to the read operation. I would expect that if you are able to successfully open and write to the serial port, that if you received an error it would be a parity error, framing error (different baud rates), or a timeout error. This way I can see exactly what VISA calls are being made up to the error; you can launch NI-SPy from Start -> Programs -> National Instruments -> NI-Spy. Here are instructions in case you haven't used it before:

http://digital.ni.com/public.nsf/websearch/8D890EC09B15C05A86256E6F007E3E86?OpenDocument

You can also attempt to use the VISA Interactive Control (VISAIC) from Start -> Programs -> National Instruments -> VISA -> VISA Interactive Control, however, these calls should generally be the same VISA calls as from your development environment. I would definitely try communicating through VISAIC since this will allow you to execute and see results leading up in a step by step fashion. When you launch it you'll want to double click your serial resource and then the Basic I/O tab (if you see these tabs... usually light blue), and then use the write and read sub-tabs. As a final general suggestion, can you verify the command you are writing to the instrument in the user manual, and then try writing it using VISAIC. More specifically, does your instrument understand the command "*idn?" and reply with a description of itself? This would be a good place to start with VISAIC to ensure you have established successful communication. Your instrument may require a termination character (such as a carriage return or linefeed) in order to accept commands; in VISAIC you would use the "slash code" to indicate such characters, for example, sending *idn? with a linefeed termination character you would type (without quotes) "*idn?\n"... or for a carriage return you would use \r in place of \n.

Let's take a look at the NI-Spy capture, and if you can confirm the step-by-step success of some commands in VISAIC, I think we'll be able to figure out where things are going wrong!

Thanks and looking forward to hearing back!

Best Regards,

JLS
Best,
JLS
Sixclear
0 Kudos
Message 7 of 9
(9,624 Views)
Hi, I finaly managed to find what the problem was. It was a timing problem, the multimeter needed some time to process the command and send the requested data.
Thank you werry much for your help

LoWpY
0 Kudos
Message 8 of 9
(9,611 Views)
Great!

Definitely repost if you have any other troubles!

Thanks for the update!

JLS
Best,
JLS
Sixclear
0 Kudos
Message 9 of 9
(9,593 Views)