Skip to content
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

Added CTUD, TP and more details for RS and SR blocks #30

Open
wants to merge 18 commits 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
4 changes: 2 additions & 2 deletions reference/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ nav: start
- [Falling Trigger (F_TRIG)](standard-function-blocks/falling-trigger)
- [Counter Up (CTU)](standard-function-blocks/counter-up)
- [Counter Down (CTD)](standard-function-blocks/counter-down)
- Counter Up-Down (CTUD)
- Timer Pulse (TP)
- [Counter Up-Down (CTUD)](standard-function-blocks/counter-up-down)
- [Timer Pulse (TP)](standard-function-blocks/timer-pulse)
- [Timer On (TON)](standard-function-blocks/timer-on)
- [Timer Off (TOF)](standard-function-blocks/timer-off)

Expand Down
14 changes: 14 additions & 0 deletions reference/standard-function-blocks/counter-up-down.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
layout: inset
title: Counter Up-Down
---

## Introduction

The up-down counter can be used to both increment and decrement the same counter variable `CV`.
A pulse on the reset input `R` resets the value of `CV` to 0.
A pulse on the maximum value `PV` will initialize `CV` to `PV`.
Each time the input `CU` is set to `TRUE`, `CV` is incremented by 1, provided that `CV` is less than the maximum value `PV`.
Each time the input `CD` is set to `TRUE`, `CV` is decremented by 1, provided that `CV` is greater than 0.
The output `QU` is set to `TRUE` when `CV` is greater than or equal to `PV`.
The output `QD` is set to `TRUE` when `CV` is is less than or equal to 0.
45 changes: 45 additions & 0 deletions reference/standard-function-blocks/rs-bistable.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,48 @@ title: RS Bistable
This function block maintains its output in one of two stable states `TRUE` or `FALSE`.
The output can be set or reset by applying a `TRUE` signal to the `Set` or `Reset` inputs.
If both inputs are `TRUE` the output is `FALSE`.

![](rs-symbol.png)

## VAR_INPUT

```
VAR_INPUT
S : BOOL;
R1 : BOOL;
END_VAR
```

## VAR_OUTPUT

```
VAR_OUTPUT
Q1 : BOOL;
END_VAR
```
Internal implementation:

```
Q1 := (NOT R1) AND (S OR Q1);
```

## Pinout Description

| Pin Name | Signal | Data Type | Description |
|------------|--------|-----------|----------------------------------------------------------------|
| `S` | Input | `BOOL` | Set. This input puts the output in `TRUE` state. |
| `R1` | Input | `BOOL` | Reset (dominant). This input puts the output in `FALSE` state. |
| `Q1` | Output | `BOOL` | Q. This is the output. |

## Truth Table

| S | R1 | Q1 | Description |
|---|----|----------------|--------------------------------|
| 0 | 0 | Q<sub>-1</sub> | Q retains its previous state |
| 0 | 1 | 0 | Q is `FALSE` |
| 1 | 0 | 1 | Q is `TRUE` |
| 1 | 1 | 0 | Q is `FALSE` |

## Time Diagram

![](rs-time-diagram.png)
Binary file added reference/standard-function-blocks/rs-symbol.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions reference/standard-function-blocks/sr-bistable.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,48 @@ title: SR Bistable
This function block maintains its output in one of two stable states `TRUE` or `FALSE`.
The output can be set or reset by applying a `TRUE` signal to the `Set` or `Reset` inputs.
If both inputs are `TRUE` the output is `TRUE`.

![](sr-symbol.png)

## VAR_INPUT

```
VAR_INPUT
S1 : BOOL;
R : BOOL;
END_VAR
```

## VAR_OUTPUT

```
VAR_OUTPUT
Q1 : BOOL;
END_VAR
```
Internal implementation:

```
Q1 := S1 OR ((NOT R) AND Q1);
```

## Pinout Description

| Pin Name | Signal | Data Type | Description |
|----------|--------|-----------|----------------------------------------------------------------|
| `S` | Input | `BOOL` | Set. This input puts the output in `TRUE` state. |
| `R1` | Input | `BOOL` | Reset (dominant). This input puts the output in `FALSE` state. |
| `Q1` | Output | `BOOL` | Q. This is the output. |

## Truth Table

| S1 | R | Q1 | Description |
|----|---|----------------|--------------------------------|
| 0 | 0 | Q<sub>-1</sub> | Q retains its previous state |
| 0 | 1 | 0 | Q is `FALSE` |
| 1 | 0 | 1 | Q is `TRUE` |
| 1 | 1 | 1 | Q is `TRUE` |

## Time Diagram

![](sr-time-diagram.png)
Binary file added reference/standard-function-blocks/sr-symbol.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions reference/standard-function-blocks/timer-pulse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
layout: inset
title: Timer Pulse
---

## Introduction

The pulse timer can be used to generate pulses with a defined duration.
If the input `IN` is set to `TRUE`, the output `Q` also becomes `TRUE` for the duration of the pulse time `PT`.
`Q` remains `TRUE` until the current time `ET` reaches `PT`, regardless of the state of `IN`.