InoDrive API Library
Project description
Installation
Install and Update package via pip
pip install CK-InoDrive-API
Usage
Importing Library
# Import InoDrive API library
import CkInoDriveAPI
Create InoDrive Object using WebSocket
# Create instance to InoDrive module object
# Connect by Name
Drive = CkInoDriveAPI.InoDrive(target='Name')
# Connect by Serial Number
Drive = CkInoDriveAPI.InoDrive(target='SN')
# Connect by IP Address
Drive = CkInoDriveAPI.InoDrive(target='IPv4 Address')
# Auto connect
Drive = CkInoDriveAPI.InoDrive(target='IPv4 Address', autoConnect=True)
Read and Write Variable's
# Connect to the drive
Drive.connect()
# Read variable with name 'VariableName'
Drive.UserApp.read_var('VariableName')
# Write variable with name 'VariableName' and value equal to 1
Drive.UserApp.write_var('VariableName', 1)
# Disconnect from the drive
Drive.disconnect()
# Drive object cleanup
Drive.destroy()
Get and Set Output's
# Connect to the drive
Drive.connect()
# Read Output 2
state = Drive.IO.get_output(2)
# Take control of InoDrive module to override output state
Drive.SysControl.take_control(True)
# Set Output 2 to On state
Drive.IO.set_output(2, True)
state = Drive.IO.get_output(2)
# Disable module override
Drive.SysControl.take_control(False)
# Disconnect from the drive
Drive.disconnect()
# Drive object cleanup
Drive.destroy()
Change Module Name (Power cycle InoDrive for changes to take effect)
# Connect to the drive
Drive.connect()
# Read module configuration file
config_file = Drive.File.read_module_config()
# Set new module name
config_file['name'] = "NewName"
# Write configuration changes out
Drive.File.write_module_config(config_file)
# Disconnect from the drive
Drive.disconnect()
# Drive object cleanup
Drive.destroy()
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
CK-InoDrive-API-0.2.8.tar.gz
(42.8 kB
view hashes)
Built Distribution
Close
Hashes for CK_InoDrive_API-0.2.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bcdc66e3812581bfd3ca1823b5335150a48a659ff327d06ead939e4067ffa21b |
|
MD5 | 6b039abe2f557368eb2dd1fd04e72cc0 |
|
BLAKE2b-256 | 556e302a9ec3bbcca144e60c2bb5f848a28828315905e774791e8a98c7c3adfa |