Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'''
Opens the ASRL connection using vpp43
baud=115200, databits=8, stop=one, parity=odd, no end char for reads
Input:
None
Output:
None
'''
logging.debug('Opening serial connection')
self._session = vpp43.open_default_resource_manager()
self._vi = vpp43.open(self._session, self._address)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_BAUD, 115200)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_DATA_BITS, 8)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_STOP_BITS,
vpp43.VI_ASRL_STOP_ONE)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_PARITY,
vpp43.VI_ASRL_PAR_ODD)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_END_IN,
vpp43.VI_ASRL_END_NONE)
None
Output:
None
'''
logging.debug('Opening serial connection')
self._session = vpp43.open_default_resource_manager()
self._vi = vpp43.open(self._session, self._address)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_BAUD, 115200)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_DATA_BITS, 8)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_STOP_BITS,
vpp43.VI_ASRL_STOP_ONE)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_PARITY,
vpp43.VI_ASRL_PAR_ODD)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_END_IN,
vpp43.VI_ASRL_END_NONE)
Input:
None
Output:
None
'''
logging.debug('Opening serial connection')
self._session = vpp43.open_default_resource_manager()
self._vi = vpp43.open(self._session, self._address)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_BAUD, 115200)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_DATA_BITS, 8)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_STOP_BITS,
vpp43.VI_ASRL_STOP_ONE)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_PARITY,
vpp43.VI_ASRL_PAR_ODD)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_END_IN,
vpp43.VI_ASRL_END_NONE)
Input:
None
Output:
None
'''
logging.debug(__name__ + ' : opening connection')
self._session = vpp43.open_default_resource_manager()
self._vi = vpp43.open(self._session, self._address)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_BAUD, 19200)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_DATA_BITS, 8)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_STOP_BITS,
vpp43.VI_ASRL_STOP_ONE)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_PARITY,
vpp43.VI_ASRL_PAR_EVEN)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_END_IN,
vpp43.VI_ASRL_END_NONE)
Opens the ASRL connection using vpp43
baud=19200, databits=8, stop=one, parity=even, no end char for reads
Input:
None
Output:
None
'''
logging.debug(__name__ + ' : opening connection')
self._session = vpp43.open_default_resource_manager()
self._vi = vpp43.open(self._session, self._address)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_BAUD, 19200)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_DATA_BITS, 8)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_STOP_BITS,
vpp43.VI_ASRL_STOP_ONE)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_PARITY,
vpp43.VI_ASRL_PAR_EVEN)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_END_IN,
vpp43.VI_ASRL_END_NONE)
None
Output:
None
'''
logging.debug(__name__ + ' : opening connection')
self._session = vpp43.open_default_resource_manager()
self._vi = vpp43.open(self._session, self._address)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_BAUD, 19200)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_DATA_BITS, 8)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_STOP_BITS,
vpp43.VI_ASRL_STOP_ONE)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_PARITY,
vpp43.VI_ASRL_PAR_EVEN)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_END_IN,
vpp43.VI_ASRL_END_NONE)
def _open_serial_connection(self):
'''
Opens the ASRL connection using vpp43
baud=115200, databits=8, stop=one, parity=odd, no end char for reads
Input:
None
Output:
None
'''
logging.debug('Opening serial connection')
self._session = vpp43.open_default_resource_manager()
self._vi = vpp43.open(self._session, self._address)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_BAUD, 115200)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_DATA_BITS, 8)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_STOP_BITS,
vpp43.VI_ASRL_STOP_ONE)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_PARITY,
vpp43.VI_ASRL_PAR_ODD)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_END_IN,
vpp43.VI_ASRL_END_NONE)
def _open_serial_connection(self):
'''
Opens the ASRL connection using vpp43
baud=19200, databits=8, stop=one, parity=even, no end char for reads
Input:
None
Output:
None
'''
logging.debug(__name__ + ' : opening connection')
self._session = vpp43.open_default_resource_manager()
self._vi = vpp43.open(self._session, self._address)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_BAUD, 19200)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_DATA_BITS, 8)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_STOP_BITS,
vpp43.VI_ASRL_STOP_ONE)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_PARITY,
vpp43.VI_ASRL_PAR_EVEN)
vpp43.set_attribute(self._vi, vpp43.VI_ATTR_ASRL_END_IN,
vpp43.VI_ASRL_END_NONE)
Opens the ASRL connection using vpp43
baud=9600, databits=8, stop=one, parity=none, no end char for reads
Input:
None
Output:
None
'''
logging.debug(__name__ + ' : Opening serial connection')
self._visa = visa.SerialInstrument(self._address,
baud_rate=9600, data_bits=8, stop_bits=1,
parity=visa.no_parity, term_chars="",
send_end=False, chunk_size=8)
vpp43.set_attribute(self._visa.vi, vpp43.VI_ATTR_ASRL_END_IN,
vpp43.VI_ASRL_END_NONE)