GXCOM class¶
-
class
GXCOM
(handle=0)¶ GXCOM class.
This class is used to communicate with external serial devices. It allows the setting of timeouts.
-
classmethod
create
(port, baud, data_size, parity, stop_bits, flow_control, time_out)¶ Create
GXCOM
object.Parameters: - port (str) – Port name to open (“COM1” is example)
- baud (int) – COM_BAUD constants
- data_size (int) – COM_DATASIZE constants
- parity (int) – COM_PARITY constants
- stop_bits (int) – COM_STOPBITS constants
- flow_control (int) – COM_FLOWCONTROL constants
- time_out (int) – Timeout in Ms (500)
Returns: GXCOM
ObjectReturn type: New in version 5.0.
License: Geosoft End-User License
-
classmethod
create_no_terminate
(port, baud, data_size, parity, stop_bits, flow_control, time_out)¶ Create
GXCOM
object.Parameters: - port (str) – Port name to open (“COM1” is example)
- baud (int) – COM_BAUD constants
- data_size (int) – COM_DATASIZE constants
- parity (int) – COM_PARITY constants
- stop_bits (int) – COM_STOPBITS constants
- flow_control (int) – COM_FLOWCONTROL constants
- time_out (int) – Timeout in Ms (500)
Returns: GXCOM
ObjectReturn type: New in version 6.0.
License: Geosoft End-User License
-
is_null
()¶ Check if this is a null (undefined) instance
Returns: True if this is a null (undefined) instance, False otherwise. Return type: bool
-
purge_comm
()¶ Purges the input and output buffers.
New in version 5.1.8.
License: Geosoft End-User License
-
read_chars
(line)¶ Reads characters from the
GXCOM
Parameters: line (str_ref) – String for characters New in version 5.0.
License: Geosoft End-User License
-
read_chars_no_terminate
(line)¶ Reads characters from the
GXCOM
, times out and does not terminateParameters: line (str_ref) – String for characters Returns: 0 - if successful 1 - if time out or error Return type: int New in version 6.0.1.
License: Geosoft End-User License
-
read_em61_lines_wa
(lines, wa)¶ Reads Lines from the
GXCOM
to aGXWA
: Geonics EM61 onlyParameters: - lines (int) – Number of lines
- wa (GXWA) – Where to put lines
New in version 5.0.
License: Geosoft End-User License
-
read_file2_wa
(wa)¶ Reads entire dataset from the
GXCOM
to aGXWA
Parameters: wa (GXWA) – Where to put lines New in version 5.0.
License: Geosoft End-User License
-
read_line
(line)¶ Reads a Line from the
GXCOM
Parameters: line (str_ref) – String for line New in version 5.0.
License: Geosoft End-User License
-
read_line_no_terminate
(line)¶ Reads a Line from the
GXCOM
Parameters: line (str_ref) – String for line Returns: 0 - if successful in reading a line 1 - if an error was encountered Return type: int New in version 6.0.1.
License: Geosoft End-User License
-
read_lines_wa
(lines, wa)¶ Reads Lines from the
GXCOM
to aGXWA
Parameters: - lines (int) – Number of lines
- wa (GXWA) – Where to put lines
New in version 5.0.
License: Geosoft End-User License
-
set_time_out
(time_out)¶ Set the timeout value.
Parameters: time_out (int) – Timeout in Ms (500) New in version 5.0.
License: Geosoft End-User License
-
write_chars
(line)¶ Writes characters to the
GXCOM
Parameters: line (str) – Line to write New in version 5.0.
License: Geosoft End-User License
-
write_chars_no_terminate
(line)¶ Writes characters to the
GXCOM
. Does not terminate upon errorParameters: line (str) – Line to write Returns: 0 - if successful in writing a string 1 - if time out or error was encountered Return type: int New in version 6.0.1.
License: Geosoft End-User License
-
write_line
(line)¶ Writes a Line to the
GXCOM
Parameters: line (str) – Line to write New in version 5.0.
License: Geosoft End-User License
-
classmethod
COM_BAUD constants¶
Connection Speed
-
COM_BAUD_110
¶ 110
-
gxapi.
COM_BAUD_110
= 0
-
-
COM_BAUD_300
¶ 300
-
gxapi.
COM_BAUD_300
= 1
-
-
COM_BAUD_600
¶ 600
-
gxapi.
COM_BAUD_600
= 2
-
-
COM_BAUD_1200
¶ 1200
-
gxapi.
COM_BAUD_1200
= 3
-
-
COM_BAUD_2400
¶ 2400
-
gxapi.
COM_BAUD_2400
= 4
-
-
COM_BAUD_4800
¶ 4800
-
gxapi.
COM_BAUD_4800
= 5
-
-
COM_BAUD_9600
¶ 9600
-
gxapi.
COM_BAUD_9600
= 6
-
-
COM_BAUD_14400
¶ 14400
-
gxapi.
COM_BAUD_14400
= 7
-
-
COM_BAUD_19200
¶ 19200
-
gxapi.
COM_BAUD_19200
= 8
-
-
COM_BAUD_56000
¶ 56000
-
gxapi.
COM_BAUD_56000
= 9
-
-
COM_BAUD_57600
¶ 57600
-
gxapi.
COM_BAUD_57600
= 10
-
-
COM_BAUD_115200
¶ 115200
-
gxapi.
COM_BAUD_115200
= 11
-
-
COM_BAUD_128000
¶ 128000
-
gxapi.
COM_BAUD_128000
= 12
-
-
COM_BAUD_256000
¶ 256000
-
gxapi.
COM_BAUD_256000
= 13
-
-
COM_BAUD_38400
¶ 38400
-
gxapi.
COM_BAUD_38400
= 14
-
COM_DATASIZE constants¶
Data Bits
-
COM_DATASIZE_FIVE
¶ Five
-
gxapi.
COM_DATASIZE_FIVE
= 5
-
-
COM_DATASIZE_SIX
¶ Six
-
gxapi.
COM_DATASIZE_SIX
= 6
-
-
COM_DATASIZE_SEVEN
¶ Seven
-
gxapi.
COM_DATASIZE_SEVEN
= 7
-
-
COM_DATASIZE_EIGHT
¶ Eight
-
gxapi.
COM_DATASIZE_EIGHT
= 8
-
COM_FLOWCONTROL constants¶
Flow Control Options
-
COM_FLOWCONTROL_NONE
¶ None
-
gxapi.
COM_FLOWCONTROL_NONE
= 0
-
-
COM_FLOWCONTROL_RTS_CTS
¶ Rts cts
-
gxapi.
COM_FLOWCONTROL_RTS_CTS
= 1
-
-
COM_FLOWCONTROL_DTR_DSR
¶ Dtr dsr
-
gxapi.
COM_FLOWCONTROL_DTR_DSR
= 2
-
-
COM_FLOWCONTROL_XON_XOFF
¶ Xon xoff
-
gxapi.
COM_FLOWCONTROL_XON_XOFF
= 3
-