Skip to main content

fins-driver

FINS (Factory Interface Network Service) Python driver for Omron PLC.

Installation

Install the latest version from PyPI by typing this command:

pip install -U fins-driver

Usage

Below is an example on how to use the client class.

from fins import FinsClient

client = FinsClient(host='192.168.250.1', port=9600)
response = client.memory_area_read('D0')
print(response.data)
client.close()

Memory Area Read

.memory_area_read(address: str | bytes, num_items: int = 1) -> Response[bytes]

Examples:

Read DM area at word 0.

response = client.memory_area_read('D0')

Read CIO area at word 100 and bit 01.

response = client.memory_area_read('CIO100.01')

Memory Area Write

.memory_area_write(address: str | bytes, data: bytes, num_items: int = 1) -> Response[bytes]

Examples:

Write to CIO area at word 100. It will turn on CIO100.00 and CIO100.01. Hex value \x00\x03 is translated to 0000 0000 0000 0011 in binary.

response = client.memory_area_write("CIO100", b"\x00\x03")

Write to CIO area at word 100 and bit 01. We only need to provide 1 bytes data to write bit status. Hex value \x01 is translated to ON, while \x00 is translated to OFF.

response = client.memory_area_write("CIO100.01", b"\x01")

Memory Area Fill

.memory_area_fill(address: str | bytes, data: bytes, num_items: int = 1) -> Response[bytes]

Examples:

Fill DM area word with \x00\x03.

response = client.memory_area_fill("D0", b"\x00\x03")

Multiple Memory Area Read

.multiple_memory_area_read(*addresses: str | bytes) -> Response[List[bytes]]

Examples:

Read multiple memory area words.

response = client.multiple_memory_area_read("D0", "D1")

Read multiple memory area bits.

response = client.multiple_memory_area_read("CIO100.00", "CIO100.01")

Memory Area Transfer

.memory_area_transfer(source_address: str | bytes, dest_address: str | bytes, num_items: int = 1) -> Response[bytes]

Examples:

Transfer memory area word from D0 to D1.

response = client.memory_area_transfer("D0", "D1")

Run

.run(mode: debug | monitor | run = "monitor", program_number: bytes = b"\xff\xff") -> Response[bytes]

Examples:

Change PLC to run in monitor mode.

response = client.run("monitor")

Stop

.stop() -> Response[bytes]

Examples:

Stop PLC device.

response = client.stop()

Forced Set/Reset

.forced_set_reset(*specs: SetResetSpec) -> Response[bytes]

Examples:

Force-set ON the CIO0.01.

from fins import SetResetSpecCode, SetResetSpec

response = client.forced_set_reset(SetResetSpec(SetResetSpecCode.FORCE_SET, "CIO0.01"))

Forced Set/Reset Cancel

.forced_set_reset_cancel() -> Response[bytes]

Examples:

Cancel all bits that have been forced ON or OFF.

response = client.forced_set_reset_cancel()

Memory Areas

Below is supported memory areas prefix.

Prefix Description
CIO Core IO area
W Work area
H Holding area
A Auxiliary area
D Data Memory area

For the core IO area, you can omit the prefix. For example, address 100.01 is the same as CIO100.01.

Response Object

Property/Method Type Description
data T Response data. Refer to each command to see data type.
code bytes Response code, primarily \x00\x00 if it's OK.
status_text str Textual description of the response code.
ok bool True if request was OK (Normal completion).
raw_data bytes Original unparsed response data.
raw bytes The overall raw content of response.
header Header Response header data.
command Command The request command that was sent to the device.

License

MIT

Metadata

Release files for fins-driver 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fins-driver 0.3.1
File Size Uploaded
fins_driver-0.3.1.tar.gz 10.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fins-driver 0.3.1
File Interpreter ABI Platform
fins_driver-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 22.7 kB

Release files / fins_driver-0.3.1.tar.gz

Download URL fins_driver-0.3.1.tar.gz
Size 10.7 kB
Tags Source
SHA-256 checksum
How to use checksums
20c8119117fd566b42b1c4bc61f19836ab3c322ba855df4d910f83f2b406415f
BLAKE2b-256 checksum
How to use checksums
988bffeb06b1445be599cda7b81d3f26cd67a472de363c6eb74054c78377b24f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.13.0

Release files / fins_driver-0.3.1-py3-none-any.whl

Download URL fins_driver-0.3.1-py3-none-any.whl
Size 12.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
89c94d462757dc059718df70aeac371234184a97c8a62e09a19f8ee06241ca45
BLAKE2b-256 checksum
How to use checksums
c913f08e544ebeabccb7c2df41fbfe303614b143284e75c6a49df6e69fcd95ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.13.0

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

1 release file

0.2.0

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page