GXCOM class¶
-
class
geosoft.gx.
GXCOM
¶ This class is used to communicate with external serial devices. It allows the setting of timeouts.
-
static
create
((GXContext)ctx, (str)arg1, (int)arg2, (int)arg3, (int)arg4, (int)arg5, (int)arg6, (int)arg7) → GXCOM:¶ Create COM object.
Parameters: - ctx (
geosoft.gx.GXContext
) – The GX execution context - arg1 (str) – port name to open (“COM1” is example)
- arg2 (int) – COM_BAUD constants
- arg3 (int) – COM_DATASIZE constants
- arg4 (int) – COM_PARITY constants
- arg5 (int) – COM_STOPBITS constants
- arg6 (int) – COM_FLOWCONTROL constants
- arg7 (int) – Timeout in Ms (500)
Returns: COM Object
Return type: New in version 5.0.0.
- ctx (
-
static
create_no_terminate
((GXContext)ctx, (str)arg1, (int)arg2, (int)arg3, (int)arg4, (int)arg5, (int)arg6, (int)arg7) → GXCOM:¶ Create COM object.
Parameters: - ctx (
geosoft.gx.GXContext
) – The GX execution context - arg1 (str) – port name to open (“COM1” is example)
- arg2 (int) – COM_BAUD constants
- arg3 (int) – COM_DATASIZE constants
- arg4 (int) – COM_PARITY constants
- arg5 (int) – COM_STOPBITS constants
- arg6 (int) – COM_FLOWCONTROL constants
- arg7 (int) – Timeout in Ms (500)
Returns: COM Object
Return type: New in version 6.0.0.
- ctx (
-
is_null
() → bool¶ Check if the instance of
geosoft.gx.GXCOM is null (undefined)
Returns: True if this is a null instance of geosoft.gx.GXCOM
, False otherwise.Return type: bool`
-
static
null
() → GXCOM¶ A null (undefined) instance of
geosoft.gx.GXCOM
Returns: A null geosoft.gx.GXCOM
Return type: geosoft.gx.GXCOM
-
purge_comm
() → None:¶ Purges the input and output buffers.
Returns: Nothing Return type: None New in version 5.1.8.
-
read_chars
((str_ref)arg1) → None:¶ Reads characters from the COM
Parameters: arg1 ( geosoft.gx.str_ref
) – string for charactersReturns: Nothing Return type: None New in version 5.0.0.
-
read_chars_no_terminate
((str_ref)arg1) → int:¶ Reads characters from the COM, times out and does not terminate
Parameters: arg1 ( geosoft.gx.str_ref
) – string for charactersReturns: 1 - if time out or error 0 - if successful Return type: int New in version 6.0.1.
-
read_em61_lines_wa
((int)arg1, (GXWA)arg2) → None:¶ Reads Lines from the COM to a WA: Geonics EM61 only
Parameters: - arg1 (int) – number of lines
- arg2 (
geosoft.gx.GXWA
) – Where to put lines
Returns: Nothing
Return type: None
New in version 5.0.0.
-
read_file2_wa
((GXWA)arg1) → None:¶ Reads entire dataset from the COM to a WA
Parameters: arg1 ( geosoft.gx.GXWA
) – Where to put linesReturns: Nothing Return type: None New in version 5.0.0.
-
read_line
((str_ref)arg1) → None:¶ Reads a Line from the COM
Parameters: arg1 ( geosoft.gx.str_ref
) – string for lineReturns: Nothing Return type: None New in version 5.0.0.
-
read_line_no_terminate
((str_ref)arg1) → int:¶ Reads a Line from the COM
Parameters: arg1 ( geosoft.gx.str_ref
) – string for lineReturns: 0 - if successful in reading a line 1 - if an error was encountered Return type: int New in version 6.0.1.
-
read_lines_wa
((int)arg1, (GXWA)arg2) → None:¶ Reads Lines from the COM to a WA
Parameters: - arg1 (int) – number of lines
- arg2 (
geosoft.gx.GXWA
) – Where to put lines
Returns: Nothing
Return type: None
New in version 5.0.0.
-
set_time_out
((int)arg1) → None:¶ Set the timeout value.
Parameters: arg1 (int) – Timeout in Ms (500) Returns: Nothing Return type: None New in version 5.0.0.
-
write_chars
((str)arg1) → None:¶ Writes characters to the COM
Parameters: arg1 (str) – line to write Returns: Nothing Return type: None New in version 5.0.0.
-
write_chars_no_terminate
((str)arg1) → int:¶ Writes characters to the COM. Does not terminate upon error
Parameters: arg1 (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.
-
write_line
((str)arg1) → None:¶ Writes a Line to the COM
Parameters: arg1 (str) – line to write Returns: Nothing Return type: None New in version 5.0.0.
-
static
COM_BAUD constants¶
Connection Speed
-
gx.
COM_BAUD_110
= 0¶
-
gx.
COM_BAUD_300
= 1¶
-
gx.
COM_BAUD_600
= 2¶
-
gx.
COM_BAUD_1200
= 3¶
-
gx.
COM_BAUD_2400
= 4¶
-
gx.
COM_BAUD_4800
= 5¶
-
gx.
COM_BAUD_9600
= 6¶
-
gx.
COM_BAUD_14400
= 7¶
-
gx.
COM_BAUD_19200
= 8¶
-
gx.
COM_BAUD_56000
= 9¶
-
gx.
COM_BAUD_57600
= 10¶
-
gx.
COM_BAUD_115200
= 11¶
-
gx.
COM_BAUD_128000
= 12¶
-
gx.
COM_BAUD_256000
= 13¶
-
gx.
COM_BAUD_38400
= 14¶
COM_DATASIZE constants¶
Data Bits
-
gx.
COM_DATASIZE_FIVE
= 5¶
-
gx.
COM_DATASIZE_SIX
= 6¶
-
gx.
COM_DATASIZE_SEVEN
= 7¶
-
gx.
COM_DATASIZE_EIGHT
= 8¶
COM_FLOWCONTROL constants¶
Flow Control Options
-
gx.
COM_FLOWCONTROL_NONE
= 0¶
-
gx.
COM_FLOWCONTROL_RTS_CTS
= 1¶
-
gx.
COM_FLOWCONTROL_DTR_DSR
= 2¶
-
gx.
COM_FLOWCONTROL_XON_XOFF
= 3¶