-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
made tcp client somewhat available, added most basic documentation ex…
…amples
- Loading branch information
1 parent
5cf9f08
commit 75f1887
Showing
5 changed files
with
90 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Performing Automatic Configuration with an SEL Relay | ||
|
||
SEL Protocol operates in a self-describing manner wherein the relay or intelligent electronic | ||
device provides a standard interface for binary messages to describe the layout of specific | ||
data regions. This makes it possible for the relay to describe the methods in which a user may | ||
query the device for data, send control operations, or otherwise interact with the relay. | ||
|
||
SELProtoPy provides mechanisms for the client objects to negotiate the automatic configuration | ||
process with a device to establish the devices capabilities. | ||
|
||
## Autoconfiguration with a Serially-Connected Device | ||
|
||
The following example assumes a Linux environment using a USB-to-serial adapter (thus the | ||
`/dev/ttyUSB1`) in use. | ||
|
||
```python | ||
# Import the serial client object from SELProtoPy | ||
from selprotopy.client import SerialSELClient | ||
|
||
# Define the connection parameters | ||
PORT = '/dev/ttyUSB1' | ||
BAUD = 9600 | ||
|
||
# Establish the connection - this will NOT start the autoconfiguration | ||
client = SerialSELClient(port=PORT, baudrate=BAUD) | ||
|
||
# Start the Automatic Configuration process | ||
client.autoconfigure() | ||
|
||
# If no exceptions are raised, the configuration process has succeeded | ||
|
||
# Poll the relay using fast-meter | ||
client.poll_fast_meter() | ||
``` | ||
|
||
## Autoconfiguration with a Ethernet-Connected Device | ||
|
||
The following example uses a raw TCP socket connection (does not use `telnetlib`) to | ||
establish a connection with the relay. | ||
|
||
```python | ||
# Import the TCP client object from SELProtoPy | ||
from selprotopy.client import TCPSELClient | ||
|
||
# Define the connection parameters | ||
IP = '192.168.1.100' | ||
TCP_PORT = 23 | ||
|
||
# Establish the connection - this will NOT start the autoconfiguration | ||
client = TCPSELClient(ip_address=IP, port=TCP_PORT) | ||
|
||
# Start the Automatic Configuration process | ||
client.autoconfigure() | ||
|
||
# If no exceptions are raised, the configuration process has succeeded | ||
|
||
# Poll the relay using fast-meter | ||
client.poll_fast_meter() | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Examples of SELProtoPy in Action | ||
|
||
SELProtoPy may be used for a variety of standard interactions with SEL relays. The following | ||
references are a variety of example use-cases or implementations of the SELProtoPy package. | ||
Do not mistake them as recommendations, they are provided here as a support for education | ||
surrounding this tool. | ||
|
||
```{toctree} | ||
--- | ||
maxdepth: 1 | ||
--- | ||
examples/* | ||
``` | ||
|
||
```{note} | ||
It's important to acknowledge that although SEL Protocol is largely standardized, this library | ||
has only been used on, or tested against a limited set of SEL intelligent electronic devices. | ||
As such you may encounter errors where such devices do not behave in an expected fashion. | ||
In such cases, it is requested that an issue is opened on | ||
[GitHub](https://github.com/engineerjoe440/selprotopy/issues) to make maintainers aware of the | ||
problem. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,7 @@ maxdepth: 1 | |
--- | ||
selprotopy | ||
examples | ||
``` | ||
|
||
```{warning} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters