pyVisa termination characters

204 views
Skip to first unread message

Arnaud Descourvieres

unread,
Nov 3, 2016, 11:08:56 AM11/3/16
to python-ivi
Hi,

I am attempting to get a basic communication with a Chroma power supply (62012P-40-120) using pyVisa as backend.
My issue is that it does not send termination characters and I did not find out how I could set the pyVisa termination characters ('\r\n')with python-IVI.

Here is the code I am using:
import pyvisa
pyvisa
.log_to_screen()

import ivi
from chroma_62000P import *

import time

   
ivi
.set_prefer_pyvisa(True)

dcps
= ivi.chroma.chroma62012p40120("USB0::0x1698::0x0837::009000000571::INSTR", id_query = True, reset = True)

chan
= 0

dcps
.outputs[chan].enabled = False
dcps
.outputs[chan].voltage_level = 24.0
dcps
.outputs[chan].current_limit = 5.0

# Enable output
dcps
.outputs[chan].enabled = True
time
.sleep(2)

# Turn off output
dcps
.outputs[chan].enabled = False

dcps
.close()

Here is some pyVisa debug outputs:
2016-11-03 15:37:47,374 - pyvisa - DEBUG - viWrite(74591104, b'*CLS', 4, 'c_ulong(4)') -> 0
2016-11-03 15:37:47,427 - pyvisa - DEBUG - viWrite(74591104, b'*IDN?', 5, 'c_ulong(5)') -> 0





Best regards
Arnaud

Ulrich Lukas

unread,
Mar 11, 2019, 6:17:08 PM3/11/19
to python-ivi
Hi,

this might also be interesting for this issue:

Added support for termination characters via device constructor e.g:

scope = ivi.rigol.rigolDS1054Z(
        "TCPIP0::169.254.11.120::5555::SOCKET",
        pyvisa_opts={"read_termination":"\n", "write_termination":"\n"},
        prefer_pyvisa=True)

See pull request at: https://github.com/python-ivi/python-ivi/issues/75
Reply all
Reply to author
Forward
0 new messages