Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Devices work in MAX, not with VISA calls

Hello,

 

I'm currently attempting to control a pair of CSW5550 power supplies and having all sorts of problems.

 

On LAN, I have installed the devices as a TCPIP device to send SCPI commands to, as here:

 

LANsetup.png

 

Everything works great from the MAX window. I can send most queries with no problems, in particular the *IDN? query.

 

When I pop over to running a vi on the same VISA resource, however, I get very inconsistent results. Sometimes a read error, sometimes a write error, and sometimes I get a reading. Most often no error, but an error from the device and no data returned. Same thing for trying to perform other read operations, and it's clear from the response of the device (often 'invalid parameter', others) that the instrument is getting somewhat garbled commands.

 

The same thing goes if I try to run it over serial USB. This is what I'm running in the vis:

 

readvi.png

 

readvis.png

 

I mean, this is really basic stuff. I've tried varying the timing, newline termination, setting up and flushing the buffer.

 

So ... what is the difference between the queries MAX is executing and what I'm doing, and how can I troubleshoot it?

Thanks in advance,

C

PhD ChemE, CLD, Alliance Partner : www.interfaceinnovations.org
0 Kudos
Message 1 of 8
(6,095 Views)

You have errors in NI-MAX, and it still works?

0 Kudos
Message 2 of 8
(6,069 Views)
The devices are not connected in this picture. When connected, they validate and accept test panel commands fine.
PhD ChemE, CLD, Alliance Partner : www.interfaceinnovations.org
0 Kudos
Message 3 of 8
(6,054 Views)

Some linefeeds and timeouts fixed this.


C

PhD ChemE, CLD, Alliance Partner : www.interfaceinnovations.org
0 Kudos
Message 4 of 8
(5,988 Views)

Can you be more specific in your solution? I am running into a similar problem connecting a Keithley PS.  MAX calls work, vi calls do not.

 

Thanks!

0 Kudos
Message 5 of 8
(4,305 Views)

@mbrue101 wrote:

Can you be more specific in your solution? I am running into a similar problem connecting a Keithley PS.  MAX calls work, vi calls do not.


Many instruments want to see a Carriage Return and/or a Line Feed to know when the message is complete.  You may have to add these to your writes.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 8
(4,301 Views)

You are referring to \r and \n? in the order specified by the device manual?  That doesnt resolve.  Same Timeout error on read with no data returned even reading 1byte at a time and concatenating (in a while loop until byte= 0xA).  It is occuring on the first read cycle.

0 Kudos
Message 7 of 8
(4,294 Views)

Then I recommend you start a new thread and give a lot more information on your setup (what hardware are you using, your code, etc).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 8
(4,286 Views)