GXCOM class¶
- class GXCOM(handle=0)[source]¶
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)[source]¶
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
Object- Return 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)[source]¶
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
Object- Return type:
New in version 6.0.
License: Geosoft End-User License
- is_null()[source]¶
Check if this is a null (undefined) instance
- Returns:
True if this is a null (undefined) instance, False otherwise.
- Return type:
bool
- purge_comm()[source]¶
Purges the input and output buffers.
New in version 5.1.8.
License: Geosoft End-User License
- read_chars(line)[source]¶
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)[source]¶
Reads characters from the
GXCOM
, times out and does not terminate- Parameters:
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)[source]¶
Reads Lines from the
GXCOM
to aGXWA
: Geonics EM61 only- Parameters:
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)[source]¶
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)[source]¶
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)[source]¶
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)[source]¶
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)[source]¶
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)[source]¶
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)[source]¶
Writes characters to the
GXCOM
. Does not terminate upon error- Parameters:
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)[source]¶
Writes a Line to the
GXCOM
- Parameters:
line (str) – Line to write
New in version 5.0.
License: Geosoft End-User License
COM_BAUD constants¶
Connection Speed
COM_DATASIZE constants¶
Data Bits
COM_FLOWCONTROL constants¶
Flow Control Options
COM_PARITY constants¶
Parity
COM_STOPBITS constants¶
Stop Bits