Skip to content

Add P1-04TRS #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ let modules = [
}, {
name: "P1-08TD-TTL",
imageWidth: "130px"
}, {
name: "P1-04TRS",
imageWidth: "200px"
}, {
name: "P1-08TRS",
imageWidth: "200px"
Expand Down
116 changes: 116 additions & 0 deletions modules/P1-04TRS/P1-04TRS.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
<!DOCTYPE html>
<html lang="en">

<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-157182554-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'UA-157182554-1');
</script>
<meta charset="utf-8">
<title>P1-04TRS | P1AM Documentation</title>
<link href="https://fonts.googleapis.com/css?family=Roboto&display=swap" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="../../styles.css">
<link rel="stylesheet" type="text/css" href="../../highlight/styles/arduino-light.css">
<link rel="shortcut icon" type="image/png" href="../../favicon.png"/>

<script src="../../modules.js"></script>
<script src="../../main.js"></script>
<script src="../../highlight/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</head>

<body>
<div class="sidebar">
<div class="sidebar-header">
<a id="title" href="/index.html">P1AM</a>
</div>
<ul class="sidebar-content"></ul>
</div>
<div class="header">
<h1>P1-04TRS</h1>
<h2>Isolated Relay Output</h2>
<div class="line"></div>
</div>
<div class="content">
<div class="description">
<p class="start">This function writes the state of a single channel.</p>
<div class="change-container">
<button class="change-cpp active">Arduino</button>
<button class="change-py">Python</button>
</div>
<div class="code-block">
<pre><code class="cpp">P1.writeDiscrete(HIGH,1,2); // Turn on slot 1 channel 2</code></pre>
<pre style="display: none;"><code class="py">base[1][2].value = 1 # Turn on slot 1 channel 2</code></pre>
</div>
<p class="start">This function writes the state of all 4 channels. It turns channels 1-3 on and turns channel 4 off.</p>
<div class="change-container">
<button class="change-cpp active">Arduino</button>
<button class="change-py">Python</button>
</div>
<div class="code-block">
<pre><code class="cpp">P1.writeDiscrete(0x07, 1); // Write state of all channels for slot 1</code></pre>
<pre style="display: none;"><code class="py">base[1].do_bitmapped(0x07) # Write state of all channels for slot 1</code></pre>
</div>
</div>
<div class="compatible">
<ul class="cpp-content">
<h3>Compatible Functions</h3>
<div class="line"></div>
<ul>
<li><a href="/api_reference.html#writeDiscrete">P1.writeDiscrete()</a></li>
</ul>
</ul>
<ul class="python-content">
<h3>Properties and Methods</h3>
<div class="line"></div>
<br>
<div class="code-block">
<pre style="display: none;"><code class="py">import P1AM
base = P1AM.Base()
module = base[1] # Slot 1
ch = module[2] # Channel 2
</code></pre>
</div>
<!-- Channel -->
<li><a href="/api_reference.html#value">ch.value</a></li>
<!-- Module -->
<li><a href="/api_reference.html#values">module.values</a></li>
<li><a href="/api_reference.html#doBitmapped">module.do_bitmapped()</a></li>
<!-- Base -->
<li><a href="/api_reference.html#pyBaseWriteDiscrete">base.writeDiscrete()</a></li>
</ul>
</div>
<div class="status">
<h3>Module Configuration and Status Tables</h3>
<div class="line"></div>
<p>This module does not provide any status data and does not require configuration.</p>
</div>
<div class="image-box">
<img src="pv_p104trs_04.jpg">
<div class="line"></div>
<p><b>Channels: </b>4<br>
<b>Discrete Output Type: </b> 4 Relays - FORM C (SPDT)<br>
<b>Rated Voltage: </b>30 VDC, 100-240 VAC<br>
<b>Example: </b>
<br>
<a href="https://github.com/facts-engineering/P1AM/blob/master/examples/Basic/DiscreteOutput/DiscreteOutput.ino">Arduino</a>
<br>
<a href="https://github.com/facts-engineering/CircuitPython_P1AM/tree/main/examples/discrete_output.py">CircuitPython</a>
</p>

<p><b>Additional Resources: </b><br>
<a href="https://cdn.automationdirect.com/static/specs/P1-04TRS.pdf">Data Sheet<br></a>
<a
href="https://www.automationdirect.com/adc/shopping/catalog/programmable_controllers/open_source_controllers_(arduino-compatible)/productivityopen_(arduino-compatible)/industrial_i-z-o_(p1k)/P1-04TRS">P1-04TRS on AutomationDirect.com</a>
</p>
</div>
</div>
</body>

</html>
Binary file added modules/P1-04TRS/pv_p104trs_04.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.