Menu

#4 VI_ATTR_ASRL_END_OUT

open
nobody
5
2012-01-31
2012-01-31
Larry C
No

Have you had any requests for interface methods to VI_ATTR_ASRL_END_OUT ?
self.serial_end_out = keyw.get("serial_end_out", serial_end_output)
__get_end_output()
__set_end_output() indicates the method used to terminate read operations

I wanted to read the current value and didn't see a direct method for accomplishing that.
I hacked in my own patch in SerialInstrument() and it worked; but I'm curious about what other folks think of this idea.
Thanks; Larry

Discussion

  • Florian Bauer

    Florian Bauer - 2012-04-22

    Hi Larry,

    I recently took over PyVISA maintenance. If you have something working already, I'm glad to incorporate it into one of the next releases.
    Can you provide a patch and a bit more info on what it accomplishes? Personally I'm not familiar with visa over serial.

    Thanks,
    Florian

     
  • Larry C

    Larry C - 2012-04-23

    Hack from January, for serial_end_out

     
  • Larry C

    Larry C - 2012-04-23

    Florian, I got your reply ... it has been a while since I looked at this, so I just uploaded what I have from January.

    This is a unified diff versus the original visa.py file from package version 1.3.
    Will upload it as well.

    --- visa.py 2008-03-26 13:52:28.000000000 -0700
    +++ visa_modified.py 2012-01-30 13:58:16.000000000 -0800
    @@ -643,6 +643,7 @@
    no_end_input = VI_ASRL_END_NONE
    last_bit_end_input = VI_ASRL_END_LAST_BIT
    term_chars_end_input = VI_ASRL_END_TERMCHAR
    +serial_end_output = VI_ATTR_ASRL_END_OUT

    # The following aliases are used for the "parity" property
    no_parity = VI_ASRL_PAR_NONE
    @@ -672,7 +673,7 @@
    _warn_for_invalid_keyword_arguments(keyw,
    ("timeout", "term_chars", "chunk_size", "lock",
    "delay", "send_end", "values_format",
    - "baud_rate", "data_bits", "end_input", "parity", "stop_bits"))
    + "baud_rate", "data_bits", "end_input", "serial_end_out", "parity", "stop_bits"))
    keyw.setdefault("term_chars", CR)
    Instrument.__init__(self, resource_name,
    **_filter_keyword_arguments(keyw,
    @@ -686,6 +687,7 @@
    self.stop_bits = keyw.get("stop_bits", 1)
    self.parity = keyw.get("parity", no_parity)
    self.end_input = keyw.get("end_input", term_chars_end_input)
    +## self.serial_end_out = keyw.get("serial_end_out", serial_end_output)
    def __get_baud_rate(self):
    return vpp43.get_attribute(self.vi, VI_ATTR_ASRL_BAUD)
    def __set_baud_rate(self, rate):
    @@ -730,6 +732,13 @@
    end_input = property(__get_end_input, __set_end_input, None,
    """indicates the method used to terminate read operations""")

    + def __get_end_output(self):
    + return vpp43.get_attribute(self.vi, VI_ATTR_ASRL_END_OUT)
    + def __set_end_output(self, serial_end_out):
    + vpp43.set_attribute(self.vi, VI_ATTR_ASRL_END_OUT, serial_end_out)
    + serial_end_out = property(__get_end_output, __set_end_output, None,
    + """indicates the method used to terminate serial write operations""")
    +

    class Interface(ResourceTemplate):
    """Base class for GPIB interfaces.

     
  • Larry C

    Larry C - 2012-04-23
     

Log in to post a comment.

MongoDB Logo MongoDB