pm16c16.core package

class Communication(ip_address, port=7777, timeout_sec=3.0, encoding='ascii')[ソース]

ベースクラス: object

PMシリーズ用のTCP通信層。

TCPソケットの生成、接続、CR+LF単位の送受信、切断までをこのクラス内で 完結させる。外部の通信オブジェクトや別バックエンドは使用しない。

パラメータ:
  • ip_address (str)

  • port (int)

  • timeout_sec (float)

  • encoding (str)

_close_after_error()[ソース]
戻り値の型:

None

_require_socket()[ソース]
戻り値の型:

socket

close()[ソース]
戻り値の型:

None

connect()[ソース]
戻り値の型:

None

disconnect()[ソース]
戻り値の型:

None

property is_connected: bool
query(command)[ソース]
パラメータ:

command (str)

戻り値の型:

str

receive()[ソース]
戻り値の型:

str

send(command)[ソース]
パラメータ:

command (str)

戻り値の型:

None

exception CommunicationError[ソース]

ベースクラス: MotorControlError

通信処理に失敗した場合の例外。

exception MotorControlError[ソース]

ベースクラス: Exception

モーター制御に関する基底例外。

class MotorStatus(motor, raw='', remote_local='', direction='S', ls_status=0, motor_status='', position=0)[ソース]

ベースクラス: object

1軸分の状態を保持し、状態判定も担当する。

パラメータ:
  • motor (int)

  • raw (str)

  • remote_local (str)

  • direction (str)

  • ls_status (int)

  • motor_status (str)

  • position (int)

property ccw_ls: bool
property cw_ls: bool
classmethod from_single_response(requested_motor, raw)[ソース]
パラメータ:
  • requested_motor (int)

  • raw (str)

戻り値の型:

MotorStatus

property hold_off: bool
property hp_ls: bool
property is_busy: bool
property legacy_status_bits: int
property rotation_state: int
exception ProtocolError[ソース]

ベースクラス: MotorControlError

装置応答を解釈できない場合の例外。

Submodules

pm16c16.core.communication_tcp module

class Communication(ip_address, port=7777, timeout_sec=3.0, encoding='ascii')[ソース]

ベースクラス: object

PMシリーズ用のTCP通信層。

TCPソケットの生成、接続、CR+LF単位の送受信、切断までをこのクラス内で 完結させる。外部の通信オブジェクトや別バックエンドは使用しない。

パラメータ:
  • ip_address (str)

  • port (int)

  • timeout_sec (float)

  • encoding (str)

_close_after_error()[ソース]
戻り値の型:

None

_require_socket()[ソース]
戻り値の型:

socket

close()[ソース]
戻り値の型:

None

connect()[ソース]
戻り値の型:

None

disconnect()[ソース]
戻り値の型:

None

property is_connected: bool
query(command)[ソース]
パラメータ:

command (str)

戻り値の型:

str

receive()[ソース]
戻り値の型:

str

send(command)[ソース]
パラメータ:

command (str)

戻り値の型:

None

pm16c16.core.data module

pm16c16.core.errors module

exception CommunicationError[ソース]

ベースクラス: MotorControlError

通信処理に失敗した場合の例外。

exception MotorControlError[ソース]

ベースクラス: Exception

モーター制御に関する基底例外。

exception ProtocolError[ソース]

ベースクラス: MotorControlError

装置応答を解釈できない場合の例外。

pm16c16.core.motor_status module

class MotorStatus(motor, raw='', remote_local='', direction='S', ls_status=0, motor_status='', position=0)[ソース]

ベースクラス: object

1軸分の状態を保持し、状態判定も担当する。

パラメータ:
  • motor (int)

  • raw (str)

  • remote_local (str)

  • direction (str)

  • ls_status (int)

  • motor_status (str)

  • position (int)

property ccw_ls: bool
property cw_ls: bool
classmethod from_single_response(requested_motor, raw)[ソース]
パラメータ:
  • requested_motor (int)

  • raw (str)

戻り値の型:

MotorStatus

property hold_off: bool
property hp_ls: bool
property is_busy: bool
property legacy_status_bits: int
property rotation_state: int