Getting started

How to install

To install this package use is required Python >= 3.9

pip install trgenpy

Architecture

As explained in this Mermaid diagram, it is possible to program n (0-25) TrgenPorts to the TrgenClient

Diagram 0

Import the library

# you can import 
# library like this:
import trgenpy as tp
client = tp.TrgenClient()

# or like this:
from from trgenpy import TrgenClient,TrgenPin,istrActiveFor,istrUnactiveFor,istrEnd,istrWaitNE,istrWaitPE
client = TrgenClient()

Client

The TrgenClient object stores all the information about the socket connection between the user PC and the TrGEN Device. It may be istantiated like this:

client = TrgenClient() # now I can use this client for any purpose.

Once the client object is created, connection between user PC and TrGEN Device is achieved with:

client.connect()

It is also possible to check the availability of the device (useful to check if properly connected)

isAavailable = client.is_available() # true / false