Skip to main content

An Example of How To Use the Package

from pycat3 import PyCat3, EdgeTrigger

pc3 = PyCat3()

OR

pc3 = PyCat3(ip='127.0.0.1.1.1', port=851)

write a tag

pc3.write_tag('MAIN.nAlive', 9)

read a tag

print(pc3.read_tag('MAIN.nAlive')

Tags change notification subscription

Make lists of the tags to be monitored (Types: Integer, REAL, BOOL)

tags_int = ['MAIN.Int1', 'MAIN.Int2']

tags_real = ['MAIN.Real1']

tags_bool = ['MAIN.Bool1']

call monitor method from ads instance

pc3.monitor(monitored_int=tags_int, monitored_real=tags_real, monitored_bool=tags_bool)

Access 'data' dictionary to read a certain tag

print(pc3.data['MAIN.Int1'])

Use of Edge Detector

Create your callback function

def my_callback(oldVal, newVal):

print(f"Value changed from {oldVal} to {newVal}.") 

Create EdgeTrigger object wit callback function as argument

detector = EdgeTrigger(my_callback)

Call the detector with the monitored PLC tag

detector1(pc3.data['MAIN.Int1'])

Release files for pycat3 0.6

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

Source distribution (sdist)

Source distribution for pycat3 0.6
File Size Uploaded
pycat3-0.6.tar.gz 3.3 kB Details

Release files / pycat3-0.6.tar.gz

Download URL pycat3-0.6.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
c285329256ccf3247cd0c13ec27483e15f6c6ca7509d6bf2c4f69b4514a8a8a7
BLAKE2b-256 checksum
How to use checksums
079a8236971ff45dd8ce3f3b9285de60e3c2238c2c8450e860ee25cf7cb528f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release history Release notifications | RSS feed

This release

0.6 This release

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