Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How to change term character and not send EOI in VISA for GPIB communications

I am trying to communicate with an instrument through GPIB using the VISA functions (VISA write and VISA read).

I need to be able to use the VISA commands as a setup file can change the communication mode to serial RS232, so all my communications are handled by VISA.

 

The problem is that this instrument requires a <CR> "\r" and NO EOI at the end of each write. I cannot find the way to change the settings in VISA to do this automatically.(The instrument replies with a <CR> and no EOI).

 

Please see the attached 2 programs which open communications, set up the instrument preferences, then send the command "V" and read the response, then close VISA.

The first one uses the GPIB write function and successfully reads back the response (using VISA read). - So I assume the instrument is fine, the cable is fine and it is simply a software problem.

The second one tries to use the VISA write function, but doesn't work. I think this is because the VISA write is not properly configured to send the correct end of string termination.

 

How do I setup the VISA to append a <CR> and leave off the EOI at each Write function?

 

Many thanks,

Nick

Download All
0 Kudos
Message 1 of 8
(6,722 Views)

To prevent the EOI being sent on viWrite you need to set the Visa attribute, VI_ATTR_SEND_END_EN, to false.

Th append the CR to your commands/data going out, it is up to you to add the \r to the string Visa won't do this for you except for serial.

 

0 Kudos
Message 2 of 8
(6,711 Views)

Thanks for your response. I've tried implementing your suggestion by changing the "Send End Enable" setting on the VISA Instr setting and adding the "\r" to the string, without any luck.

There must still be some fundamental difference between the VISA write and the GPIB write.

 

On the other point. It's really frustrating that the strings to send to a VISA write function are not the same for GPIB and RS232 serial. I don't know in advance which mode of communication is going to be used. So now everytime I used VISA write, I will need another function which checks the communication modality and adds the "\r" character if it is in GPIB mode.

 

 

 

 

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

What is the error you are seeing with the Visa write using GPIB?

Generally the GPIB just works correctly without having to tweak any GPIB controller settings. It is the RS232 that is always a pain. I bet it supports EOI and CR and you really only need EOI on for the GPIB. We add the <cr> because RS232 requires it and it also just works with the GPIB.

What instrument is this?

0 Kudos
Message 4 of 8
(6,699 Views)

There is no fundamental difference between a VISA Write and a GPIB Write. A VISA Write actually uses a GPIB Write. VISA is just a high level api above the actual hardware functions. You can configure the GPIB controller in MAX to suppress the EOI.

 

Attach the program instead of those gifs. Just to make sure you have the string controls set for '\' Codes Display.

 

Your serial connection will also require the same CR, won't it?

0 Kudos
Message 5 of 8
(6,697 Views)

Instrument is an IPS120-10 power supply from Oxford Instruments:

There's an instruction manual online at (see page 32)

http://hallaweb.jlab.org/tech/Detectors/public_html/detectors_daq/moller/IPS120-10_Superconducting_M...

 

I understand it doesn't like the EOI character as this works on the GPIB write command when you send "4 - Append CR to the string but do not send EOI."

 

To answer your question, I don't actually see an error on calling the Write function. It's just that I never receive a response from the Read function. I agree that generally GPIB works much eaiser than serial, but this instrument is the exception that proves the rule!!

 

p.s. there is another way to communicate with this instrument through the Measurement and Automation program from NI.

Go in there, find the instrument and click "Interactive Control"

Then type the following:

ibdev (Enter, followed by 0, 25, 0, 13, 0, 0x140D)

ibwrt "V\r"

ibrd 80

These settings work to get the power supply to respond. Somewhere in the 0x140D are the required termination to the writes.

 

 

 

0 Kudos
Message 6 of 8
(6,694 Views)

Thanks cymrieg and Dennis for your combined tips. I didn't have the Codes Display correctly set and also needed the "Set End En = False".

It now works.

 

Nick

0 Kudos
Message 7 of 8
(6,690 Views)

See the attached program for reference...

0 Kudos
Message 8 of 8
(6,684 Views)