From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to detect end of string from serial to GPIB converter

Hi
 
We are using the GPIB-USB-B to control a Vötsch 4002 temperature chamber. Since the temp chamber doesn't have a GPIB interface we have to use a GPIB to Serial converter to control it. We don't have any problems sending instructions to the temp chamber but when trying to receive from it it we get the error EARG(4). We think that this is due to not having the correct eoi and eos. This is our visual basic programming code:
 
Sub InitTempChamber()
    Dim ud As Integer
    Address = 12
    ud = ildev(0, Address, 0, T30s, 1, &H140A)
    Call ibfind("GPIB0", 0)   
End sub
 
Sub SetTemperature(Temp As Double)
    Dim Buff As String
    Call VBIB32.send(0, Address, "$" + CStr(Address) + "E " + CStr(Temp) + " 0000.0 0000.0 0000.0 0000.0 0101111110000000" + Chr$(13), NLend)
    Call VBIB32.receive(0, Address, Buff, 1)
End sub
 
GPIB port settings for the GPIB to Serial converter (Iotech serial 488A)
Terminator:  LF only
EOI: Enabled
Mode: Peripheral
Address: 12
SRQ: Disabled 
 
Question:
How to set line feed as the terminating character in eos and eoi.
 
/Anders
0 Kudos
Message 1 of 2
(2,816 Views)

Hey Anders,

I first would ask you why you don't just use a direct serial cable from your PC to the instrument rather than converting it to GPIB first.  That always adds a lot of complication that is sometimes unnecessary.

As far as sending EOS characters and setting the EOI line, see the NI-488.2 help for the Send() command.  The NLend constant will append '\n' and set EOI.

Scott B.
GPIB Software
National Instruments

0 Kudos
Message 2 of 2
(2,799 Views)