Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't Talk with Omega CN7200 Temperature Controller

I have an Omega CN7200 PID temperature controller that I’m trying to talk with using VBA code and NI-VISA. The CN7200 has a RS-485 bus, but I bought a 485-to-USB converter from Omega. As a test, I loaded Omega’s SW and the 485-to-USB driver, and I can read and write the CN7200 registers just fine.

 

There is no NI-VISA driver specifically for the CN7200. There is one for the CN7500, so I downloaded the NI-VISA driver for this. Since the CN7200 and CN7500 use the same Omega user’s manual, I’m hoping this driver will work. However, while the NI-Max sees the 485-to-USB converter on COM6, when I do a IDN query I get this message: “Read Operation Error.  VISA:  (Hex 0xBFFF0015) Timeout expired before operation completed.” Another window says “Return Count: 6 bytes”. So it seems like data is being read but not recognized.

 

Any ideas on how to troubleshoot this? (I’ve tried changing the NI-Max baud/data bits/stop bits/term character, but nothing seems to help. I also extended the time out to 2000ms.)

0 Kudos
Message 1 of 11
(6,126 Views)
Why are you sending an IDN query? It's not in the manual, is it? The query is defined by IEEE-488.2 and you don't have a device compliant with that. Since you can read and write to the registers, it doesn't seem like you have any problem.
0 Kudos
Message 2 of 11
(6,121 Views)

I can only read and write the registers when using Omega's non NI-VISA software and menus. When using NI-Max or VBA code (with NI-VISA running) I always get read errors.

 

I'm trying to read the IDN just as a basic test to see if reads are possible. From my experience with other instruments, if you can read the IDN then you can read the other registers too.

0 Kudos
Message 3 of 11
(6,118 Views)
It's silly to try the idn query. As I said, it's only supported by very specific types of instruments. I don't know if there is a modus library for VB but I would suggest a serial port sniffer such as portmon from Microsoft to see the actual commands being sent. What happens when you run this driver that you downloaded?
0 Kudos
Message 4 of 11
(6,110 Views)

Using NI Max I tried to read some registers other than the IDN value, and I get the same timeout error.

 

"What happens when you run this driver that you downloaded?"

 

When I use Ni Max to query a register, I assume that it is using the downloaded driver. So when I use it I get the timeout error.

 

Simillarly, when I try to do a VBA instrument read of a register I get an exccution error at the read line in the code. Again I assume the NI-VISA driver is in use.

 

I keep thinking that there is some small configuration problem. For example, I noticed in the Max attributes that the term char should be 0xA. But when I changed to this, still no luck.

 

I'll look in to a port sniffer.

0 Kudos
Message 5 of 11
(6,095 Views)
MAX is a standalone utility and does not use any driver that you might have downloaded. It only uses VISA and it up to you to provide the correct commands in the correct format. You need to specify exactly what you are going into the command string in MAX.
0 Kudos
Message 6 of 11
(6,090 Views)

Okay, I see now that MAX is a standalone utility that does not use any driver. So I guess even if I find a configuration within MAX that works, there is not guarantee that when using VBA code and the NI-VISA driver that the VBA code can communicate with the Omega instrument. For VBA code there seems to be little to do configuration-wise since the code relies on the driver to work. It seems like it will simply work or not work. Is that true?

 

I know from MAX that the device is seen at ASRL6::INSTR. The VBA code below follows the conventions normally used for communicating with an instrument, but I simply get read errors at each read attempt whether for the IDN or the 1000H instrument-specific read command (to read the temperature). I don't know what else to try.

 

Set ioMgr = New VisaComLib.ResourceManager

Set instrument = New VisaComLib.FormattedIO488

Set instrument.IO = ioMgr.Open("ASRL6::INSTR")

 

instrument.WriteString "*IDN?"

idn = instrument.ReadString()

ActiveSheet.Cells(1, 1) = idn

 

instrument.WriteString "1000H"

Meter_Read_Group = instrument.ReadString()

ActiveSheet.Cells(7, 1) = Meter_Read_Group

0 Kudos
Message 7 of 11
(6,065 Views)
Why do you continue to send idn query. You haven't read the manual! You also have to send data as hex.

What is this driver you have been talking about? Where did it come from?
0 Kudos
Message 8 of 11
(6,058 Views)

Virtually every reference on the web for writing VBA code shows reading the IDN as one thing to check. I also do that with all of  the other instruments I am using and it works fine. Also, as shown in the code example I sent I was also checking a specific command code and it did not work either.

 

I don't like your tone, so I'd like to end this disucssion here.

0 Kudos
Message 9 of 11
(6,054 Views)
Since you are intent on just making things up as you go instead of understanding basic instrument communication, my time is just wasted. My tone reflects your lack of knowledge and refusal to listen.
0 Kudos
Message 10 of 11
(6,051 Views)