Skip to main content

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.dispose()

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.dispose()

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.dispose()

Links

Project details


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-1.0.1.tar.gz (47.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

CK_InoDrive_API-1.0.1-py3-none-any.whl (51.5 kB view details)

Uploaded Python 3

File details

Details for the file ck_inodrive_api-1.0.1.tar.gz.

File metadata

  • Download URL: ck_inodrive_api-1.0.1.tar.gz
  • Upload date:
  • Size: 47.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.5

File hashes

Hashes for ck_inodrive_api-1.0.1.tar.gz
Algorithm Hash digest
SHA256 930b8e7a1dba8914178198814f6fbc66749b042c6e05bfbcf664bf0c334b448f
MD5 ee31b4bdcb75a49873fbd19fd456f0b7
BLAKE2b-256 e035c140072204907a994b64806df5f689177c4b058006711ca5d1d247b562e3

See more details on using hashes here.

File details

Details for the file CK_InoDrive_API-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for CK_InoDrive_API-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 45b201be88fd35382a814496e17b7754c4f19d1651400dbdb98d4736991377cc
MD5 274f7ef052b31af1205bdd05806b594b
BLAKE2b-256 aae5e9919f899dd6604d338d9efa46c1e3125becdc530659d655f7c5071e7169

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page