### Create Log File Sequence Source: https://pylsv2.readthedocs.io/en/latest/protocol.html Initiate log file creation using `C_CC` with command 27, specifying the filename and start time. Acknowledge with `T_OK`. The log file is ready when `M_CC` is received. ```text >....R_ST <....S_ST............ >....C_ST............ <....T_OK >...%C_CC..operation.log;12.09.2020;00:00:00;. <....T_OK <....M_CC...d 0x00 0x1b 0x00 0x64 >....C_ST............ <....T_OK >....R_FLTNC:\operation.log. <....S_FLOperation Logbook Version 1.0.Sy.. ``` -------------------------------- ### Read File Information (R_FI) Source: https://pylsv2.readthedocs.io/en/latest/protocol.html Use the `R_FI` command followed by a file path to get file size, Unix date, and filename. Additional bytes may indicate attributes or access rights. ```text > R_FI ``` -------------------------------- ### Create Log File Command (C_CC) Source: https://pylsv2.readthedocs.io/en/latest/_sources/protocol.rst.txt The C_CC command with parameter 27 is used to trigger the generation of a log file. The parameters specify the log file name and the start date/time for log entries. ```text >...%C_CC..operation.log;12.09.2020;00:00:00;. ``` -------------------------------- ### Request Log File Command (R_FL) Source: https://pylsv2.readthedocs.io/en/latest/_sources/protocol.rst.txt Use the R_FL command to request a log file from the control. The example shows requesting 'Operation Logbook Version 1.0'. ```text >....R_FLTNC:\operation.log. ``` -------------------------------- ### get_program_stack Source: https://pylsv2.readthedocs.io/en/latest/package.html Gets the path of currently active NC program(s) and the current line number from the CNC control. ```APIDOC ## get_program_stack ### Description Get path of currently active nc program(s) and current line number. See https://github.com/tfischer73/Eclipse-Plugin-Heidenhain/issues/1. ### Returns - **dict or bool** - Dictionary with line number, main program and current program or False if something went wrong. ``` -------------------------------- ### get_program_status Source: https://pylsv2.readthedocs.io/en/latest/package.html Gets the status code of the currently active program on the CNC control. ```APIDOC ## get_program_status ### Description Get status code of currently active program. See https://github.com/tfischer73/Eclipse-Plugin-Heidenhain/issues/1. ### Returns - **int or bool** - Status code or False if something went wrong. ``` -------------------------------- ### get_execution_status Source: https://pylsv2.readthedocs.io/en/latest/package.html Gets the status code of the program state on the CNC control. ```APIDOC ## get_execution_status ### Description Get status code of program state to text. See https://github.com/drunsinn/pyLSV2/issues/1. ### Returns - **int or bool** - Status code or False if something went wrong. ``` -------------------------------- ### LSV2 Class Initialization Source: https://pylsv2.readthedocs.io/en/latest/package.html Initializes the LSV2 client with connection details. ```APIDOC ## LSV2 Class ### Description Implementation of the LSV2 protocol used to communicate with certain CNC controls. ### Parameters - **hostname** (str) - The hostname or IP address of the CNC control. - **port** (int, optional) - The port number for the connection. Defaults to 0. - **timeout** (float, optional) - The connection timeout in seconds. Defaults to 15.0. - **safe_mode** (bool, optional) - Enables safe mode for operations. Defaults to True. ``` -------------------------------- ### make_directory Source: https://pylsv2.readthedocs.io/en/latest/package.html Creates a directory on the control, including any necessary parent directories. ```APIDOC ## make_directory ### Description Create a directory on control. If necessary also creates parent directories ### Parameters #### Path Parameters - **dir_path** (str) – path of directory on the control ### Returns True if creating of directory completed successfully ### Return Type bool ``` -------------------------------- ### get_system_parameter Source: https://pylsv2.readthedocs.io/en/latest/package.html Retrieves all system version information. This data is buffered for efficiency but can be re-read manually by setting `force` to `True`. ```APIDOC ## get_system_parameter ### Description Get all version information, result is bufferd since it is also used internally. With parameter force it is possible to manually re-read the information form the control. ### Parameters #### Path Parameters - **force** (bool) – if True the information is read even if it is already buffered ### Returns dictionary with system parameters like number of plc variables, supported lsv2 version etc. ### Return Type dict ``` -------------------------------- ### get_versions Source: https://pylsv2.readthedocs.io/en/latest/package.html Fetches all version information for the control, including software versions and options. The result is buffered and can be refreshed by setting `force` to `True`. ```APIDOC ## get_versions ### Description Get all version information, result is bufferd since it is also used internally. With parameter force it is possible to manually re-read the information form the control. ### Parameters #### Path Parameters - **force** (bool) – if True the information is read even if it is already buffered ### Returns dictionary with version text for control type, nc software, plc software, software options etc. ### Return Type dict ``` -------------------------------- ### File Transfer - Binary Mode Source: https://pylsv2.readthedocs.io/en/latest/protocol.html Enable binary file transfer mode by appending `0x01` after the filename. This mode is recommended for certain file types. ```python pyLSV2.LSV2.recive_file(binary_mode=True) pyLSV2.LSV2.send_file(binary_mode=True) ``` -------------------------------- ### connect Source: https://pylsv2.readthedocs.io/en/latest/package.html Establishes a connection to the CNC control. ```APIDOC ## connect ### Description Connect to control. ``` -------------------------------- ### pyLSV2.LSV2 Methods Source: https://pylsv2.readthedocs.io/en/latest/genindex.html Methods available for interacting with the LSV2 device. ```APIDOC ## change_directory() ### Description Changes the current directory on the LSV2 device. ### Method (Not specified, likely a method call on an LSV2 object) ### Endpoint N/A ### Parameters None specified. ### Request Example ```python lsv2_instance.change_directory("new_path") ``` ### Response None specified. ``` ```APIDOC ## connect() ### Description Establishes a connection to the LSV2 device. ### Method (Not specified, likely a method call on an LSV2 object) ### Endpoint N/A ### Parameters None specified. ### Request Example ```python lsv2_instance.connect() ``` ### Response None specified. ``` ```APIDOC ## copy_local_file() ### Description Copies a file from the local system to the LSV2 device. ### Method (Not specified, likely a method call on an LSV2 object) ### Endpoint N/A ### Parameters None specified. ### Request Example ```python lsv2_instance.copy_local_file("local_path", "remote_path") ``` ### Response None specified. ``` ```APIDOC ## delete_empty_directory() ### Description Deletes an empty directory on the LSV2 device. ### Method (Not specified, likely a method call on an LSV2 object) ### Endpoint N/A ### Parameters None specified. ### Request Example ```python lsv2_instance.delete_empty_directory("directory_path") ``` ### Response None specified. ``` ```APIDOC ## delete_file() ### Description Deletes a file on the LSV2 device. ### Method (Not specified, likely a method call on an LSV2 object) ### Endpoint N/A ### Parameters None specified. ### Request Example ```python lsv2_instance.delete_file("file_path") ``` ### Response None specified. ``` ```APIDOC ## disconnect() ### Description Disconnects from the LSV2 device. ### Method (Not specified, likely a method call on an LSV2 object) ### Endpoint N/A ### Parameters None specified. ### Request Example ```python lsv2_instance.disconnect() ``` ### Response None specified. ``` ```APIDOC ## get_directory_content() ### Description Retrieves the content of a directory on the LSV2 device. ### Method (Not specified, likely a method call on an LSV2 object) ### Endpoint N/A ### Parameters None specified. ### Request Example ```python lsv2_instance.get_directory_content("directory_path") ``` ### Response None specified. ``` ```APIDOC ## get_directory_info() ### Description Retrieves information about a directory on the LSV2 device. ### Method (Not specified, likely a method call on an LSV2 object) ### Endpoint N/A ### Parameters None specified. ### Request Example ```python lsv2_instance.get_directory_info("directory_path") ``` ### Response None specified. ``` ```APIDOC ## get_drive_info() ### Description Retrieves information about a drive on the LSV2 device. ### Method (Not specified, likely a method call on an LSV2 object) ### Endpoint N/A ### Parameters None specified. ### Request Example ```python lsv2_instance.get_drive_info("drive_name") ``` ### Response None specified. ``` ```APIDOC ## get_error_messages() ### Description Retrieves error messages from the LSV2 device. ### Method (Not specified, likely a method call on an LSV2 object) ### Endpoint N/A ### Parameters None specified. ### Request Example ```python lsv2_instance.get_error_messages() ``` ### Response None specified. ``` ```APIDOC ## get_execution_status() ### Description Retrieves the execution status from the LSV2 device. ### Method (Not specified, likely a method call on an LSV2 object) ### Endpoint N/A ### Parameters None specified. ### Request Example ```python lsv2_instance.get_execution_status() ``` ### Response None specified. ``` ```APIDOC ## get_file_info() ### Description Retrieves information about a file on the LSV2 device. ### Method (Not specified, likely a method call on an LSV2 object) ### Endpoint N/A ### Parameters None specified. ### Request Example ```python lsv2_instance.get_file_info("file_path") ``` ### Response None specified. ``` ```APIDOC ## get_file_list() ### Description Retrieves a list of files from a directory on the LSV2 device. ### Method (Not specified, likely a method call on an LSV2 object) ### Endpoint N/A ### Parameters None specified. ### Request Example ```python lsv2_instance.get_file_list("directory_path") ``` ### Response None specified. ``` ```APIDOC ## get_machine_parameter() ### Description Retrieves a machine parameter from the LSV2 device. ### Method (Not specified, likely a method call on an LSV2 object) ### Endpoint N/A ### Parameters None specified. ### Request Example ```python lsv2_instance.get_machine_parameter("parameter_name") ``` ### Response None specified. ``` ```APIDOC ## get_override_info() ### Description Retrieves override information from the LSV2 device. ### Method (Not specified, likely a method call on an LSV2 object) ### Endpoint N/A ### Parameters None specified. ### Request Example ```python lsv2_instance.get_override_info() ``` ### Response None specified. ``` ```APIDOC ## get_program_stack() ### Description Retrieves the program stack from the LSV2 device. ### Method (Not specified, likely a method call on an LSV2 object) ### Endpoint N/A ### Parameters None specified. ### Request Example ```python lsv2_instance.get_program_stack() ``` ### Response None specified. ``` ```APIDOC ## get_program_status() ### Description Retrieves the program status from the LSV2 device. ### Method (Not specified, likely a method call on an LSV2 object) ### Endpoint N/A ### Parameters None specified. ### Request Example ```python lsv2_instance.get_program_status() ``` ### Response None specified. ``` ```APIDOC ## get_spindle_tool_status() ### Description Retrieves the spindle and tool status from the LSV2 device. ### Method (Not specified, likely a method call on an LSV2 object) ### Endpoint N/A ### Parameters None specified. ### Request Example ```python lsv2_instance.get_spindle_tool_status() ``` ### Response None specified. ``` ```APIDOC ## get_system_parameter() ### Description Retrieves a system parameter from the LSV2 device. ### Method (Not specified, likely a method call on an LSV2 object) ### Endpoint N/A ### Parameters None specified. ### Request Example ```python lsv2_instance.get_system_parameter("parameter_name") ``` ### Response None specified. ``` ```APIDOC ## get_versions() ### Description Retrieves the version information from the LSV2 device. ### Method (Not specified, likely a method call on an LSV2 object) ### Endpoint N/A ### Parameters None specified. ### Request Example ```python lsv2_instance.get_versions() ``` ### Response None specified. ``` ```APIDOC ## is_itnc() ### Description Checks if the device is an iTNC. ### Method (Not specified, likely a method call on an LSV2 object) ### Endpoint N/A ### Parameters None specified. ### Request Example ```python lsv2_instance.is_itnc() ``` ### Response None specified. ``` ```APIDOC ## is_pilot() ### Description Checks if the device is a Pilot. ### Method (Not specified, likely a method call on an LSV2 object) ### Endpoint N/A ### Parameters None specified. ### Request Example ```python lsv2_instance.is_pilot() ``` ### Response None specified. ``` ```APIDOC ## is_tnc() ### Description Checks if the device is a TNC. ### Method (Not specified, likely a method call on an LSV2 object) ### Endpoint N/A ### Parameters None specified. ### Request Example ```python lsv2_instance.is_tnc() ``` ### Response None specified. ``` ```APIDOC ## login() ### Description Logs into the LSV2 device. ### Method (Not specified, likely a method call on an LSV2 object) ### Endpoint N/A ### Parameters None specified. ### Request Example ```python lsv2_instance.login(username, password) ``` ### Response None specified. ``` ```APIDOC ## logout() ### Description Logs out from the LSV2 device. ### Method (Not specified, likely a method call on an LSV2 object) ### Endpoint N/A ### Parameters None specified. ### Request Example ```python lsv2_instance.logout() ``` ### Response None specified. ``` ```APIDOC ## make_directory() ### Description Creates a new directory on the LSV2 device. ### Method (Not specified, likely a method call on an LSV2 object) ### Endpoint N/A ### Parameters None specified. ### Request Example ```python lsv2_instance.make_directory("directory_path") ``` ### Response None specified. ``` ```APIDOC ## move_local_file() ### Description Moves a file from the local system to the LSV2 device. ### Method (Not specified, likely a method call on an LSV2 object) ### Endpoint N/A ### Parameters None specified. ### Request Example ```python lsv2_instance.move_local_file("local_path", "remote_path") ``` ### Response None specified. ``` ```APIDOC ## read_plc_memory() ### Description Reads data from the PLC memory on the LSV2 device. ### Method (Not specified, likely a method call on an LSV2 object) ### Endpoint N/A ### Parameters None specified. ### Request Example ```python lsv2_instance.read_plc_memory(address, length) ``` ### Response None specified. ``` ```APIDOC ## recive_file() ### Description Receives a file from the LSV2 device to the local system. ### Method (Not specified, likely a method call on an LSV2 object) ### Endpoint N/A ### Parameters None specified. ### Request Example ```python lsv2_instance.recive_file("remote_path", "local_path") ``` ### Response None specified. ``` ```APIDOC ## send_file() ### Description Sends a file from the local system to the LSV2 device. ### Method (Not specified, likely a method call on an LSV2 object) ### Endpoint N/A ### Parameters None specified. ### Request Example ```python lsv2_instance.send_file("local_path", "remote_path") ``` ### Response None specified. ``` ```APIDOC ## send_key_code() ### Description Sends a key code to the LSV2 device. ### Method (Not specified, likely a method call on an LSV2 object) ### Endpoint N/A ### Parameters None specified. ### Request Example ```python lsv2_instance.send_key_code(key_code) ``` ### Response None specified. ``` ```APIDOC ## set_keyboard_access() ### Description Sets the keyboard access mode on the LSV2 device. ### Method (Not specified, likely a method call on an LSV2 object) ### Endpoint N/A ### Parameters None specified. ### Request Example ```python lsv2_instance.set_keyboard_access(mode) ``` ### Response None specified. ``` ```APIDOC ## set_machine_parameter() ### Description Sets a machine parameter on the LSV2 device. ### Method (Not specified, likely a method call on an LSV2 object) ### Endpoint N/A ### Parameters None specified. ### Request Example ```python lsv2_instance.set_machine_parameter(parameter_name, value) ``` ### Response None specified. ``` ```APIDOC ## set_system_command() ### Description Sends a system command to the LSV2 device. ### Method (Not specified, likely a method call on an LSV2 object) ### Endpoint N/A ### Parameters None specified. ### Request Example ```python lsv2_instance.set_system_command(command) ``` ### Response None specified. ``` -------------------------------- ### Read Machine State (R_RI) - Program Status Source: https://pylsv2.readthedocs.io/en/latest/protocol.html When logged in as DNC, use `R_RI 0x001A` to read the current program status. DNC login requires a specific option to be set on the control. ```text > R_RI 0x001A (26) -> you can read the current program status ``` -------------------------------- ### Read Directory Content (R_DI) with All Entries Source: https://pylsv2.readthedocs.io/en/latest/protocol.html Append `0x01` to the `R_DI` command to receive all directory entries at once instead of one per packet. The decoded directory information is not fully understood. ```text > R_DI 0x01 ``` -------------------------------- ### Read Machine State (R_RI) - Current Program Name Source: https://pylsv2.readthedocs.io/en/latest/protocol.html When logged in as DN, use `R_RI 0x0018` to read the name of the currently executing program. ```text > R_RI 0x0018 (24) -> you can read the name of the current program in execution. ``` -------------------------------- ### recive_file Source: https://pylsv2.readthedocs.io/en/latest/package.html Downloads a file from the control to a local path. Supports overriding existing files and binary transfer mode. ```APIDOC ## recive_file ### Description Download a file from control ### Parameters #### Path Parameters - **remote_path** (str) – path of file on the control - **local_path** (str) – local path of destination with or without file name - **override_file** (bool) – flag if file should be replaced if it already exists - **binary_mode** (bool) – flag if binary transfer mode should be used, if not set the file name is checked for known binary file type ### Returns True if transfer completed successfully ### Return Type bool ``` -------------------------------- ### get_drive_info Source: https://pylsv2.readthedocs.io/en/latest/package.html Queries information about all drives and partitions on the CNC control. ```APIDOC ## get_drive_info ### Description Query info all drives and partitions from the control. ### Returns - **list** - List of dict with with info about drive entries. ``` -------------------------------- ### set_system_command Source: https://pylsv2.readthedocs.io/en/latest/package.html Executes a system command on the control unit. Supports optional parameters and respects safe mode restrictions. ```APIDOC ## set_system_command ### Description Execute a system command on the control if command is one a known value. If safe mode is active, some of the commands are disabled. If necessary additional parameters can be supplied. ### Method `set_system_command(command, parameter=None)` ### Parameters #### Path Parameters - **command** (int) - system command - **parameter** (str) - optional. parameter payload for system command ### Returns - **bool** - True if execution was successful ``` -------------------------------- ### send_key_code Source: https://pylsv2.readthedocs.io/en/latest/package.html Sends a key code to the control, simulating a key press. Requires MONITOR level access and specific keyboard locking/unlocking procedures. ```APIDOC ## send_key_code ### Description Send key code to control. Behaves as if the associated key was pressed on the keyboard. Requires access MONITOR level to work. To work correctly you first have to lock the keyboard and unlock it afterwards!: set_keyboard_access(False) send_key_code(KEY_SPEC_CE) set_keyboard_access(True) ### Parameters #### Path Parameters - **key_code** (int) – code number of the keyboard key ### Returns True or False if command was executed successfully ### Return Type bool ``` -------------------------------- ### send_file Source: https://pylsv2.readthedocs.io/en/latest/package.html Uploads a file from a local path to the control. Supports overriding existing files and binary transfer mode. ```APIDOC ## send_file ### Description Upload a file to control ### Parameters #### Path Parameters - **local_path** (str) – local path of destination with or without file name - **remote_path** (str) – path of file on the control - **override_file** (bool) – flag if file should be replaced if it already exists - **binary_mode** (bool) – flag if binary transfer mode should be used, if not set the file name is checked for known binary file type ### Returns True if transfer completed successfully ### Return Type bool ``` -------------------------------- ### login Source: https://pylsv2.readthedocs.io/en/latest/package.html Requests additional access rights by performing a login. Some access levels may require a password. ```APIDOC ## login ### Description Request additional access rights. To elevate this level a logon has to be performed. Some levels require a password. ### Parameters #### Path Parameters - **login** (str) – One of the known login strings - **password** (str) – optional. Password for login ### Returns True if execution was successful ### Return Type bool ``` -------------------------------- ### move_local_file Source: https://pylsv2.readthedocs.io/en/latest/package.html Moves a file on the control from a source path to a target path. ```APIDOC ## move_local_file ### Description Move file on control from one place to another ### Parameters #### Path Parameters - **source_path** (str) – path of file on the control - **target_path** (str) – path of target location ### Returns True if moving of file completed successfully ### Return Type bool ``` -------------------------------- ### get_file_info Source: https://pylsv2.readthedocs.io/en/latest/package.html Queries information about a specific file on the CNC control. ```APIDOC ## get_file_info ### Description Query information about a file. ### Parameters - **remote_file_path** (str) - Path of file on the control. ### Returns - **dict or bool** - Dictionary with info about file or False if remote path does not exist. ``` -------------------------------- ### set_keyboard_access Source: https://pylsv2.readthedocs.io/en/latest/package.html Enables or disables keyboard input on the control. Requires MONITOR level access. ```APIDOC ## set_keyboard_access ### Description Enable or disable the keyboard on the control. Requires access level MONITOR to work. ### Parameters #### Path Parameters - **unlocked** (bool) – if True unlocks the keyboard. if false, input is set to locked ### Returns True or False if command was executed successfully ### Return Type bool ``` -------------------------------- ### get_override_info Source: https://pylsv2.readthedocs.io/en/latest/package.html Retrieves information about the override settings on the CNC control. ```APIDOC ## get_override_info ### Description Get information about the override info. ### Returns - **dict or bool** - Override information or False if something went wrong. ``` -------------------------------- ### copy_local_file Source: https://pylsv2.readthedocs.io/en/latest/package.html Copies a file on the CNC control from one location to another. ```APIDOC ## copy_local_file ### Description Copy file on control from one place to another. ### Parameters - **source_path** (str) - Path of file on the control. - **target_path** (str) - Path of target location. ### Returns - **bool** - True if copying of file completed successfully. ``` -------------------------------- ### get_directory_info Source: https://pylsv2.readthedocs.io/en/latest/package.html Queries information about the current working directory on the CNC control. ```APIDOC ## get_directory_info ### Description Query information a the current working directory on the control. ### Parameters - **remote_directory** (str, optional) - If set, working directory will be changed. ### Returns - **dict or bool** - Dictionary with info about the directory or False if an error occurred. ``` -------------------------------- ### change_directory Source: https://pylsv2.readthedocs.io/en/latest/package.html Changes the current working directory on the CNC control. ```APIDOC ## change_directory ### Description Change the current working directory on the control. ### Parameters - **remote_directory** (str) - Path of directory on the control. ### Returns - **bool** - True if changing of directory succeeded. ``` -------------------------------- ### TableReader Class Methods Source: https://pylsv2.readthedocs.io/en/latest/package.html Provides static methods for converting string values to boolean, float, and integer types, and a method to parse table files. ```APIDOC ## TableReader Class ### Description Generic parser for table files commonly used by TNC, iTNC, CNCPILOT and MANUALplus controls. ### Methods #### `format_entry_bool(_str_value_)` - **Description**: Convert the string value of a table cell to a boolean value. - **Parameters**: - `_str_value_` (str) - The string value from a table cell. #### `format_entry_float(_str_value_)` - **Description**: Convert the string value of a table cell to a float value. - **Parameters**: - `_str_value_` (str) - The string value from a table cell. #### `format_entry_int(_str_value_)` - **Description**: Convert the string value of a table cell to an integer value. - **Parameters**: - `_str_value_` (str) - The string value from a table cell. #### `parse_table(_table_path_)` - **Description**: Parse a file of one of the common table formats. - **Parameters**: - `table_path` (str) - Path to the table file. - **Returns**: - A list of dictionaries, where keys are column names and values are the content of the table cells. - **Return Type**: - list ``` -------------------------------- ### pyLSV2.TableReader Methods Source: https://pylsv2.readthedocs.io/en/latest/genindex.html Methods available for the TableReader class. ```APIDOC ## format_entry_bool() ### Description Formats a boolean entry from a table. ### Method (Static method of TableReader) ### Endpoint N/A ### Parameters None specified. ### Request Example ```python TableReader.format_entry_bool(value) ``` ### Response None specified. ``` ```APIDOC ## format_entry_float() ### Description Formats a float entry from a table. ### Method (Static method of TableReader) ### Endpoint N/A ### Parameters None specified. ### Request Example ```python TableReader.format_entry_float(value) ``` ### Response None specified. ``` ```APIDOC ## format_entry_int() ### Description Formats an integer entry from a table. ### Method (Static method of TableReader) ### Endpoint N/A ### Parameters None specified. ### Request Example ```python TableReader.format_entry_int(value) ``` ### Response None specified. ``` ```APIDOC ## parse_table() ### Description Parses a table. ### Method (Method of TableReader instance) ### Endpoint N/A ### Parameters None specified. ### Request Example ```python table_reader_instance.parse_table(table_data) ``` ### Response None specified. ``` -------------------------------- ### Protocol Structure Source: https://pylsv2.readthedocs.io/en/latest/_sources/protocol.rst.txt LSV2 telegrams begin with a 32-bit length field, followed by a 4-character command string. A 0x00 byte separates the command from additional data. All values use big-endian byte order. ```text <....M_CC...d 0x00 0x1b 0x00 0x64 ``` -------------------------------- ### is_pilot Source: https://pylsv2.readthedocs.io/en/latest/package.html Checks if the control unit is a CNCPILOT640 type. ```APIDOC ## is_pilot ### Description return true if control is of a CNCPILOT640 ### Returns True if the control is a CNCPILOT640. ### Return Type bool ``` -------------------------------- ### get_file_list Source: https://pylsv2.readthedocs.io/en/latest/package.html Retrieves a list of files within a directory structure on the CNC control. ```APIDOC ## get_file_list ### Description Get list of files in directory structure. ### Parameters - **path** (str, optional) - Path of the directory where files should be searched. If None, the current directory is used. - **descend** (bool, optional) - Control if search should run recursive. Defaults to True. - **pattern** (str, optional) - Regex string to filter the file names. ### Returns - **list** - List of files found in directory. ``` -------------------------------- ### delete_empty_directory Source: https://pylsv2.readthedocs.io/en/latest/package.html Deletes an empty directory on the CNC control. ```APIDOC ## delete_empty_directory ### Description Delete empty directory on control. ### Parameters - **dir_path** (str) - Path of directory on the control. ### Returns - **bool** - True if deleting of directory completed successfully. ``` -------------------------------- ### get_directory_content Source: https://pylsv2.readthedocs.io/en/latest/package.html Retrieves the content of the current working directory on the CNC control. ```APIDOC ## get_directory_content ### Description Query content of current working directory from the control. In some situations it is necessary to fist call get_directory_info() or else the attributes won’t be correct. ### Returns - **list** - List of dict with info about directory entries. ``` -------------------------------- ### Read Machine State (R_RI) - Axis Data Source: https://pylsv2.readthedocs.io/en/latest/protocol.html When logged in as INSPECT, use `R_RI 0x0015` to read the X, Y, and Z axis values. ```text > R_RI 0x0015 (21) -> you can read the X,Y,Z Axis. ``` -------------------------------- ### set_machine_parameter Source: https://pylsv2.readthedocs.io/en/latest/package.html Sets a machine parameter on the control. Requires PLCDEBUG level access. Note that writing parameters can take time, so ensure a sufficiently high timeout is set. ```APIDOC ## set_machine_parameter ### Description Set machine parameter on control. Requires access PLCDEBUG level to work. Writing a parameter takes some time, make sure to set timeout sufficiently high! ### Parameters #### Path Parameters - **name** – name of the machine parameter - **value** – value of the machine parameter - **safe_to_disk** (bool) – optional. if True, parameter is saved to disk ``` -------------------------------- ### pyLSV2 Constants Source: https://pylsv2.readthedocs.io/en/latest/genindex.html Constants available in the pyLSV2.const module. ```APIDOC ## DRIVE_LOG ### Description Constant related to drive logs. ### Module pyLSV2.const ``` ```APIDOC ## DRIVE_PLC ### Description Constant related to PLC drives. ### Module pyLSV2.const ``` ```APIDOC ## DRIVE_SYS ### Description Constant related to system drives. ### Module pyLSV2.const ``` ```APIDOC ## DRIVE_TNC ### Description Constant related to TNC drives. ### Module pyLSV2.const ``` ```APIDOC ## EXEC_STATE_MANUAL ### Description Constant representing manual execution state. ### Module pyLSV2.const ``` ```APIDOC ## FS_ENTRY_IS_HIDDEN ### Description Constant indicating if a file system entry is hidden. ### Module pyLSV2.const ``` ```APIDOC ## KEY_LOWER_A ### Description Constant representing the key code for 'a'. ### Module pyLSV2.const ``` ```APIDOC ## LOGIN_INSPECT ### Description Constant related to inspection login mode. ### Module pyLSV2.const ``` ```APIDOC ## LSV2_ERROR_T_ER_BAD_FORMAT ### Description Constant representing a bad format error code. ### Module pyLSV2.const ``` ```APIDOC ## PGM_STATE_STARTED ### Description Constant representing the program state 'started'. ### Module pyLSV2.const ``` ```APIDOC ## PLC_MEM_TYPE_MARKER ### Description Constant for PLC memory marker type. ### Module pyLSV2.const ``` ```APIDOC ## REGEX_FILE_NAME_H ### Description Regular expression for file name format H. ### Module pyLSV2.const ``` ```APIDOC ## REGEX_FILE_NAME_I ### Description Regular expression for file name format I. ### Module pyLSV2.const ``` ```APIDOC ## RUN_INFO_EXEC_STATE ### Description Constant related to run info execution state. ### Module pyLSV2.const ``` ```APIDOC ## TYPE_MILL_NEW_STYLE ### Description Constant for mill new style type. ### Module pyLSV2.const ``` -------------------------------- ### logout Source: https://pylsv2.readthedocs.io/en/latest/package.html Drops one or all active access rights. If no login is specified, all active access rights are dropped. ```APIDOC ## logout ### Description Drop one or all access right. If no login is supplied all active access rights are dropped. ### Parameters #### Path Parameters - **login** (str) – optional. One of the known login strings ### Returns True if execution was successful ### Return Type bool ``` -------------------------------- ### delete_file Source: https://pylsv2.readthedocs.io/en/latest/package.html Deletes a file on the CNC control. ```APIDOC ## delete_file ### Description Delete file on control. ### Parameters - **file_path** (str) - Path of file on the control. ### Returns - **bool** - True if deleting of file completed successfully. ``` -------------------------------- ### pyLSV2.LSV2 Class Source: https://pylsv2.readthedocs.io/en/latest/_sources/package.rst.txt The main client class for interacting with the LSV2 service. It provides methods for various operations. ```APIDOC ## pyLSV2.LSV2 ### Description This class serves as the primary interface for the pyLSV2 library, encapsulating functionalities to interact with the LSV2 service. ### Methods (Members are documented in the source but not detailed here as per instructions to only extract explicitly documented operations.) ``` -------------------------------- ### get_machine_parameter Source: https://pylsv2.readthedocs.io/en/latest/package.html Reads a machine parameter from the CNC control. ```APIDOC ## get_machine_parameter ### Description Read machine parameter from control. Requires access INSPECT level to work. ### Parameters - **name** (str) - Name of the machine parameter. For iTNC the parameter number has to be converted to string. ### Returns - **str or bool** - Value of parameter or False if command not successful. ``` -------------------------------- ### disconnect Source: https://pylsv2.readthedocs.io/en/latest/package.html Logs out of all open logins and closes the connection to the CNC control. ```APIDOC ## disconnect ### Description Logout of all open logins and close connection. ``` -------------------------------- ### pyLSV2.TableReader Class Source: https://pylsv2.readthedocs.io/en/latest/_sources/package.rst.txt A utility class for reading and processing table data. ```APIDOC ## pyLSV2.TableReader ### Description Provides functionality to read and parse table data structures. ### Methods (Members are documented in the source but not detailed here as per instructions to only extract explicitly documented operations.) ``` -------------------------------- ### get_spindle_tool_status Source: https://pylsv2.readthedocs.io/en/latest/package.html Retrieves information about the tool currently in the spindle of the CNC control. ```APIDOC ## get_spindle_tool_status ### Description Get information about the tool currently in the spindle. ### Returns - **dict or bool** - Tool information or False if something went wrong. ``` -------------------------------- ### is_itnc Source: https://pylsv2.readthedocs.io/en/latest/package.html Checks if the control unit is an iTNC type. ```APIDOC ## is_itnc ### Description return true if control is of a iTNC ### Returns True if the control is an iTNC. ### Return Type bool ``` -------------------------------- ### is_tnc Source: https://pylsv2.readthedocs.io/en/latest/package.html Checks if the control unit is a TNC type. ```APIDOC ## is_tnc ### Description return true if control is of a TNC ### Returns True if the control is a TNC. ### Return Type bool ``` -------------------------------- ### read_plc_memory Source: https://pylsv2.readthedocs.io/en/latest/package.html Reads data from PLC memory at a specified address and memory type, with an optional count for the number of elements to read. ```APIDOC ## read_plc_memory ### Description Read data from plc memory. ### Parameters #### Path Parameters - **address** – which memory location should be read, starts at 0 up to the max number for each type - **mem_type** – what datatype to read - **count** – how many elements should be read at a time, from 1 (default) up to 255 or max number ### Returns a list with the data values ### Raises **Exception** – raises an Exception ``` -------------------------------- ### get_error_messages Source: https://pylsv2.readthedocs.io/en/latest/package.html Retrieves information about the first or next error message displayed on the CNC control. ```APIDOC ## get_error_messages ### Description Get information about the first or next error displayed on the control. ### Parameters - **next_error** (bool) - If True, check if any further error messages are available. ### Returns - **dict or bool** - Error information or False if something went wrong. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.