Skip to content

Commit 2f356df

Browse files
committed
Feat: V1.0 Rrelease
1 parent 8c5ed2b commit 2f356df

30 files changed

+935
-1021
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# ignore all files as long asd ST is not supported by linguist https://github.com/github/linguist
2+
** linguist-vendored

.github/workflows/github-action-release_for_template.yml

Lines changed: 0 additions & 99 deletions
This file was deleted.

.github/workflows/release-library.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
on:
2+
push:
3+
# Pattern matched against refs/tags
4+
tags:
5+
- '*'
6+
7+
jobs:
8+
release-apax-lib:
9+
uses: simatic-ax/actions/.github/workflows/apax-publish.yml@stable
10+
secrets:
11+
APAX_TOKEN: ${{ secrets.APAX_TOKEN }}
12+
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
13+
14+
with:
15+
VERSION: ${{ github.ref_name }}

README.md

Lines changed: 70 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,39 @@
11
# PLCopen Snippets
22

33
The following block-template snippets for AX Code are based on the
4-
PLCopen standard **'Function Blocks for Motion Control' V2.0** which can also be found in the LGF library for TIA Portal [here](https://support.industry.siemens.com/cs/ww/en/view/109479728).
4+
PLCopen-like standard **'Function Blocks for Motion Control' V2.0** which can also be found in the LGF library for TIA Portal [here](https://support.industry.siemens.com/cs/ww/en/view/109479728).
55

6-
Besides this collection consists of 6 PLCopen snippets (3x "Execute"-variants / 3x "Enable"-variants) we also added 4x basic FC's and 4x basic FB's variants inspired by PLCopen that should emphasise you to build more predictable block interfaces.
6+
This collection consists of 6x PLCopen FB code-snippets (3x "Execute"-variants / 3x "Enable"-variants) plus 2x complementary structured-types. We also added 4x basic FC's and 4x basic FB's variants inspired by PLCopen, which in addition should emphasise you to build more predictable blocks(interfaces) with standardized execution behaviours.
7+
These vscode snippets gives you a head-start in content creation for your very own SIMATIC AX library or application.
78

9+
## About: PLCopen <br/>
10+
*"The PLCopen organization has defined a standard for Motion Control blocks. This standard can be generalized in that way, that it can be applied to all asynchronous blocks. Asynchronous means in this context, that the execution of the function inside the block extends over multiple (more than one) execution cycles of the PLC, e.g. for communication, closed loop control or motion control applications."*
811
<br/>
912
<br/>
1013

11-
## Install the snippets collection
14+
### A function block with an **"enable"** - behaviour:
15+
*"Blocks which are started and initialized only once and afterwards remain in operation to respond to inputs have an "enable" input parameter.
16+
Example: A communication block (acting as server) waits after initialization for incoming connection requests from a client. After a successful data exchange the server waits for other incoming connection requests.
17+
Setting the parameter "enable" starts the execution of an asynchronous task. If "enable" remains set, the task execution remains active and new values are being accepted and processed.
18+
Resetting the parameter "enable" will shut down the working state of the block."*
19+
.. read [more](https://support.industry.siemens.com/cs/ww/en/view/109479728)
20+
> #continuous-asynchronous #enable
21+
22+
<br/>
23+
24+
25+
### A function block with an **"execute"** - behaviour:
26+
*"Blocks, which get executed only once have an input parameter "execute".
27+
Example: A communication block (client) requests data of a server only once. This is triggered by an edge at the input signal "execute". After the processing the reply the execution is done. A new request is placed by another edge on "execute". A rising edge on "execute" starts the task and the values at the input parameters are applied.
28+
Any changes to the values after the start of the task only take effect after a start of a new task, unless "continuousUpdate" is being used.
29+
The reset of the parameter "execute" does no stop the execution of the current task but has an influence on the display duration of the execution status. If "execute" gets reset before the current task has finished, then the parameter "done", "error" and "commandAborted" will be set for only one cycle."*
30+
.. read [more](https://support.industry.siemens.com/cs/ww/en/view/109479728) <br/>
31+
> #single-asynchronous #execute
32+
33+
<br/>
34+
<br/>
35+
36+
# Install the snippets collection
1237

1338
Before installing the snippets collection, the URL to the package registry need to be defined in the apax.yml
1439

@@ -17,47 +42,60 @@ registries:
1742
'@simatic-ax': 'https://npm.pkg.github.com/'
1843
```
1944
20-
To install the snippets collection to your workspace enter the following command in a terminal:
45+
Install the snippets collection to your workspace by entering the following command in a terminal:
2146
2247
```bash
2348
apax add @simatic-ax/plcopen-snippets --dev
2449
```
2550

26-
> To install this package you need to login into the GitHub registry. You'll find more information [here](https://github.com/simatic-ax/.sharedstuff/blob/main/doc/personalaccesstoken.md).
27-
> Installing snippet-packages to your project / ax code-instance may cause you to restart the IDE in order to make them work for the intellicense.
51+
> - For installing this package you need to login into the GitHub registry. You'll find more information [here](https://github.com/simatic-ax/.sharedstuff/blob/main/doc/personalaccesstoken.md).
52+
> - Installing snippet-packages to your project / ax code-instance may cause you to restart the IDE in order to make them work for the intellicense.
2853
2954
<br/>
3055
<br/>
3156

32-
## Insert PLCopen block templates
33-
34-
Available variants:
57+
## Use PLCopen block templates
58+
You can use the intellicense in the scope of a .st file to make use of the snippets. <br>
59+
Just start typing-in the following available variants:
3560

3661
```json
37-
"fb enable" : [" 1_simple | 2_adv | 3_adv "]
62+
"fb, plcopen, enable," : [" 1_simple | 2_adv | 3_adv "]
3863
```
3964

4065
```json
41-
"fb execute" : [" 1_simple | 2_adv | 3_adv "]
66+
"fb, plcopen, execute," : [" 1_simple | 2_adv | 3_adv "]
4267
```
4368

4469
Differences: <br>
4570

4671
- all variants consists of the corresponding statemachines, all its needed variables and an proper error/ output-handling
47-
- all *"_adv"* variants have an additional diagnostic-structure handling holding on to the block last error info
72+
- all *"#_adv"* variants have an additional diagnostic-structure handling holding on to the block last error info
4873
- the *"3_adv"* variant adds a frame to abort the enable/execute statemachines beforehand
74+
75+
Complementary plc-types: <br>
4976

50-
<details open>
51-
<summary>Show Output example:</summary>
77+
```json
78+
"type, plcopen," : ["Diagnostics struct"]
79+
```
80+
81+
```json
82+
"type, plcopen," : ["FbStates enum"]
83+
```
84+
These types can be used to complete a clean block & type plcopen construct. After insertion you easily can change the name and it's type-references in the block-templates by
85+
86+
<details close>
87+
<summary>Show usage example:</summary>
5288

53-
![io](doc/img/plcopen_insert.gif)
89+
![io](doc/img/plcopen_snippets.gif)
5490

5591
</details>
56-
<br/>
5792

58-
## Insert general block templates
93+
<br/>
94+
<br/>
5995

60-
Available variants:
96+
## Use general block templates
97+
You can use the intellicense in the scope of a .st file to make use of the snippets. <br>
98+
Just start typing-in the following available variants:
6199

62100
```json
63101
"fb" : [" 1_simple | 2_simple | 3_simple | 4_adv "]
@@ -74,28 +112,34 @@ Differences: <br>
74112
- the *"3_simple"* variant additional have a subfunction block-status info
75113
- the *"4_adv"* variant have an additional diagnostic-structure handling holding on to the block last error info
76114

77-
<details open>
78-
<summary>Show Output example:</summary>
115+
<details close>
116+
<summary>Show usage example:</summary>
79117

80-
![io](doc/img/generalblock_insert.gif)
118+
![io](doc/img/generalblocks_snippets.gif)
81119

82120
</details>
83121
<br/>
84122
<br/>
85123

86-
## Notes from the developer
124+
# Notes from the developer
125+
126+
BEWARE !
127+
- This package currently has no ST OOP content
128+
- This package only ships .json vs-code snippet files that work for .st files
129+
- The code-snippets follow our [SIMATIC AX style-guide](https://console.simatic-ax.siemens.io/docs/st-styleguide) for ST-programming
130+
- The snippets may or may not include TIAX restrictions, which unfortunatly cause unwanted transformations or compile errors using it blank in "AX2TIA" library-projects, that used to be converted to TIA Portal. Please always check back the latest [news](https://console.simatic-ax.siemens.io/docs/ax2tia/restrictions) on these restrictions. There are no workarounds implemented.
131+
<br>
87132

88-
BEWARE ! This package has no ST OOP content and currently include TIAX restrictions, which unfortunatly will cause compile errors using it blank in "AX2TIA" projects. Otherwise it's fine. <br>
89-
We are working on it.
133+
Happy coding ...
90134

91135
🐱‍💻 BEEP, BOOP, BEEP, BEEP, BOOP 🐱‍🏍
92136

93137
<br/>
94138
<br/>
95139

96-
## Contribution
140+
# Contribution
97141

98-
Thanks for your interest in contributing. Anybody is free to report bugs, unclear documentation, and other problems regarding this repository in the "Issues" section or, even better, is free to propose any changes to this repository using "Merge-Requests".
142+
Thanks for your interest in contributing. Anybody is free to report bugs, improvements, unclear documentation, and other problems regarding this repository in the "Issues" section ... or, even better, is free to propose any changes to this repository using "Merge-Requests". The CODEOWNERS will take care.
99143

100144
## License and Legal information
101145

apax.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,21 @@ name: '@simatic-ax/plcopen-snippets'
33
version: 1.0.0-placeholder
44
author: Siemens AG
55
# Description will be displayed in the apax extension
6-
description: This package contains PLCopen block templates as snippets for ST programming in SIMATIC AX
7-
type: generic
6+
description: This package contains PLCopen block templates as vscode snippets for ST
7+
programming in SIMATIC AX
8+
type: lib
89
#URL to the repository
910
repository:
1011
type: git
1112
url: https://github.com/simatic-ax/plcopen-snippets
1213
# Registry information, where the package will be published
1314
registries:
14-
'@ax-showcase': 'https://npm.pkg.github.com/'
15+
'@simatic-ax': 'https://npm.pkg.github.com/'
1516
# Files, which will be shipped with the library
1617
files:
1718
- 'README.md'
1819
- 'LICENSE.md'
1920
- 'doc'
20-
- 'snippets'
21+
- 'snippets'
22+
devDependencies:
23+
"@ax/sdk": 3.0.18

doc/img/generalblock_insert.gif

-1.11 MB
Binary file not shown.

doc/img/generalblocks_snippets.gif

2.92 MB
Loading

doc/img/plcopen_insert.gif

-3.06 MB
Binary file not shown.

doc/img/plcopen_snippets.gif

2.49 MB
Loading

snippets/BlockFrames/FbGeneralFrame.json

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)