├── .Zeugwerk
└── config.json
├── .github
└── workflows
│ ├── build.yml
│ └── documentation.yml
├── .gitignore
├── Benchmark
├── Benchmark.tsproj
├── Benchmark
│ ├── Benchmark.plcproj
│ ├── POUs
│ │ ├── MAIN.TcPOU
│ │ └── MovingStatistic
│ │ │ └── MovingStatistic.TcPOU
│ └── PlcTask.TcTTO
└── benchmark_plot.py
├── Example
├── Example.tsproj
└── Example
│ ├── Example.plcproj
│ ├── POUs
│ └── MAIN.TcPOU
│ └── PlcTask.TcTTO
├── LICENSE
├── README.md
├── Twinson.sln
├── Twinson
├── Twinson.tspproj
├── Twinson.tspproj.bak
└── Twinson
│ ├── JsonDecoder
│ ├── IJsonElement.TcIO
│ ├── JsonDecoder.TcPOU
│ ├── JsonElement.TcPOU
│ ├── JsonElementType.TcDUT
│ ├── JsonNode.TcDUT
│ └── _Test
│ │ └── JsonDecoderTest.TcPOU
│ ├── ParameterList.TcGVL
│ ├── Twinson.plcproj
│ └── UnitTest
│ ├── IAssertions.TcIO
│ └── IUnittest.TcIO
└── benchmark_2.png
/.Zeugwerk/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "fileversion": 1,
3 | "solution": "Twinson.sln",
4 | "projects": [
5 | {
6 | "name": "Twinson",
7 | "plcs": [
8 | {
9 | "version": "0.2.0.0",
10 | "name": "Twinson",
11 | "type": "Library",
12 | "frameworks": {},
13 | "references": {},
14 | "repositories": [],
15 | "bindings": {},
16 | "patches": {
17 | "platform": {},
18 | "argument": {}
19 | }
20 | }
21 | ]
22 | }
23 | ]
24 | }
25 |
--------------------------------------------------------------------------------
/.github/workflows/build.yml:
--------------------------------------------------------------------------------
1 | name: Build/Test
2 | on:
3 | push:
4 | branches:
5 | - main
6 | pull_request:
7 | branches: [ main ]
8 | workflow_dispatch:
9 | jobs:
10 | Build:
11 | name: Build/Test
12 | runs-on: ubuntu-latest
13 | steps:
14 | - uses: actions/checkout@v3
15 | - name: Build
16 | uses: Zeugwerk/zkbuild-action@1.0.0
17 | with:
18 | username: ${{ secrets.ACTIONS_ZGWK_USERNAME }}
19 | password: ${{ secrets.ACTIONS_ZGWK_PASSWORD }}
20 | - name: Publish Unittest
21 | uses: EnricoMi/publish-unit-test-result-action@v1
22 | with:
23 | files: archive/test/**/TcUnit_xUnit_results.xml
24 | - name: Upload
25 | uses: actions/upload-artifact@v3
26 | with:
27 | name: Twinson
28 | path: |
29 | **/*.compiled-library
30 |
--------------------------------------------------------------------------------
/.github/workflows/documentation.yml:
--------------------------------------------------------------------------------
1 | name: Documentation
2 | on:
3 | push:
4 | branches:
5 | - main
6 | paths:
7 | - 'documentation/**'
8 | pull_request:
9 | workflow_dispatch:
10 | jobs:
11 | Build:
12 | name: Documentation
13 | runs-on: ubuntu-latest
14 | steps:
15 | - name: Build
16 | uses: Zeugwerk/zkdoc-action@1.0.0
17 | with:
18 | username: ${{ secrets.ACTIONS_ZGWK_USERNAME }}
19 | password: ${{ secrets.ACTIONS_ZGWK_PASSWORD }}
20 | - name: Deploy
21 | uses: peaceiris/actions-gh-pages@v3
22 | with:
23 | deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
24 | publish_dir: archive/documentation/html
25 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .Zeugwerk/libraries
2 | test
3 | # TwinCAT files
4 | *.tpy
5 | *.tclrs
6 | *.compiled-library
7 | *.compileinfo
8 | # Don't include the tmc-file rule if either of the following is true:
9 | # 1. You've got TwinCAT C++ projects, as the information in the TMC-file is created manually for the C++ projects (in that case, only (manually) ignore the tmc-files for the PLC projects)
10 | # 2. You've created a standalone PLC-project and added events to it, as these are stored in the TMC-file.
11 | *.tmc
12 | *.tmcRefac
13 | *.library
14 | *.project.~u
15 | *.tsproj.bak
16 | *.xti.bak
17 | LineIDs.dbg
18 | LineIDs.dbg.bak
19 | _Boot/
20 | _CompileInfo/
21 | _Libraries/
22 | _ModuleInstall/
23 |
24 | # User-specific files
25 | *.rsuser
26 | *.suo
27 | *.user
28 | *.userosscache
29 | *.sln.docstates
30 |
31 | # User-specific files (MonoDevelop/Xamarin Studio)
32 | *.userprefs
33 |
34 | # Mono auto generated files
35 | mono_crash.*
36 |
37 | # Build results
38 | [Dd]ebug/
39 | [Dd]ebugPublic/
40 | [Rr]elease/
41 | [Rr]eleases/
42 | x64/
43 | x86/
44 | [Ww][Ii][Nn]32/
45 | [Aa][Rr][Mm]/
46 | [Aa][Rr][Mm]64/
47 | bld/
48 | [Bb]in/
49 | [Oo]bj/
50 | [Ll]og/
51 | [Ll]ogs/
52 |
53 | # Visual Studio 2015/2017 cache/options directory
54 | .vs/
55 | # Uncomment if you have tasks that create the project's static files in wwwroot
56 | #wwwroot/
57 |
58 | # Visual Studio 2017 auto generated files
59 | Generated\ Files/
60 |
61 | # MSTest test Results
62 | [Tt]est[Rr]esult*/
63 | [Bb]uild[Ll]og.*
64 |
65 | # NUnit
66 | *.VisualState.xml
67 | TestResult.xml
68 | nunit-*.xml
69 |
70 | # Build Results of an ATL Project
71 | [Dd]ebugPS/
72 | [Rr]eleasePS/
73 | dlldata.c
74 |
75 | # Benchmark Results
76 | BenchmarkDotNet.Artifacts/
77 |
78 | # .NET Core
79 | project.lock.json
80 | project.fragment.lock.json
81 | artifacts/
82 |
83 | # ASP.NET Scaffolding
84 | ScaffoldingReadMe.txt
85 |
86 | # StyleCop
87 | StyleCopReport.xml
88 |
89 | # Files built by Visual Studio
90 | *_i.c
91 | *_p.c
92 | *_h.h
93 | *.ilk
94 | *.meta
95 | *.obj
96 | *.iobj
97 | *.pch
98 | *.pdb
99 | *.ipdb
100 | *.pgc
101 | *.pgd
102 | *.rsp
103 | *.sbr
104 | *.tlb
105 | *.tli
106 | *.tlh
107 | *.tmp
108 | *.tmp_proj
109 | *_wpftmp.csproj
110 | *.log
111 | *.tlog
112 | *.vspscc
113 | *.vssscc
114 | .builds
115 | *.pidb
116 | *.svclog
117 | *.scc
118 |
119 | # Chutzpah Test files
120 | _Chutzpah*
121 |
122 | # Visual C++ cache files
123 | ipch/
124 | *.aps
125 | *.ncb
126 | *.opendb
127 | *.opensdf
128 | *.sdf
129 | *.cachefile
130 | *.VC.db
131 | *.VC.VC.opendb
132 |
133 | # Visual Studio profiler
134 | *.psess
135 | *.vsp
136 | *.vspx
137 | *.sap
138 |
139 | # Visual Studio Trace Files
140 | *.e2e
141 |
142 | # TFS 2012 Local Workspace
143 | $tf/
144 |
145 | # Guidance Automation Toolkit
146 | *.gpState
147 |
148 | # ReSharper is a .NET coding add-in
149 | _ReSharper*/
150 | *.[Rr]e[Ss]harper
151 | *.DotSettings.user
152 |
153 | # TeamCity is a build add-in
154 | _TeamCity*
155 |
156 | # DotCover is a Code Coverage Tool
157 | *.dotCover
158 |
159 | # AxoCover is a Code Coverage Tool
160 | .axoCover/*
161 | !.axoCover/settings.json
162 |
163 | # Coverlet is a free, cross platform Code Coverage Tool
164 | coverage*.json
165 | coverage*.xml
166 | coverage*.info
167 |
168 | # Visual Studio code coverage results
169 | *.coverage
170 | *.coveragexml
171 |
172 | # NCrunch
173 | _NCrunch_*
174 | .*crunch*.local.xml
175 | nCrunchTemp_*
176 |
177 | # MightyMoose
178 | *.mm.*
179 | AutoTest.Net/
180 |
181 | # Web workbench (sass)
182 | .sass-cache/
183 |
184 | # Installshield output folder
185 | [Ee]xpress/
186 |
187 | # DocProject is a documentation generator add-in
188 | DocProject/buildhelp/
189 | DocProject/Help/*.HxT
190 | DocProject/Help/*.HxC
191 | DocProject/Help/*.hhc
192 | DocProject/Help/*.hhk
193 | DocProject/Help/*.hhp
194 | DocProject/Help/Html2
195 | DocProject/Help/html
196 |
197 | # Click-Once directory
198 | publish/
199 |
200 | # Publish Web Output
201 | *.[Pp]ublish.xml
202 | *.azurePubxml
203 | # Note: Comment the next line if you want to checkin your web deploy settings,
204 | # but database connection strings (with potential passwords) will be unencrypted
205 | *.pubxml
206 | *.publishproj
207 |
208 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
209 | # checkin your Azure Web App publish settings, but sensitive information contained
210 | # in these scripts will be unencrypted
211 | PublishScripts/
212 |
213 | # NuGet Packages
214 | *.nupkg
215 | # NuGet Symbol Packages
216 | *.snupkg
217 | # The packages folder can be ignored because of Package Restore
218 | **/[Pp]ackages/*
219 | # except build/, which is used as an MSBuild target.
220 | !**/[Pp]ackages/build/
221 | # Uncomment if necessary however generally it will be regenerated when needed
222 | #!**/[Pp]ackages/repositories.config
223 | # NuGet v3's project.json files produces more ignorable files
224 | *.nuget.props
225 | *.nuget.targets
226 |
227 | # Nuget personal access tokens and Credentials
228 | nuget.config
229 |
230 | # Microsoft Azure Build Output
231 | csx/
232 | *.build.csdef
233 |
234 | # Microsoft Azure Emulator
235 | ecf/
236 | rcf/
237 |
238 | # Windows Store app package directories and files
239 | AppPackages/
240 | BundleArtifacts/
241 | Package.StoreAssociation.xml
242 | _pkginfo.txt
243 | *.appx
244 | *.appxbundle
245 | *.appxupload
246 |
247 | # Visual Studio cache files
248 | # files ending in .cache can be ignored
249 | *.[Cc]ache
250 | # but keep track of directories ending in .cache
251 | !?*.[Cc]ache/
252 |
253 | # Others
254 | ClientBin/
255 | ~$*
256 | *~
257 | *.dbmdl
258 | *.dbproj.schemaview
259 | *.jfm
260 | *.pfx
261 | *.publishsettings
262 | orleans.codegen.cs
263 |
264 | # Including strong name files can present a security risk
265 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
266 | #*.snk
267 |
268 | # Since there are multiple workflows, uncomment next line to ignore bower_components
269 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
270 | #bower_components/
271 |
272 | # RIA/Silverlight projects
273 | Generated_Code/
274 |
275 | # Backup & report files from converting an old project file
276 | # to a newer Visual Studio version. Backup files are not needed,
277 | # because we have git ;-)
278 | _UpgradeReport_Files/
279 | Backup*/
280 | UpgradeLog*.XML
281 | UpgradeLog*.htm
282 | ServiceFabricBackup/
283 | *.rptproj.bak
284 |
285 | # SQL Server files
286 | *.mdf
287 | *.ldf
288 | *.ndf
289 |
290 | # Business Intelligence projects
291 | *.rdl.data
292 | *.bim.layout
293 | *.bim_*.settings
294 | *.rptproj.rsuser
295 | *- [Bb]ackup.rdl
296 | *- [Bb]ackup ([0-9]).rdl
297 | *- [Bb]ackup ([0-9][0-9]).rdl
298 |
299 | # Microsoft Fakes
300 | FakesAssemblies/
301 |
302 | # GhostDoc plugin setting file
303 | *.GhostDoc.xml
304 |
305 | # Node.js Tools for Visual Studio
306 | .ntvs_analysis.dat
307 | node_modules/
308 |
309 | # Visual Studio 6 build log
310 | *.plg
311 |
312 | # Visual Studio 6 workspace options file
313 | *.opt
314 |
315 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
316 | *.vbw
317 |
318 | # Visual Studio LightSwitch build output
319 | **/*.HTMLClient/GeneratedArtifacts
320 | **/*.DesktopClient/GeneratedArtifacts
321 | **/*.DesktopClient/ModelManifest.xml
322 | **/*.Server/GeneratedArtifacts
323 | **/*.Server/ModelManifest.xml
324 | _Pvt_Extensions
325 |
326 | # Paket dependency manager
327 | .paket/paket.exe
328 | paket-files/
329 |
330 | # FAKE - F# Make
331 | .fake/
332 |
333 | # CodeRush personal settings
334 | .cr/personal
335 |
336 | # Python Tools for Visual Studio (PTVS)
337 | __pycache__/
338 | *.pyc
339 |
340 | # Cake - Uncomment if you are using it
341 | # tools/**
342 | # !tools/packages.config
343 |
344 | # Tabs Studio
345 | *.tss
346 |
347 | # Telerik's JustMock configuration file
348 | *.jmconfig
349 |
350 | # BizTalk build output
351 | *.btp.cs
352 | *.btm.cs
353 | *.odx.cs
354 | *.xsd.cs
355 |
356 | # OpenCover UI analysis results
357 | OpenCover/
358 |
359 | # Azure Stream Analytics local run output
360 | ASALocalRun/
361 |
362 | # MSBuild Binary and Structured Log
363 | *.binlog
364 |
365 | # NVidia Nsight GPU debugger configuration file
366 | *.nvuser
367 |
368 | # MFractors (Xamarin productivity tool) working folder
369 | .mfractor/
370 |
371 | # Local History for Visual Studio
372 | .localhistory/
373 |
374 | # BeatPulse healthcheck temp database
375 | healthchecksdb
376 |
377 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
378 | MigrationBackup/
379 |
380 | # Ionide (cross platform F# VS Code tools) working folder
381 | .ionide/
382 |
383 | # Fody - auto-generated XML schema
384 | FodyWeavers.xsd
385 |
386 | # VS Code files for those working on multiple tools
387 | .vscode/*
388 | !.vscode/settings.json
389 | !.vscode/tasks.json
390 | !.vscode/launch.json
391 | !.vscode/extensions.json
392 | *.code-workspace
393 |
394 | # Local History for Visual Studio Code
395 | .history/
396 |
397 | # Windows Installer files from build outputs
398 | *.cab
399 | *.msi
400 | *.msix
401 | *.msm
402 | *.msp
403 |
404 | # JetBrains Rider
405 | .idea/
406 | *.sln.iml
407 |
--------------------------------------------------------------------------------
/Benchmark/Benchmark.tsproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | PlcTask
11 |
12 |
13 |
14 |
15 |
16 |
17 | Benchmark Instance
18 | {08500001-0000-0000-F000-000000000064}
19 |
20 |
21 | 0
22 | PlcTask
23 |
24 | #x02010030
25 |
26 | 20
27 | 1000000
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/Benchmark/Benchmark/Benchmark.plcproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1.0.0.0
4 | 2.0
5 | {1187505c-f72e-4dff-ae32-175ae96fde48}
6 | True
7 | true
8 | true
9 | false
10 | Benchmark
11 | 3.1.4023.0
12 | {fd4e6f3f-0361-4976-964d-531287b5481e}
13 | {501c71b9-0350-4260-9a9f-c938ab1b4a36}
14 | {f9db1e1d-7119-4b0d-a8d4-b8c386cd1bac}
15 | {7809e588-20b5-4d5c-b18d-a3b44cd0face}
16 | {f36edbee-2c5c-4333-8fa7-185baff44a28}
17 | {21d4754c-07ff-436d-8e3a-8620afaace93}
18 |
19 |
20 |
21 | Code
22 |
23 |
24 | Code
25 |
26 |
27 | Code
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 | Tc2_Standard, * (Beckhoff Automation GmbH)
40 | Tc2_Standard
41 |
42 |
43 | Tc2_System, * (Beckhoff Automation GmbH)
44 | Tc2_System
45 |
46 |
47 | Tc3_JsonXml, * (Beckhoff Automation GmbH)
48 | Tc3_JsonXml
49 |
50 |
51 | Tc3_Module, * (Beckhoff Automation GmbH)
52 | Tc3_Module
53 |
54 |
55 | Twinson, * (Stefan Besler)
56 | Twinson
57 |
58 |
59 |
60 |
61 | Content
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | "<ProjectRoot>"
70 |
71 | {40450F57-0AA3-4216-96F3-5444ECB29763}
72 |
73 | "{40450F57-0AA3-4216-96F3-5444ECB29763}"
74 |
75 |
76 | ActiveVisuProfile
77 | IR0whWr8bwfwBwAAiD2qpQAAAABVAgAA37x72QAAAAABAAAAAAAAAAEaUwB5AHMAdABlAG0ALgBTAHQAcgBpAG4AZwACTHsAZgA5ADUAYgBiADQAMgA2AC0ANQA1ADIANAAtADQAYgA0ADUALQA5ADQAMAAwAC0AZgBiADAAZgAyAGUANwA3AGUANQAxAGIAfQADCE4AYQBtAGUABDBUAHcAaQBuAEMAQQBUACAAMwAuADEAIABCAHUAaQBsAGQAIAA0ADAAMgA0AC4ANwAFFlAAcgBvAGYAaQBsAGUARABhAHQAYQAGTHsAMQA2AGUANQA1AGIANgAwAC0ANwAwADQAMwAtADQAYQA2ADMALQBiADYANQBiAC0ANgAxADQANwAxADMAOAA3ADgAZAA0ADIAfQAHEkwAaQBiAHIAYQByAGkAZQBzAAhMewAzAGIAZgBkADUANAA1ADkALQBiADAANwBmAC0ANABkADYAZQAtAGEAZQAxAGEALQBhADgAMwAzADUANgBhADUANQAxADQAMgB9AAlMewA5AGMAOQA1ADgAOQA2ADgALQAyAGMAOAA1AC0ANAAxAGIAYgAtADgAOAA3ADEALQA4ADkANQBmAGYAMQBmAGUAZABlADEAYQB9AAoOVgBlAHIAcwBpAG8AbgALBmkAbgB0AAwKVQBzAGEAZwBlAA0KVABpAHQAbABlAA4aVgBpAHMAdQBFAGwAZQBtAE0AZQB0AGUAcgAPDkMAbwBtAHAAYQBuAHkAEAxTAHkAcwB0AGUAbQARElYAaQBzAHUARQBsAGUAbQBzABIwVgBpAHMAdQBFAGwAZQBtAHMAUwBwAGUAYwBpAGEAbABDAG8AbgB0AHIAbwBsAHMAEyhWAGkAcwB1AEUAbABlAG0AcwBXAGkAbgBDAG8AbgB0AHIAbwBsAHMAFCRWAGkAcwB1AEUAbABlAG0AVABlAHgAdABFAGQAaQB0AG8AcgAVIlYAaQBzAHUATgBhAHQAaQB2AGUAQwBvAG4AdAByAG8AbAAWFHYAaQBzAHUAaQBuAHAAdQB0AHMAFwxzAHkAcwB0AGUAbQAYGFYAaQBzAHUARQBsAGUAbQBCAGEAcwBlABkmRABlAHYAUABsAGEAYwBlAGgAbwBsAGQAZQByAHMAVQBzAGUAZAAaCGIAbwBvAGwAGyJQAGwAdQBnAGkAbgBDAG8AbgBzAHQAcgBhAGkAbgB0AHMAHEx7ADQAMwBkADUAMgBiAGMAZQAtADkANAAyAGMALQA0ADQAZAA3AC0AOQBlADkANAAtADEAYgBmAGQAZgAzADEAMABlADYAMwBjAH0AHRxBAHQATABlAGEAcwB0AFYAZQByAHMAaQBvAG4AHhRQAGwAdQBnAGkAbgBHAHUAaQBkAB8WUwB5AHMAdABlAG0ALgBHAHUAaQBkACBIYQBmAGMAZAA1ADQANAA2AC0ANAA5ADEANAAtADQAZgBlADcALQBiAGIANwA4AC0AOQBiAGYAZgBlAGIANwAwAGYAZAAxADcAIRRVAHAAZABhAHQAZQBJAG4AZgBvACJMewBiADAAMwAzADYANgBhADgALQBiADUAYwAwAC0ANABiADkAYQAtAGEAMAAwAGUALQBlAGIAOAA2ADAAMQAxADEAMAA0AGMAMwB9ACMOVQBwAGQAYQB0AGUAcwAkTHsAMQA4ADYAOABmAGYAYwA5AC0AZQA0AGYAYwAtADQANQAzADIALQBhAGMAMAA2AC0AMQBlADMAOQBiAGIANQA1ADcAYgA2ADkAfQAlTHsAYQA1AGIAZAA0ADgAYwAzAC0AMABkADEANwAtADQAMQBiADUALQBiADEANgA0AC0ANQBmAGMANgBhAGQAMgBiADkANgBiADcAfQAmFk8AYgBqAGUAYwB0AHMAVAB5AHAAZQAnVFUAcABkAGEAdABlAEwAYQBuAGcAdQBhAGcAZQBNAG8AZABlAGwARgBvAHIAQwBvAG4AdgBlAHIAdABpAGIAbABlAEwAaQBiAHIAYQByAGkAZQBzACgQTABpAGIAVABpAHQAbABlACkUTABpAGIAQwBvAG0AcABhAG4AeQAqHlUAcABkAGEAdABlAFAAcgBvAHYAaQBkAGUAcgBzACs4UwB5AHMAdABlAG0ALgBDAG8AbABsAGUAYwB0AGkAbwBuAHMALgBIAGEAcwBoAHQAYQBiAGwAZQAsEnYAaQBzAHUAZQBsAGUAbQBzAC1INgBjAGIAMQBjAGQAZQAxAC0AZAA1AGQAYwAtADQAYQAzAGIALQA5ADAANQA0AC0AMgAxAGYAYQA3ADUANgBhADMAZgBhADQALihJAG4AdABlAHIAZgBhAGMAZQBWAGUAcgBzAGkAbwBuAEkAbgBmAG8AL0x7AGMANgAxADEAZQA0ADAAMAAtADcAZgBiADkALQA0AGMAMwA1AC0AYgA5AGEAYwAtADQAZQAzADEANABiADUAOQA5ADYANAAzAH0AMBhNAGEAagBvAHIAVgBlAHIAcwBpAG8AbgAxGE0AaQBuAG8AcgBWAGUAcgBzAGkAbwBuADIMTABlAGcAYQBjAHkAMzBMAGEAbgBnAHUAYQBnAGUATQBvAGQAZQBsAFYAZQByAHMAaQBvAG4ASQBuAGYAbwA0MEwAbwBhAGQATABpAGIAcgBhAHIAaQBlAHMASQBuAHQAbwBQAHIAbwBqAGUAYwB0ADUaQwBvAG0AcABhAHQAaQBiAGkAbABpAHQAeQDQAAIaA9ADAS0E0AUGGgfQBwgaAUUHCQjQAAkaBEUKCwQDAAAABQAAAA0AAAAAAAAA0AwLrQIAAADQDQEtDtAPAS0Q0AAJGgRFCgsEAwAAAAUAAAANAAAAKAAAANAMC60BAAAA0A0BLRHQDwEtENAACRoERQoLBAMAAAAFAAAADQAAAAAAAADQDAutAgAAANANAS0S0A8BLRDQAAkaBEUKCwQDAAAABQAAAA0AAAAUAAAA0AwLrQIAAADQDQEtE9APAS0Q0AAJGgRFCgsEAwAAAAUAAAANAAAAAAAAANAMC60CAAAA0A0BLRTQDwEtENAACRoERQoLBAMAAAAFAAAADQAAAAAAAADQDAutAgAAANANAS0V0A8BLRDQAAkaBEUKCwQDAAAABQAAAA0AAAAAAAAA0AwLrQIAAADQDQEtFtAPAS0X0AAJGgRFCgsEAwAAAAUAAAANAAAAKAAAANAMC60EAAAA0A0BLRjQDwEtENAZGq0BRRscAdAAHBoCRR0LBAMAAAAFAAAADQAAAAAAAADQHh8tINAhIhoCRSMkAtAAJRoFRQoLBAMAAAADAAAAAAAAAAoAAADQJgutAAAAANADAS0n0CgBLRHQKQEtENAAJRoFRQoLBAMAAAADAAAAAAAAAAoAAADQJgutAQAAANADAS0n0CgBLRHQKQEtEJoqKwFFAAEC0AABLSzQAAEtF9AAHy0t0C4vGgPQMAutAQAAANAxC60XAAAA0DIarQDQMy8aA9AwC60CAAAA0DELrQMAAADQMhqtANA0Gq0A0DUarQA=
78 |
79 |
80 | {192FAD59-8248-4824-A8DE-9177C94C195A}
81 |
82 | "{192FAD59-8248-4824-A8DE-9177C94C195A}"
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 | System.Collections.Hashtable
92 | {54dd0eac-a6d8-46f2-8c27-2f43c7e49861}
93 | System.String
94 |
95 |
96 |
97 |
98 |
--------------------------------------------------------------------------------
/Benchmark/Benchmark/POUs/MAIN.TcPOU:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
51 |
52 | RepetionCount
72 | THEN
73 | _step := 3;
74 | END_IF
75 |
76 |
77 | // iterate end **********************************************
78 | 3:
79 | // **********************************************************
80 | _it := _it + 1;
81 | _jt := 0;
82 | IF _it > ExamplesCount
83 | THEN
84 | _step := 0;
85 | ELSE
86 | _step := 2;
87 | END_IF
88 |
89 | IF _twinsonStatistic[_it].Size > 5000
90 | THEN
91 | _step := 4;
92 | END_IF
93 | END_CASE]]>
94 |
95 |
96 |
118 |
119 | cpuAccount);
143 | _jsonTc3Document := _jsonTc3.ParseDocument(_example0);
144 |
145 | string1 := _jsonTc3.GetString(_jsonTc3.FindMember(_jsonTc3Document, 'string1'));
146 | string2 := _jsonTc3.GetString(_jsonTc3.FindMember(_jsonTc3Document, 'string2'));
147 | string3 := _jsonTc3.GetString(_jsonTc3.FindMember(_jsonTc3Document, 'string3'));
148 |
149 | _cpucounter();
150 | ProcessTc3JsonDomParser := (_cpucounter.cpuAccountDW - cpuAccount); // ns
151 |
152 | 1:
153 | (*
154 | _example1 : STRING(1023) := '{ "string1":"string1","string2":"string2","string3":"string3","string4":"string4","string5":"string5",
155 | "string6":"string6","string7":"string7","string8":"string8","string9":"string9","string10":"string10" }';
156 | *)
157 |
158 | _cpucounter(cpuAccountDW => cpuAccount);
159 | _jsonTc3Document := _jsonTc3.ParseDocument(_example1);
160 |
161 | string1 := _jsonTc3.GetString(_jsonTc3.FindMember(_jsonTc3Document, 'string1'));
162 | string2 := _jsonTc3.GetString(_jsonTc3.FindMember(_jsonTc3Document, 'string2'));
163 | string3 := _jsonTc3.GetString(_jsonTc3.FindMember(_jsonTc3Document, 'string3'));
164 | string4 := _jsonTc3.GetString(_jsonTc3.FindMember(_jsonTc3Document, 'string4'));
165 | string5 := _jsonTc3.GetString(_jsonTc3.FindMember(_jsonTc3Document, 'string5'));
166 | string6 := _jsonTc3.GetString(_jsonTc3.FindMember(_jsonTc3Document, 'string6'));
167 | string7 := _jsonTc3.GetString(_jsonTc3.FindMember(_jsonTc3Document, 'string7'));
168 | string8 := _jsonTc3.GetString(_jsonTc3.FindMember(_jsonTc3Document, 'string8'));
169 | string9 := _jsonTc3.GetString(_jsonTc3.FindMember(_jsonTc3Document, 'string9'));
170 | string10 := _jsonTc3.GetString(_jsonTc3.FindMember(_jsonTc3Document, 'string10'));
171 |
172 | _cpucounter();
173 | ProcessTc3JsonDomParser := (_cpucounter.cpuAccountDW - cpuAccount); // ns
174 |
175 | 2:
176 | (*
177 | _example2 : STRING(1023) := '{ "array1": ["string1","string2","string3","string4","string5","string6","string7","string8","string9","string10"],
178 | "array2": ["string1","string2","string3","string4","string5","string6","string7","string8","string9","string10"],
179 | "array3": ["string1","string2","string3","string4","string5","string6","string7","string8","string9","string10"] }';
180 | *)
181 |
182 | _cpucounter(cpuAccountDW => cpuAccount);
183 | _jsonTc3Document := _jsonTc3.ParseDocument(_example2);
184 |
185 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
186 | string1 := _jsonTc3.GetString(_jsonTc3.GetArrayValueByIdx(ary, 0));
187 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
188 | string2 := _jsonTc3.GetString(_jsonTc3.GetArrayValueByIdx(ary, 1));
189 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
190 | string3 := _jsonTc3.GetString(_jsonTc3.GetArrayValueByIdx(ary, 2));
191 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
192 | string4 := _jsonTc3.GetString(_jsonTc3.GetArrayValueByIdx(ary, 3));
193 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
194 | string5 := _jsonTc3.GetString(_jsonTc3.GetArrayValueByIdx(ary, 4));
195 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
196 | string6 := _jsonTc3.GetString(_jsonTc3.GetArrayValueByIdx(ary, 5));
197 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
198 | string7 := _jsonTc3.GetString(_jsonTc3.GetArrayValueByIdx(ary, 6));
199 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
200 | string8 := _jsonTc3.GetString(_jsonTc3.GetArrayValueByIdx(ary, 7));
201 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
202 | string9 := _jsonTc3.GetString(_jsonTc3.GetArrayValueByIdx(ary, 8));
203 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
204 | string10 := _jsonTc3.GetString(_jsonTc3.GetArrayValueByIdx(ary, 9));
205 |
206 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
207 | string1 := _jsonTc3.GetString(_jsonTc3.GetArrayValueByIdx(ary, 0));
208 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
209 | string2 := _jsonTc3.GetString(_jsonTc3.GetArrayValueByIdx(ary, 1));
210 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
211 | string3 := _jsonTc3.GetString(_jsonTc3.GetArrayValueByIdx(ary, 2));
212 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
213 | string4 := _jsonTc3.GetString(_jsonTc3.GetArrayValueByIdx(ary, 3));
214 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
215 | string5 := _jsonTc3.GetString(_jsonTc3.GetArrayValueByIdx(ary, 4));
216 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
217 | string6 := _jsonTc3.GetString(_jsonTc3.GetArrayValueByIdx(ary, 5));
218 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
219 | string7 := _jsonTc3.GetString(_jsonTc3.GetArrayValueByIdx(ary, 6));
220 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
221 | string8 := _jsonTc3.GetString(_jsonTc3.GetArrayValueByIdx(ary, 7));
222 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
223 | string9 := _jsonTc3.GetString(_jsonTc3.GetArrayValueByIdx(ary, 8));
224 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
225 | string10 := _jsonTc3.GetString(_jsonTc3.GetArrayValueByIdx(ary, 9));
226 |
227 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
228 | string1 := _jsonTc3.GetString(_jsonTc3.GetArrayValueByIdx(ary, 0));
229 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
230 | string2 := _jsonTc3.GetString(_jsonTc3.GetArrayValueByIdx(ary, 1));
231 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
232 | string3 := _jsonTc3.GetString(_jsonTc3.GetArrayValueByIdx(ary, 2));
233 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
234 | string4 := _jsonTc3.GetString(_jsonTc3.GetArrayValueByIdx(ary, 3));
235 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
236 | string5 := _jsonTc3.GetString(_jsonTc3.GetArrayValueByIdx(ary, 4));
237 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
238 | string6 := _jsonTc3.GetString(_jsonTc3.GetArrayValueByIdx(ary, 5));
239 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
240 | string7 := _jsonTc3.GetString(_jsonTc3.GetArrayValueByIdx(ary, 6));
241 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
242 | string8 := _jsonTc3.GetString(_jsonTc3.GetArrayValueByIdx(ary, 7));
243 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
244 | string9 := _jsonTc3.GetString(_jsonTc3.GetArrayValueByIdx(ary, 8));
245 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
246 | string10 := _jsonTc3.GetString(_jsonTc3.GetArrayValueByIdx(ary, 9));
247 |
248 | _cpucounter();
249 | ProcessTc3JsonDomParser := (_cpucounter.cpuAccountDW - cpuAccount); // ns
250 |
251 | 3:
252 | (*
253 | _example3 : STRING(1023) := '{ "array1": [{ "string1":"string1","string2":"string2","string3":"string3","string4":"string4","string5":"string5",
254 | "string6":"string6","string7":"string7","string8":"string8","string9":"string9","string10":"string10" },
255 | { "string1":"string1","string2":"string2","string3":"string3","string4":"string4","string5":"string5",
256 | "string6":"string6","string7":"string7","string8":"string8","string9":"string9","string10":"string10" },
257 | { "string1":"string1","string2":"string2","string3":"string3","string4":"string4","string5":"string5",
258 | "string6":"string6","string7":"string7","string8":"string8","string9":"string9","string10":"string10" }],
259 | "array2": [{ "string1":"string1","string2":"string2","string3":"string3","string4":"string4","string5":"string5",
260 | "string6":"string6","string7":"string7","string8":"string8","string9":"string9","string10":"string10" },
261 | { "string1":"string1","string2":"string2","string3":"string3","string4":"string4","string5":"string5",
262 | "string6":"string6","string7":"string7","string8":"string8","string9":"string9","string10":"string10" },
263 | { "string1":"string1","string2":"string2","string3":"string3","string4":"string4","string5":"string5",
264 | "string6":"string6","string7":"string7","string8":"string8","string9":"string9","string10":"string10" }],
265 | "array3": [{ "string1":"string1","string2":"string2","string3":"string3","string4":"string4","string5":"string5",
266 | "string6":"string6","string7":"string7","string8":"string8","string9":"string9","string10":"string10" },
267 | { "string1":"string1","string2":"string2","string3":"string3","string4":"string4","string5":"string5",
268 | "string6":"string6","string7":"string7","string8":"string8","string9":"string9","string10":"string10" },
269 | { "string1":"string1","string2":"string2","string3":"string3","string4":"string4","string5":"string5",
270 | "string6":"string6","string7":"string7","string8":"string8","string9":"string9","string10":"string10" }]}';
271 | *)
272 |
273 | _cpucounter(cpuAccountDW => cpuAccount);
274 | _jsonTc3Document := _jsonTc3.ParseDocument(_example3);
275 |
276 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
277 | obj := _jsonTc3.GetArrayValueByIdx(ary, 0);
278 | string1 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string1'));
279 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
280 | obj := _jsonTc3.GetArrayValueByIdx(ary, 0);
281 | string2 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string2'));
282 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
283 | obj := _jsonTc3.GetArrayValueByIdx(ary, 0);
284 | string3 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string3'));
285 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
286 | obj := _jsonTc3.GetArrayValueByIdx(ary, 0);
287 | string4 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string4'));
288 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
289 | obj := _jsonTc3.GetArrayValueByIdx(ary, 0);
290 | string5 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string5'));
291 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
292 | obj := _jsonTc3.GetArrayValueByIdx(ary, 0);
293 | string6 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string6'));
294 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
295 | obj := _jsonTc3.GetArrayValueByIdx(ary, 0);
296 | string7 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string7'));
297 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
298 | obj := _jsonTc3.GetArrayValueByIdx(ary, 0);
299 | string8 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string8'));
300 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
301 | obj := _jsonTc3.GetArrayValueByIdx(ary, 0);
302 | string9 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string9'));
303 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
304 | obj := _jsonTc3.GetArrayValueByIdx(ary, 0);
305 | string10 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string10'));
306 |
307 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
308 | obj := _jsonTc3.GetArrayValueByIdx(ary, 1);
309 | string1 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string1'));
310 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
311 | obj := _jsonTc3.GetArrayValueByIdx(ary, 1);
312 | string2 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string2'));
313 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
314 | obj := _jsonTc3.GetArrayValueByIdx(ary, 1);
315 | string3 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string3'));
316 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
317 | obj := _jsonTc3.GetArrayValueByIdx(ary, 1);
318 | string4 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string4'));
319 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
320 | obj := _jsonTc3.GetArrayValueByIdx(ary, 1);
321 | string5 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string5'));
322 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
323 | obj := _jsonTc3.GetArrayValueByIdx(ary, 1);
324 | string6 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string6'));
325 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
326 | obj := _jsonTc3.GetArrayValueByIdx(ary, 1);
327 | string7 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string7'));
328 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
329 | obj := _jsonTc3.GetArrayValueByIdx(ary, 1);
330 | string8 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string8'));
331 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
332 | obj := _jsonTc3.GetArrayValueByIdx(ary, 1);
333 | string9 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string9'));
334 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
335 | obj := _jsonTc3.GetArrayValueByIdx(ary, 1);
336 | string10 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string10'));
337 |
338 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
339 | obj := _jsonTc3.GetArrayValueByIdx(ary, 2);
340 | string1 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string1'));
341 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
342 | obj := _jsonTc3.GetArrayValueByIdx(ary, 2);
343 | string2 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string2'));
344 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
345 | obj := _jsonTc3.GetArrayValueByIdx(ary, 2);
346 | string3 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string3'));
347 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
348 | obj := _jsonTc3.GetArrayValueByIdx(ary, 2);
349 | string4 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string4'));
350 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
351 | obj := _jsonTc3.GetArrayValueByIdx(ary, 2);
352 | string5 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string5'));
353 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
354 | obj := _jsonTc3.GetArrayValueByIdx(ary, 2);
355 | string6 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string6'));
356 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
357 | obj := _jsonTc3.GetArrayValueByIdx(ary, 2);
358 | string7 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string7'));
359 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
360 | obj := _jsonTc3.GetArrayValueByIdx(ary, 2);
361 | string8 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string8'));
362 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
363 | obj := _jsonTc3.GetArrayValueByIdx(ary, 2);
364 | string9 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string9'));
365 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array1');
366 | obj := _jsonTc3.GetArrayValueByIdx(ary, 2);
367 | string10 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string10'));
368 |
369 |
370 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
371 | obj := _jsonTc3.GetArrayValueByIdx(ary, 0);
372 | string1 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string1'));
373 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
374 | obj := _jsonTc3.GetArrayValueByIdx(ary, 0);
375 | string2 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string2'));
376 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
377 | obj := _jsonTc3.GetArrayValueByIdx(ary, 0);
378 | string3 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string3'));
379 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
380 | obj := _jsonTc3.GetArrayValueByIdx(ary, 0);
381 | string4 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string4'));
382 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
383 | obj := _jsonTc3.GetArrayValueByIdx(ary, 0);
384 | string5 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string5'));
385 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
386 | obj := _jsonTc3.GetArrayValueByIdx(ary, 0);
387 | string6 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string6'));
388 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
389 | obj := _jsonTc3.GetArrayValueByIdx(ary, 0);
390 | string7 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string7'));
391 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
392 | obj := _jsonTc3.GetArrayValueByIdx(ary, 0);
393 | string8 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string8'));
394 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
395 | obj := _jsonTc3.GetArrayValueByIdx(ary, 0);
396 | string9 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string9'));
397 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
398 | obj := _jsonTc3.GetArrayValueByIdx(ary, 0);
399 | string10 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string10'));
400 |
401 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
402 | obj := _jsonTc3.GetArrayValueByIdx(ary, 1);
403 | string1 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string1'));
404 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
405 | obj := _jsonTc3.GetArrayValueByIdx(ary, 1);
406 | string2 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string2'));
407 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
408 | obj := _jsonTc3.GetArrayValueByIdx(ary, 1);
409 | string3 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string3'));
410 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
411 | obj := _jsonTc3.GetArrayValueByIdx(ary, 1);
412 | string4 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string4'));
413 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
414 | obj := _jsonTc3.GetArrayValueByIdx(ary, 1);
415 | string5 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string5'));
416 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
417 | obj := _jsonTc3.GetArrayValueByIdx(ary, 1);
418 | string6 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string6'));
419 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
420 | obj := _jsonTc3.GetArrayValueByIdx(ary, 1);
421 | string7 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string7'));
422 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
423 | obj := _jsonTc3.GetArrayValueByIdx(ary, 1);
424 | string8 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string8'));
425 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
426 | obj := _jsonTc3.GetArrayValueByIdx(ary, 1);
427 | string9 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string9'));
428 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
429 | obj := _jsonTc3.GetArrayValueByIdx(ary, 1);
430 | string10 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string10'));
431 |
432 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
433 | obj := _jsonTc3.GetArrayValueByIdx(ary, 2);
434 | string1 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string1'));
435 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
436 | obj := _jsonTc3.GetArrayValueByIdx(ary, 2);
437 | string2 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string2'));
438 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
439 | obj := _jsonTc3.GetArrayValueByIdx(ary, 2);
440 | string3 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string3'));
441 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
442 | obj := _jsonTc3.GetArrayValueByIdx(ary, 2);
443 | string4 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string4'));
444 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
445 | obj := _jsonTc3.GetArrayValueByIdx(ary, 2);
446 | string5 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string5'));
447 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
448 | obj := _jsonTc3.GetArrayValueByIdx(ary, 2);
449 | string6 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string6'));
450 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
451 | obj := _jsonTc3.GetArrayValueByIdx(ary, 2);
452 | string7 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string7'));
453 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
454 | obj := _jsonTc3.GetArrayValueByIdx(ary, 2);
455 | string8 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string8'));
456 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
457 | obj := _jsonTc3.GetArrayValueByIdx(ary, 2);
458 | string9 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string9'));
459 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array2');
460 | obj := _jsonTc3.GetArrayValueByIdx(ary, 2);
461 | string10 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string10'));
462 |
463 |
464 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
465 | obj := _jsonTc3.GetArrayValueByIdx(ary, 0);
466 | string1 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string1'));
467 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
468 | obj := _jsonTc3.GetArrayValueByIdx(ary, 0);
469 | string2 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string2'));
470 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
471 | obj := _jsonTc3.GetArrayValueByIdx(ary, 0);
472 | string3 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string3'));
473 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
474 | obj := _jsonTc3.GetArrayValueByIdx(ary, 0);
475 | string4 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string4'));
476 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
477 | obj := _jsonTc3.GetArrayValueByIdx(ary, 0);
478 | string5 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string5'));
479 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
480 | obj := _jsonTc3.GetArrayValueByIdx(ary, 0);
481 | string6 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string6'));
482 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
483 | obj := _jsonTc3.GetArrayValueByIdx(ary, 0);
484 | string7 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string7'));
485 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
486 | obj := _jsonTc3.GetArrayValueByIdx(ary, 0);
487 | string8 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string8'));
488 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
489 | obj := _jsonTc3.GetArrayValueByIdx(ary, 0);
490 | string9 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string9'));
491 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
492 | obj := _jsonTc3.GetArrayValueByIdx(ary, 0);
493 | string10 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string10'));
494 |
495 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
496 | obj := _jsonTc3.GetArrayValueByIdx(ary, 1);
497 | string1 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string1'));
498 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
499 | obj := _jsonTc3.GetArrayValueByIdx(ary, 1);
500 | string2 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string2'));
501 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
502 | obj := _jsonTc3.GetArrayValueByIdx(ary, 1);
503 | string3 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string3'));
504 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
505 | obj := _jsonTc3.GetArrayValueByIdx(ary, 1);
506 | string4 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string4'));
507 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
508 | obj := _jsonTc3.GetArrayValueByIdx(ary, 1);
509 | string5 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string5'));
510 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
511 | obj := _jsonTc3.GetArrayValueByIdx(ary, 1);
512 | string6 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string6'));
513 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
514 | obj := _jsonTc3.GetArrayValueByIdx(ary, 1);
515 | string7 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string7'));
516 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
517 | obj := _jsonTc3.GetArrayValueByIdx(ary, 1);
518 | string8 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string8'));
519 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
520 | obj := _jsonTc3.GetArrayValueByIdx(ary, 1);
521 | string9 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string9'));
522 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
523 | obj := _jsonTc3.GetArrayValueByIdx(ary, 1);
524 | string10 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string10'));
525 |
526 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
527 | obj := _jsonTc3.GetArrayValueByIdx(ary, 2);
528 | string1 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string1'));
529 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
530 | obj := _jsonTc3.GetArrayValueByIdx(ary, 2);
531 | string2 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string2'));
532 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
533 | obj := _jsonTc3.GetArrayValueByIdx(ary, 2);
534 | string3 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string3'));
535 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
536 | obj := _jsonTc3.GetArrayValueByIdx(ary, 2);
537 | string4 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string4'));
538 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
539 | obj := _jsonTc3.GetArrayValueByIdx(ary, 2);
540 | string5 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string5'));
541 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
542 | obj := _jsonTc3.GetArrayValueByIdx(ary, 2);
543 | string6 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string6'));
544 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
545 | obj := _jsonTc3.GetArrayValueByIdx(ary, 2);
546 | string7 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string7'));
547 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
548 | obj := _jsonTc3.GetArrayValueByIdx(ary, 2);
549 | string8 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string8'));
550 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
551 | obj := _jsonTc3.GetArrayValueByIdx(ary, 2);
552 | string9 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string9'));
553 | ary := _jsonTc3.FindMember(_jsonTc3Document, 'array3');
554 | obj := _jsonTc3.GetArrayValueByIdx(ary, 2);
555 | string10 := _jsonTc3.GetString(_jsonTc3.FindMember(obj, 'string10'));
556 |
557 | _cpucounter();
558 | ProcessTc3JsonDomParser := (_cpucounter.cpuAccountDW - cpuAccount); // ns
559 |
560 | 4:
561 | (*
562 | { "object1": { "object2": { "object3": { "object4" : { "object5": { "object6": { "object7" : { "object8": { "object9" : { "string1" : "string1" ... } }}}} } } }}}
563 | *)
564 | _cpucounter(cpuAccountDW => cpuAccount);
565 | _jsonTc3Document := _jsonTc3.ParseDocument(_example4);
566 |
567 | string1 := _jsonTc3.GetString(_jsonTc3.FindMemberPath(_jsonTc3Document, 'object1/object2/object3/object4/object5/object6/object7/object8/object9/string1'));
568 | string2 := _jsonTc3.GetString(_jsonTc3.FindMemberPath(_jsonTc3Document, 'object1/object2/object3/object4/object5/object6/object7/object8/object9/string2'));
569 | string3 := _jsonTc3.GetString(_jsonTc3.FindMemberPath(_jsonTc3Document, 'object1/object2/object3/object4/object5/object6/object7/object8/object9/string3'));
570 | string4 := _jsonTc3.GetString(_jsonTc3.FindMemberPath(_jsonTc3Document, 'object1/object2/object3/object4/object5/object6/object7/object8/object9/string4'));
571 | string5 := _jsonTc3.GetString(_jsonTc3.FindMemberPath(_jsonTc3Document, 'object1/object2/object3/object4/object5/object6/object7/object8/object9/string5'));
572 | string6 := _jsonTc3.GetString(_jsonTc3.FindMemberPath(_jsonTc3Document, 'object1/object2/object3/object4/object5/object6/object7/object8/object9/string6'));
573 | string7 := _jsonTc3.GetString(_jsonTc3.FindMemberPath(_jsonTc3Document, 'object1/object2/object3/object4/object5/object6/object7/object8/object9/string7'));
574 | string8 := _jsonTc3.GetString(_jsonTc3.FindMemberPath(_jsonTc3Document, 'object1/object2/object3/object4/object5/object6/object7/object8/object9/string8'));
575 | string9 := _jsonTc3.GetString(_jsonTc3.FindMemberPath(_jsonTc3Document, 'object1/object2/object3/object4/object5/object6/object7/object8/object9/string9'));
576 | string10 := _jsonTc3.GetString(_jsonTc3.FindMemberPath(_jsonTc3Document, 'object1/object2/object3/object4/object5/object6/object7/object8/object9/string10'));
577 |
578 | _cpucounter();
579 | ProcessTc3JsonDomParser := (_cpucounter.cpuAccountDW - cpuAccount); // ns
580 |
581 | END_CASE
582 |
583 | ]]>
584 |
585 |
586 |
587 |
606 |
607 | cpuAccount);
615 | _jsonTwinson.Decode(_example0);
616 |
617 | string1 := _jsonTwinson.Element('string1').AsString();
618 | string2 := _jsonTwinson.Element('string2').AsString();
619 | string3 := _jsonTwinson.Element('string3').AsString();
620 |
621 | _cpucounter();
622 | ProcessTwinson := (_cpucounter.cpuAccountDW - cpuAccount); // ns
623 |
624 | 1:
625 | (*
626 | _example1 : STRING(1023) := '{ "string1":"string1","string2":"string2","string3":"string3","string4":"string4","string5":"string5",
627 | "string6":"string6","string7":"string7","string8":"string8","string9":"string9","string10":"string10" }';
628 | *)
629 | _cpucounter(cpuAccountDW => cpuAccount);
630 | _jsonTwinson.Decode(_example1);
631 |
632 | string1 := _jsonTwinson.Element('string1').AsString();
633 | string2 := _jsonTwinson.Element('string2').AsString();
634 | string3 := _jsonTwinson.Element('string3').AsString();
635 | string4 := _jsonTwinson.Element('string4').AsString();
636 | string5 := _jsonTwinson.Element('string5').AsString();
637 | string6 := _jsonTwinson.Element('string6').AsString();
638 | string7 := _jsonTwinson.Element('string7').AsString();
639 | string8 := _jsonTwinson.Element('string8').AsString();
640 | string9 := _jsonTwinson.Element('string9').AsString();
641 | string10 := _jsonTwinson.Element('string10').AsString();
642 |
643 | _cpucounter();
644 | ProcessTwinson := (_cpucounter.cpuAccountDW - cpuAccount); // ns
645 |
646 | 2:
647 | (*
648 | _example2 : STRING(1023) := '{ "array1": ["string1","string2","string3","string4","string5","string6","string7","string8","string9","string10"],
649 | "array2": ["string1","string2","string3","string4","string5","string6","string7","string8","string9","string10"],
650 | "array3": ["string1","string2","string3","string4","string5","string6","string7","string8","string9","string10"] }';
651 | *)
652 | _cpucounter(cpuAccountDW => cpuAccount);
653 | _jsonTwinson.Decode(_example2);
654 |
655 | string1 := _jsonTwinson.Element('array1[0]').AsString();
656 | string2 := _jsonTwinson.Element('array1[1]').AsString();
657 | string3 := _jsonTwinson.Element('array1[2]').AsString();
658 | string4 := _jsonTwinson.Element('array1[3]').AsString();
659 | string5 := _jsonTwinson.Element('array1[4]').AsString();
660 | string6 := _jsonTwinson.Element('array1[5]').AsString();
661 | string7 := _jsonTwinson.Element('array1[6]').AsString();
662 | string8 := _jsonTwinson.Element('array1[7]').AsString();
663 | string9 := _jsonTwinson.Element('array1[8]').AsString();
664 | string10 := _jsonTwinson.Element('array1[9]').AsString();
665 |
666 | string1 := _jsonTwinson.Element('array2[0]').AsString();
667 | string2 := _jsonTwinson.Element('array2[1]').AsString();
668 | string3 := _jsonTwinson.Element('array2[2]').AsString();
669 | string4 := _jsonTwinson.Element('array2[3]').AsString();
670 | string5 := _jsonTwinson.Element('array2[4]').AsString();
671 | string6 := _jsonTwinson.Element('array2[5]').AsString();
672 | string7 := _jsonTwinson.Element('array2[6]').AsString();
673 | string8 := _jsonTwinson.Element('array2[7]').AsString();
674 | string9 := _jsonTwinson.Element('array2[8]').AsString();
675 | string10 := _jsonTwinson.Element('array2[9]').AsString();
676 |
677 | string1 := _jsonTwinson.Element('array3[0]').AsString();
678 | string2 := _jsonTwinson.Element('array3[1]').AsString();
679 | string3 := _jsonTwinson.Element('array3[2]').AsString();
680 | string4 := _jsonTwinson.Element('array3[3]').AsString();
681 | string5 := _jsonTwinson.Element('array3[4]').AsString();
682 | string6 := _jsonTwinson.Element('array3[5]').AsString();
683 | string7 := _jsonTwinson.Element('array3[6]').AsString();
684 | string8 := _jsonTwinson.Element('array3[7]').AsString();
685 | string9 := _jsonTwinson.Element('array3[8]').AsString();
686 | string10 := _jsonTwinson.Element('array3[9]').AsString();
687 |
688 | _cpucounter();
689 | ProcessTwinson := (_cpucounter.cpuAccountDW - cpuAccount); // ns
690 |
691 | 3:
692 | (*
693 | _example3 : STRING(1023) := '{ "array1": [{ "string1":"string1","string2":"string2","string3":"string3","string4":"string4","string5":"string5",
694 | "string6":"string6","string7":"string7","string8":"string8","string9":"string9","string10":"string10" },
695 | { "string1":"string1","string2":"string2","string3":"string3","string4":"string4","string5":"string5",
696 | "string6":"string6","string7":"string7","string8":"string8","string9":"string9","string10":"string10" },
697 | { "string1":"string1","string2":"string2","string3":"string3","string4":"string4","string5":"string5",
698 | "string6":"string6","string7":"string7","string8":"string8","string9":"string9","string10":"string10" }],
699 | "array2": [{ "string1":"string1","string2":"string2","string3":"string3","string4":"string4","string5":"string5",
700 | "string6":"string6","string7":"string7","string8":"string8","string9":"string9","string10":"string10" },
701 | { "string1":"string1","string2":"string2","string3":"string3","string4":"string4","string5":"string5",
702 | "string6":"string6","string7":"string7","string8":"string8","string9":"string9","string10":"string10" },
703 | { "string1":"string1","string2":"string2","string3":"string3","string4":"string4","string5":"string5",
704 | "string6":"string6","string7":"string7","string8":"string8","string9":"string9","string10":"string10" }],
705 | "array3": [{ "string1":"string1","string2":"string2","string3":"string3","string4":"string4","string5":"string5",
706 | "string6":"string6","string7":"string7","string8":"string8","string9":"string9","string10":"string10" },
707 | { "string1":"string1","string2":"string2","string3":"string3","string4":"string4","string5":"string5",
708 | "string6":"string6","string7":"string7","string8":"string8","string9":"string9","string10":"string10" },
709 | { "string1":"string1","string2":"string2","string3":"string3","string4":"string4","string5":"string5",
710 | "string6":"string6","string7":"string7","string8":"string8","string9":"string9","string10":"string10" }]}';
711 | *)
712 |
713 | _cpucounter(cpuAccountDW => cpuAccount);
714 | _jsonTwinson.Decode(_example3);
715 |
716 | string1 := _jsonTwinson.Element('array1[0].string1').AsString();
717 | string2 := _jsonTwinson.Element('array1[0].string2').AsString();
718 | string3 := _jsonTwinson.Element('array1[0].string3').AsString();
719 | string4 := _jsonTwinson.Element('array1[0].string4').AsString();
720 | string5 := _jsonTwinson.Element('array1[0].string5').AsString();
721 | string6 := _jsonTwinson.Element('array1[0].string6').AsString();
722 | string7 := _jsonTwinson.Element('array1[0].string7').AsString();
723 | string8 := _jsonTwinson.Element('array1[0].string8').AsString();
724 | string9 := _jsonTwinson.Element('array1[0].string9').AsString();
725 | string10 := _jsonTwinson.Element('array1[0].string10').AsString();
726 |
727 | string1 := _jsonTwinson.Element('array1[1].string1').AsString();
728 | string2 := _jsonTwinson.Element('array1[1].string2').AsString();
729 | string3 := _jsonTwinson.Element('array1[1].string3').AsString();
730 | string4 := _jsonTwinson.Element('array1[1].string4').AsString();
731 | string5 := _jsonTwinson.Element('array1[1].string5').AsString();
732 | string6 := _jsonTwinson.Element('array1[1].string6').AsString();
733 | string7 := _jsonTwinson.Element('array1[1].string7').AsString();
734 | string8 := _jsonTwinson.Element('array1[1].string8').AsString();
735 | string9 := _jsonTwinson.Element('array1[1].string9').AsString();
736 | string10 := _jsonTwinson.Element('array1[1].string10').AsString();
737 |
738 | string1 := _jsonTwinson.Element('array1[2].string1').AsString();
739 | string2 := _jsonTwinson.Element('array1[2].string2').AsString();
740 | string3 := _jsonTwinson.Element('array1[2].string3').AsString();
741 | string4 := _jsonTwinson.Element('array1[2].string4').AsString();
742 | string5 := _jsonTwinson.Element('array1[2].string5').AsString();
743 | string6 := _jsonTwinson.Element('array1[2].string6').AsString();
744 | string7 := _jsonTwinson.Element('array1[2].string7').AsString();
745 | string8 := _jsonTwinson.Element('array1[2].string8').AsString();
746 | string9 := _jsonTwinson.Element('array1[2].string9').AsString();
747 | string10 := _jsonTwinson.Element('array1[2].string10').AsString();
748 |
749 |
750 | string1 := _jsonTwinson.Element('array2[0].string1').AsString();
751 | string2 := _jsonTwinson.Element('array2[0].string2').AsString();
752 | string3 := _jsonTwinson.Element('array2[0].string3').AsString();
753 | string4 := _jsonTwinson.Element('array2[0].string4').AsString();
754 | string5 := _jsonTwinson.Element('array2[0].string5').AsString();
755 | string6 := _jsonTwinson.Element('array2[0].string6').AsString();
756 | string7 := _jsonTwinson.Element('array2[0].string7').AsString();
757 | string8 := _jsonTwinson.Element('array2[0].string8').AsString();
758 | string9 := _jsonTwinson.Element('array2[0].string9').AsString();
759 | string10 := _jsonTwinson.Element('array2[0].string10').AsString();
760 |
761 | string1 := _jsonTwinson.Element('array2[1].string1').AsString();
762 | string2 := _jsonTwinson.Element('array2[1].string2').AsString();
763 | string3 := _jsonTwinson.Element('array2[1].string3').AsString();
764 | string4 := _jsonTwinson.Element('array2[1].string4').AsString();
765 | string5 := _jsonTwinson.Element('array2[1].string5').AsString();
766 | string6 := _jsonTwinson.Element('array2[1].string6').AsString();
767 | string7 := _jsonTwinson.Element('array2[1].string7').AsString();
768 | string8 := _jsonTwinson.Element('array2[1].string8').AsString();
769 | string9 := _jsonTwinson.Element('array2[1].string9').AsString();
770 | string10 := _jsonTwinson.Element('array2[1].string10').AsString();
771 |
772 | string1 := _jsonTwinson.Element('array2[2].string1').AsString();
773 | string2 := _jsonTwinson.Element('array2[2].string2').AsString();
774 | string3 := _jsonTwinson.Element('array2[2].string3').AsString();
775 | string4 := _jsonTwinson.Element('array2[2].string4').AsString();
776 | string5 := _jsonTwinson.Element('array2[2].string5').AsString();
777 | string6 := _jsonTwinson.Element('array2[2].string6').AsString();
778 | string7 := _jsonTwinson.Element('array2[2].string7').AsString();
779 | string8 := _jsonTwinson.Element('array2[2].string8').AsString();
780 | string9 := _jsonTwinson.Element('array2[2].string9').AsString();
781 | string10 := _jsonTwinson.Element('array2[2].string10').AsString();
782 |
783 |
784 | string1 := _jsonTwinson.Element('array3[0].string1').AsString();
785 | string2 := _jsonTwinson.Element('array3[0].string2').AsString();
786 | string3 := _jsonTwinson.Element('array3[0].string3').AsString();
787 | string4 := _jsonTwinson.Element('array3[0].string4').AsString();
788 | string5 := _jsonTwinson.Element('array3[0].string5').AsString();
789 | string6 := _jsonTwinson.Element('array3[0].string6').AsString();
790 | string7 := _jsonTwinson.Element('array3[0].string7').AsString();
791 | string8 := _jsonTwinson.Element('array3[0].string8').AsString();
792 | string9 := _jsonTwinson.Element('array3[0].string9').AsString();
793 | string10 := _jsonTwinson.Element('array3[0].string10').AsString();
794 |
795 | string1 := _jsonTwinson.Element('array3[1].string1').AsString();
796 | string2 := _jsonTwinson.Element('array3[1].string2').AsString();
797 | string3 := _jsonTwinson.Element('array3[1].string3').AsString();
798 | string4 := _jsonTwinson.Element('array3[1].string4').AsString();
799 | string5 := _jsonTwinson.Element('array3[1].string5').AsString();
800 | string6 := _jsonTwinson.Element('array3[1].string6').AsString();
801 | string7 := _jsonTwinson.Element('array3[1].string7').AsString();
802 | string8 := _jsonTwinson.Element('array3[1].string8').AsString();
803 | string9 := _jsonTwinson.Element('array3[1].string9').AsString();
804 | string10 := _jsonTwinson.Element('array3[1].string10').AsString();
805 |
806 | string1 := _jsonTwinson.Element('array3[2].string1').AsString();
807 | string2 := _jsonTwinson.Element('array3[2].string2').AsString();
808 | string3 := _jsonTwinson.Element('array3[2].string3').AsString();
809 | string4 := _jsonTwinson.Element('array3[2].string4').AsString();
810 | string5 := _jsonTwinson.Element('array3[2].string5').AsString();
811 | string6 := _jsonTwinson.Element('array3[2].string6').AsString();
812 | string7 := _jsonTwinson.Element('array3[2].string7').AsString();
813 | string8 := _jsonTwinson.Element('array3[2].string8').AsString();
814 | string9 := _jsonTwinson.Element('array3[2].string9').AsString();
815 | string10 := _jsonTwinson.Element('array3[2].string10').AsString();
816 |
817 | _cpucounter();
818 | ProcessTwinson := (_cpucounter.cpuAccountDW - cpuAccount); // ns
819 |
820 |
821 | 4:
822 | (*
823 | { "object1": { "object2": { "object3": { "object4" : { "object5": { "object6": { "object7" : { "object8": { "object9" : { "string1" : "string1" ... } }}}} } } }}}
824 | *)
825 | _cpucounter(cpuAccountDW => cpuAccount);
826 | _jsonTwinson.Decode(_example4);
827 |
828 | string1 := _jsonTwinson.Element('object1.object2.object3.object4.object5.object6.object7.object8.object9.string1').AsString();
829 | string2 := _jsonTwinson.Element('object1.object2.object3.object4.object5.object6.object7.object8.object9.string2').AsString();
830 | string3 := _jsonTwinson.Element('object1.object2.object3.object4.object5.object6.object7.object8.object9.string3').AsString();
831 | string4 := _jsonTwinson.Element('object1.object2.object3.object4.object5.object6.object7.object8.object9.string4').AsString();
832 | string5 := _jsonTwinson.Element('object1.object2.object3.object4.object5.object6.object7.object8.object9.string5').AsString();
833 | string6 := _jsonTwinson.Element('object1.object2.object3.object4.object5.object6.object7.object8.object9.string6').AsString();
834 | string7 := _jsonTwinson.Element('object1.object2.object3.object4.object5.object6.object7.object8.object9.string7').AsString();
835 | string8 := _jsonTwinson.Element('object1.object2.object3.object4.object5.object6.object7.object8.object9.string8').AsString();
836 | string9 := _jsonTwinson.Element('object1.object2.object3.object4.object5.object6.object7.object8.object9.string9').AsString();
837 | string10 := _jsonTwinson.Element('object1.object2.object3.object4.object5.object6.object7.object8.object9.string10').AsString();
838 |
839 | _cpucounter();
840 | ProcessTwinson := (_cpucounter.cpuAccountDW - cpuAccount); // ns
841 | END_CASE
842 | ]]>
843 |
844 |
845 |
846 |
--------------------------------------------------------------------------------
/Benchmark/Benchmark/POUs/MovingStatistic/MovingStatistic.TcPOU:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
17 |
18 |
19 |
20 |
21 |
26 |
27 | 1
32 | THEN
33 | _varianceSum := _varianceSum + (value - Mean) * (value - _meanMem);
34 | Sigma := SQRT(_varianceSum / (DINT_TO_LREAL(Size) - 1.0));
35 | END_IF
36 |
37 | IF value < Minimum
38 | THEN
39 | Minimum := value;
40 | END_IF
41 |
42 | IF value > Maximum
43 | THEN
44 | Maximum := value;
45 | END_IF]]>
46 |
47 |
48 |
49 |
55 |
56 |
57 |
58 |
59 |
60 |
64 |
65 |
73 |
74 |
75 |
76 |
--------------------------------------------------------------------------------
/Benchmark/Benchmark/PlcTask.TcTTO:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 1000
6 | 20
7 |
8 | MAIN
9 |
10 | {93aa5775-5758-4374-af2f-ae28906d1fe7}
11 | {448dfb27-8250-484c-b8b8-4e323ece894b}
12 | {bc045f32-533b-4f2f-a33b-6ae8ef11fcf7}
13 | {e5bfdf2e-14e4-48e5-9438-9ccd927f9757}
14 | {df646386-29f3-4f80-abba-aaece80c0bf9}
15 |
16 |
--------------------------------------------------------------------------------
/Benchmark/benchmark_plot.py:
--------------------------------------------------------------------------------
1 | from pathlib import Path
2 |
3 | import matplotlib.pyplot as plt
4 | import numpy as np
5 |
6 |
7 | ticks = ('Example 1', 'Example 2', 'Example 3', 'Example 4', 'Example 5')
8 | twinson_average_mean = [2.5, 4.8, 10.5, 39.2, 8.8]
9 | twinson_average_err = [1, 1.8, 3.4, 12.1, 4]
10 | domparser_average_mean = [4.7, 7.3, 12.1, 42.2, 10.5]
11 | domparser_average_err = [1.7, 2.7, 3.9, 12.8, 4]
12 |
13 | y_pos = np.arange(len(ticks))
14 | y_pos1 = y_pos - 0.175
15 | y_pos2 = y_pos + 0.175
16 | height = 0.35
17 |
18 | plt.figure(figsize=(9.0, 4.0), dpi=120)
19 |
20 | # Average
21 | plt.subplot(1, 1, 1)
22 | plt.suptitle("""Direct-Element-Access benchmark of Twinson JSON decoder for examples with increasing complexity.
23 | All elements are accessed directly (no node caching for arrays). Averaged over 5000 iterations.
24 | VM with TwinCAT 3.1.4024.35; AMD Ryzen 3600X (1 Isolated Core)""", fontsize=10)
25 |
26 | ax = plt.gca()
27 | ax.grid(True, linestyle='--', color='grey', alpha=.25)
28 | ax.barh(y_pos1, twinson_average_mean, height=height, xerr=twinson_average_err, label='Twinson')
29 | ax.barh(y_pos2, domparser_average_mean, height=height, xerr=domparser_average_err, label='Tc3_Json')
30 | ax.set_yticks(y_pos)
31 | ax.set_yticklabels(ticks)
32 | ax.invert_yaxis() # labels read top-to-bottom
33 | ax.set_xlabel('Mean Calculation Duration [µs]')
34 | ax.legend()
35 |
36 | plt.savefig(Path(__file__).parent.parent / 'benchmark.png')
37 |
--------------------------------------------------------------------------------
/Example/Example.tsproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | PlcTask
11 |
12 |
13 |
14 |
15 |
16 |
17 | Example Instance
18 | {08500001-0000-0000-F000-000000000064}
19 |
20 |
21 | 0
22 | PlcTask
23 |
24 | #x02010030
25 |
26 | 20
27 | 10000000
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/Example/Example/Example.plcproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1.0.0.0
4 | 2.0
5 | {ced08849-ba70-4893-887e-f33db9ba4c06}
6 | True
7 | true
8 | true
9 | false
10 | Example
11 | 3.1.4023.0
12 | {4f3a73af-f6b7-484d-93e1-3140ac5144bc}
13 | {353f9198-5e5b-4cf9-95d0-38cff2a79c03}
14 | {bd6f42a4-278f-406d-8c6c-4ba7a4b45db1}
15 | {13226238-451b-4384-a063-5a83a2f45b24}
16 | {14d77b5f-2d7c-49ed-8c22-5cd73a2a2375}
17 | {2ed143d2-9858-41f6-88df-c2d328e1921c}
18 |
19 |
20 |
21 | Code
22 |
23 |
24 | Code
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | Tc2_Standard, * (Beckhoff Automation GmbH)
36 | Tc2_Standard
37 |
38 |
39 | Tc2_System, * (Beckhoff Automation GmbH)
40 | Tc2_System
41 |
42 |
43 | Tc2_Utilities, * (Beckhoff Automation GmbH)
44 | Tc2_Utilities
45 |
46 |
47 | Tc3_Module, * (Beckhoff Automation GmbH)
48 | Tc3_Module
49 |
50 |
51 | Twinson, * (Stefan Besler)
52 | Twinson
53 |
54 |
55 |
56 |
57 | Content
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 | "<ProjectRoot>"
66 |
67 | {40450F57-0AA3-4216-96F3-5444ECB29763}
68 |
69 | "{40450F57-0AA3-4216-96F3-5444ECB29763}"
70 |
71 |
72 | ActiveVisuProfile
73 | IR0whWr8bwfwBwAAiD2qpQAAAABVAgAA37x72QAAAAABAAAAAAAAAAEaUwB5AHMAdABlAG0ALgBTAHQAcgBpAG4AZwACTHsAZgA5ADUAYgBiADQAMgA2AC0ANQA1ADIANAAtADQAYgA0ADUALQA5ADQAMAAwAC0AZgBiADAAZgAyAGUANwA3AGUANQAxAGIAfQADCE4AYQBtAGUABDBUAHcAaQBuAEMAQQBUACAAMwAuADEAIABCAHUAaQBsAGQAIAA0ADAAMgA0AC4ANwAFFlAAcgBvAGYAaQBsAGUARABhAHQAYQAGTHsAMQA2AGUANQA1AGIANgAwAC0ANwAwADQAMwAtADQAYQA2ADMALQBiADYANQBiAC0ANgAxADQANwAxADMAOAA3ADgAZAA0ADIAfQAHEkwAaQBiAHIAYQByAGkAZQBzAAhMewAzAGIAZgBkADUANAA1ADkALQBiADAANwBmAC0ANABkADYAZQAtAGEAZQAxAGEALQBhADgAMwAzADUANgBhADUANQAxADQAMgB9AAlMewA5AGMAOQA1ADgAOQA2ADgALQAyAGMAOAA1AC0ANAAxAGIAYgAtADgAOAA3ADEALQA4ADkANQBmAGYAMQBmAGUAZABlADEAYQB9AAoOVgBlAHIAcwBpAG8AbgALBmkAbgB0AAwKVQBzAGEAZwBlAA0KVABpAHQAbABlAA4aVgBpAHMAdQBFAGwAZQBtAE0AZQB0AGUAcgAPDkMAbwBtAHAAYQBuAHkAEAxTAHkAcwB0AGUAbQARElYAaQBzAHUARQBsAGUAbQBzABIwVgBpAHMAdQBFAGwAZQBtAHMAUwBwAGUAYwBpAGEAbABDAG8AbgB0AHIAbwBsAHMAEyhWAGkAcwB1AEUAbABlAG0AcwBXAGkAbgBDAG8AbgB0AHIAbwBsAHMAFCRWAGkAcwB1AEUAbABlAG0AVABlAHgAdABFAGQAaQB0AG8AcgAVIlYAaQBzAHUATgBhAHQAaQB2AGUAQwBvAG4AdAByAG8AbAAWFHYAaQBzAHUAaQBuAHAAdQB0AHMAFwxzAHkAcwB0AGUAbQAYGFYAaQBzAHUARQBsAGUAbQBCAGEAcwBlABkmRABlAHYAUABsAGEAYwBlAGgAbwBsAGQAZQByAHMAVQBzAGUAZAAaCGIAbwBvAGwAGyJQAGwAdQBnAGkAbgBDAG8AbgBzAHQAcgBhAGkAbgB0AHMAHEx7ADQAMwBkADUAMgBiAGMAZQAtADkANAAyAGMALQA0ADQAZAA3AC0AOQBlADkANAAtADEAYgBmAGQAZgAzADEAMABlADYAMwBjAH0AHRxBAHQATABlAGEAcwB0AFYAZQByAHMAaQBvAG4AHhRQAGwAdQBnAGkAbgBHAHUAaQBkAB8WUwB5AHMAdABlAG0ALgBHAHUAaQBkACBIYQBmAGMAZAA1ADQANAA2AC0ANAA5ADEANAAtADQAZgBlADcALQBiAGIANwA4AC0AOQBiAGYAZgBlAGIANwAwAGYAZAAxADcAIRRVAHAAZABhAHQAZQBJAG4AZgBvACJMewBiADAAMwAzADYANgBhADgALQBiADUAYwAwAC0ANABiADkAYQAtAGEAMAAwAGUALQBlAGIAOAA2ADAAMQAxADEAMAA0AGMAMwB9ACMOVQBwAGQAYQB0AGUAcwAkTHsAMQA4ADYAOABmAGYAYwA5AC0AZQA0AGYAYwAtADQANQAzADIALQBhAGMAMAA2AC0AMQBlADMAOQBiAGIANQA1ADcAYgA2ADkAfQAlTHsAYQA1AGIAZAA0ADgAYwAzAC0AMABkADEANwAtADQAMQBiADUALQBiADEANgA0AC0ANQBmAGMANgBhAGQAMgBiADkANgBiADcAfQAmFk8AYgBqAGUAYwB0AHMAVAB5AHAAZQAnVFUAcABkAGEAdABlAEwAYQBuAGcAdQBhAGcAZQBNAG8AZABlAGwARgBvAHIAQwBvAG4AdgBlAHIAdABpAGIAbABlAEwAaQBiAHIAYQByAGkAZQBzACgQTABpAGIAVABpAHQAbABlACkUTABpAGIAQwBvAG0AcABhAG4AeQAqHlUAcABkAGEAdABlAFAAcgBvAHYAaQBkAGUAcgBzACs4UwB5AHMAdABlAG0ALgBDAG8AbABsAGUAYwB0AGkAbwBuAHMALgBIAGEAcwBoAHQAYQBiAGwAZQAsEnYAaQBzAHUAZQBsAGUAbQBzAC1INgBjAGIAMQBjAGQAZQAxAC0AZAA1AGQAYwAtADQAYQAzAGIALQA5ADAANQA0AC0AMgAxAGYAYQA3ADUANgBhADMAZgBhADQALihJAG4AdABlAHIAZgBhAGMAZQBWAGUAcgBzAGkAbwBuAEkAbgBmAG8AL0x7AGMANgAxADEAZQA0ADAAMAAtADcAZgBiADkALQA0AGMAMwA1AC0AYgA5AGEAYwAtADQAZQAzADEANABiADUAOQA5ADYANAAzAH0AMBhNAGEAagBvAHIAVgBlAHIAcwBpAG8AbgAxGE0AaQBuAG8AcgBWAGUAcgBzAGkAbwBuADIMTABlAGcAYQBjAHkAMzBMAGEAbgBnAHUAYQBnAGUATQBvAGQAZQBsAFYAZQByAHMAaQBvAG4ASQBuAGYAbwA0MEwAbwBhAGQATABpAGIAcgBhAHIAaQBlAHMASQBuAHQAbwBQAHIAbwBqAGUAYwB0ADUaQwBvAG0AcABhAHQAaQBiAGkAbABpAHQAeQDQAAIaA9ADAS0E0AUGGgfQBwgaAUUHCQjQAAkaBEUKCwQDAAAABQAAAA0AAAAAAAAA0AwLrQIAAADQDQEtDtAPAS0Q0AAJGgRFCgsEAwAAAAUAAAANAAAAKAAAANAMC60BAAAA0A0BLRHQDwEtENAACRoERQoLBAMAAAAFAAAADQAAAAAAAADQDAutAgAAANANAS0S0A8BLRDQAAkaBEUKCwQDAAAABQAAAA0AAAAUAAAA0AwLrQIAAADQDQEtE9APAS0Q0AAJGgRFCgsEAwAAAAUAAAANAAAAAAAAANAMC60CAAAA0A0BLRTQDwEtENAACRoERQoLBAMAAAAFAAAADQAAAAAAAADQDAutAgAAANANAS0V0A8BLRDQAAkaBEUKCwQDAAAABQAAAA0AAAAAAAAA0AwLrQIAAADQDQEtFtAPAS0X0AAJGgRFCgsEAwAAAAUAAAANAAAAKAAAANAMC60EAAAA0A0BLRjQDwEtENAZGq0BRRscAdAAHBoCRR0LBAMAAAAFAAAADQAAAAAAAADQHh8tINAhIhoCRSMkAtAAJRoFRQoLBAMAAAADAAAAAAAAAAoAAADQJgutAAAAANADAS0n0CgBLRHQKQEtENAAJRoFRQoLBAMAAAADAAAAAAAAAAoAAADQJgutAQAAANADAS0n0CgBLRHQKQEtEJoqKwFFAAEC0AABLSzQAAEtF9AAHy0t0C4vGgPQMAutAQAAANAxC60XAAAA0DIarQDQMy8aA9AwC60CAAAA0DELrQMAAADQMhqtANA0Gq0A0DUarQA=
74 |
75 |
76 | {192FAD59-8248-4824-A8DE-9177C94C195A}
77 |
78 | "{192FAD59-8248-4824-A8DE-9177C94C195A}"
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 | System.Collections.Hashtable
88 | {54dd0eac-a6d8-46f2-8c27-2f43c7e49861}
89 | System.String
90 |
91 |
92 |
93 |
94 |
--------------------------------------------------------------------------------
/Example/Example/POUs/MAIN.TcPOU:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
27 |
28 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/Example/Example/PlcTask.TcTTO:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 10000
6 | 20
7 |
8 | MAIN
9 |
10 | {52cccdf5-64cd-47de-ae30-05d4d1c80e07}
11 | {24689e65-dfd1-40e7-93b3-2266b5af3ca8}
12 | {b5c8d6a1-4cf9-4c4b-88d4-389b772bd690}
13 | {216d5a0b-9c57-433e-90e2-00c5ab0ac50a}
14 | {5a9a6d1e-e3c8-4ac0-99be-bfe9e237372b}
15 |
16 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Twinson
2 | Simple and lightweight JSON decoder for TwinCAT and CODESYS.
3 |
4 | ## State of the implementation
5 |
6 | - [x] Continuous integration
7 | - [x] Parser
8 | - [x] Strings
9 | - [x] Numbers
10 | - [x] Boolean
11 | - [x] Null
12 | - [x] Objects (including nested objects)
13 | - [x] Arrays (including mixed array and nested arrays)
14 | - [x] Basic element access
15 | - [ ] Monadic element access
16 | - [ ] Unittests
17 | - [x] Performance improvements for accessing elements, use tree to store data instead of array
18 | - [x] Performance tuning
19 | - [ ] Node access for "cached" element access
20 |
21 | ## Comparison to Tc3_Json
22 |
23 | Twinson is lightweight alternative to Beckhoff's `Tc3_Json.FB_JsonDomParser`. When comparing Twinson with the Tc3_Json (TC 3.1.4024.25), I discovered issues with Tc3_Json that might be addressed by Beckhoff in the future.
24 |
25 | - `null`, as specified by the JSON format, is not parsed correctly.
26 | - Parsing nested arrays is cumbersome, because there is no way (at least I didn't find any documented) to access an array element directly.
27 |
28 | ## Benchmark
29 |
30 | Twinson includes a seperate PLC for benchmarking the library against Tc3_Json. The benchmark uses several examples with increasing JSON complexity (In terms of how many "levels" the JSON objects have). We measure the duration it takes for parsing a JSON document and assigning all members of the JSON document to TwinCAT variables with direct element access.
31 |
32 | - Example 1: Object with 3 key/value pairs
33 | - Example 2: Object with 10 key/value pairs
34 | - Example 3: Object with 3 arrays, each containing 10 strings
35 | - Example 4: Object with 3 arrays, each containing 3 objects and each object has 10 key/value pairs
36 | - Example 5: Nested object with 10 levels object1.object2.(...).object9.string1...string10)
37 |
38 |
39 |

40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/Twinson.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # TcXaeShell Solution File, Format Version 11.00
4 | VisualStudioVersion = 15.0.28307.1300
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{DFBE7525-6864-4E62-8B2E-D530D69D9D96}") = "Twinson", "Twinson\Twinson.tspproj", "{89CAB0B8-499E-49B4-9579-841CA78DB4FF}"
7 | EndProject
8 | Project("{B1E792BE-AA5F-4E3C-8C82-674BF9C0715B}") = "Example", "Example\Example.tsproj", "{4DF7A4E5-A494-4507-B1A6-5F3C213DCC74}"
9 | EndProject
10 | Project("{B1E792BE-AA5F-4E3C-8C82-674BF9C0715B}") = "Benchmark", "Benchmark\Benchmark.tsproj", "{072FA0DE-2B58-429E-A171-0A0C055F18E4}"
11 | EndProject
12 | Global
13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
14 | Debug|TwinCAT CE7 (ARMV7) = Debug|TwinCAT CE7 (ARMV7)
15 | Debug|TwinCAT OS (ARMT2) = Debug|TwinCAT OS (ARMT2)
16 | Debug|TwinCAT RT (x64) = Debug|TwinCAT RT (x64)
17 | Debug|TwinCAT RT (x86) = Debug|TwinCAT RT (x86)
18 | Release|TwinCAT CE7 (ARMV7) = Release|TwinCAT CE7 (ARMV7)
19 | Release|TwinCAT OS (ARMT2) = Release|TwinCAT OS (ARMT2)
20 | Release|TwinCAT RT (x64) = Release|TwinCAT RT (x64)
21 | Release|TwinCAT RT (x86) = Release|TwinCAT RT (x86)
22 | EndGlobalSection
23 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
24 | {89CAB0B8-499E-49B4-9579-841CA78DB4FF}.Debug|TwinCAT CE7 (ARMV7).ActiveCfg = Debug|TwinCAT CE7 (ARMV7)
25 | {89CAB0B8-499E-49B4-9579-841CA78DB4FF}.Debug|TwinCAT CE7 (ARMV7).Build.0 = Debug|TwinCAT CE7 (ARMV7)
26 | {89CAB0B8-499E-49B4-9579-841CA78DB4FF}.Debug|TwinCAT OS (ARMT2).ActiveCfg = Debug|TwinCAT OS (ARMT2)
27 | {89CAB0B8-499E-49B4-9579-841CA78DB4FF}.Debug|TwinCAT OS (ARMT2).Build.0 = Debug|TwinCAT OS (ARMT2)
28 | {89CAB0B8-499E-49B4-9579-841CA78DB4FF}.Debug|TwinCAT RT (x64).ActiveCfg = Debug|TwinCAT RT (x64)
29 | {89CAB0B8-499E-49B4-9579-841CA78DB4FF}.Debug|TwinCAT RT (x64).Build.0 = Debug|TwinCAT RT (x64)
30 | {89CAB0B8-499E-49B4-9579-841CA78DB4FF}.Debug|TwinCAT RT (x86).ActiveCfg = Debug|TwinCAT RT (x86)
31 | {89CAB0B8-499E-49B4-9579-841CA78DB4FF}.Debug|TwinCAT RT (x86).Build.0 = Debug|TwinCAT RT (x86)
32 | {89CAB0B8-499E-49B4-9579-841CA78DB4FF}.Release|TwinCAT CE7 (ARMV7).ActiveCfg = Release|TwinCAT CE7 (ARMV7)
33 | {89CAB0B8-499E-49B4-9579-841CA78DB4FF}.Release|TwinCAT CE7 (ARMV7).Build.0 = Release|TwinCAT CE7 (ARMV7)
34 | {89CAB0B8-499E-49B4-9579-841CA78DB4FF}.Release|TwinCAT OS (ARMT2).ActiveCfg = Release|TwinCAT OS (ARMT2)
35 | {89CAB0B8-499E-49B4-9579-841CA78DB4FF}.Release|TwinCAT OS (ARMT2).Build.0 = Release|TwinCAT OS (ARMT2)
36 | {89CAB0B8-499E-49B4-9579-841CA78DB4FF}.Release|TwinCAT RT (x64).ActiveCfg = Release|TwinCAT RT (x64)
37 | {89CAB0B8-499E-49B4-9579-841CA78DB4FF}.Release|TwinCAT RT (x64).Build.0 = Release|TwinCAT RT (x64)
38 | {89CAB0B8-499E-49B4-9579-841CA78DB4FF}.Release|TwinCAT RT (x86).ActiveCfg = Release|TwinCAT RT (x86)
39 | {89CAB0B8-499E-49B4-9579-841CA78DB4FF}.Release|TwinCAT RT (x86).Build.0 = Release|TwinCAT RT (x86)
40 | {4DF7A4E5-A494-4507-B1A6-5F3C213DCC74}.Debug|TwinCAT CE7 (ARMV7).ActiveCfg = Debug|TwinCAT CE7 (ARMV7)
41 | {4DF7A4E5-A494-4507-B1A6-5F3C213DCC74}.Debug|TwinCAT CE7 (ARMV7).Build.0 = Debug|TwinCAT CE7 (ARMV7)
42 | {4DF7A4E5-A494-4507-B1A6-5F3C213DCC74}.Debug|TwinCAT OS (ARMT2).ActiveCfg = Debug|TwinCAT OS (ARMT2)
43 | {4DF7A4E5-A494-4507-B1A6-5F3C213DCC74}.Debug|TwinCAT OS (ARMT2).Build.0 = Debug|TwinCAT OS (ARMT2)
44 | {4DF7A4E5-A494-4507-B1A6-5F3C213DCC74}.Debug|TwinCAT RT (x64).ActiveCfg = Debug|TwinCAT RT (x64)
45 | {4DF7A4E5-A494-4507-B1A6-5F3C213DCC74}.Debug|TwinCAT RT (x64).Build.0 = Debug|TwinCAT RT (x64)
46 | {4DF7A4E5-A494-4507-B1A6-5F3C213DCC74}.Debug|TwinCAT RT (x86).ActiveCfg = Debug|TwinCAT RT (x86)
47 | {4DF7A4E5-A494-4507-B1A6-5F3C213DCC74}.Debug|TwinCAT RT (x86).Build.0 = Debug|TwinCAT RT (x86)
48 | {4DF7A4E5-A494-4507-B1A6-5F3C213DCC74}.Release|TwinCAT CE7 (ARMV7).ActiveCfg = Release|TwinCAT CE7 (ARMV7)
49 | {4DF7A4E5-A494-4507-B1A6-5F3C213DCC74}.Release|TwinCAT CE7 (ARMV7).Build.0 = Release|TwinCAT CE7 (ARMV7)
50 | {4DF7A4E5-A494-4507-B1A6-5F3C213DCC74}.Release|TwinCAT OS (ARMT2).ActiveCfg = Release|TwinCAT OS (ARMT2)
51 | {4DF7A4E5-A494-4507-B1A6-5F3C213DCC74}.Release|TwinCAT OS (ARMT2).Build.0 = Release|TwinCAT OS (ARMT2)
52 | {4DF7A4E5-A494-4507-B1A6-5F3C213DCC74}.Release|TwinCAT RT (x64).ActiveCfg = Release|TwinCAT RT (x64)
53 | {4DF7A4E5-A494-4507-B1A6-5F3C213DCC74}.Release|TwinCAT RT (x64).Build.0 = Release|TwinCAT RT (x64)
54 | {4DF7A4E5-A494-4507-B1A6-5F3C213DCC74}.Release|TwinCAT RT (x86).ActiveCfg = Release|TwinCAT RT (x86)
55 | {4DF7A4E5-A494-4507-B1A6-5F3C213DCC74}.Release|TwinCAT RT (x86).Build.0 = Release|TwinCAT RT (x86)
56 | {FBC3BAF2-75C0-4B60-AE92-63DA1C3B51ED}.Debug|TwinCAT CE7 (ARMV7).ActiveCfg = Debug|TwinCAT CE7 (ARMV7)
57 | {FBC3BAF2-75C0-4B60-AE92-63DA1C3B51ED}.Debug|TwinCAT CE7 (ARMV7).Build.0 = Debug|TwinCAT CE7 (ARMV7)
58 | {FBC3BAF2-75C0-4B60-AE92-63DA1C3B51ED}.Debug|TwinCAT OS (ARMT2).ActiveCfg = Debug|TwinCAT OS (ARMT2)
59 | {FBC3BAF2-75C0-4B60-AE92-63DA1C3B51ED}.Debug|TwinCAT OS (ARMT2).Build.0 = Debug|TwinCAT OS (ARMT2)
60 | {FBC3BAF2-75C0-4B60-AE92-63DA1C3B51ED}.Debug|TwinCAT RT (x64).ActiveCfg = Debug|TwinCAT RT (x64)
61 | {FBC3BAF2-75C0-4B60-AE92-63DA1C3B51ED}.Debug|TwinCAT RT (x64).Build.0 = Debug|TwinCAT RT (x64)
62 | {FBC3BAF2-75C0-4B60-AE92-63DA1C3B51ED}.Debug|TwinCAT RT (x86).ActiveCfg = Debug|TwinCAT RT (x86)
63 | {FBC3BAF2-75C0-4B60-AE92-63DA1C3B51ED}.Debug|TwinCAT RT (x86).Build.0 = Debug|TwinCAT RT (x86)
64 | {FBC3BAF2-75C0-4B60-AE92-63DA1C3B51ED}.Release|TwinCAT CE7 (ARMV7).ActiveCfg = Release|TwinCAT CE7 (ARMV7)
65 | {FBC3BAF2-75C0-4B60-AE92-63DA1C3B51ED}.Release|TwinCAT CE7 (ARMV7).Build.0 = Release|TwinCAT CE7 (ARMV7)
66 | {FBC3BAF2-75C0-4B60-AE92-63DA1C3B51ED}.Release|TwinCAT OS (ARMT2).ActiveCfg = Release|TwinCAT OS (ARMT2)
67 | {FBC3BAF2-75C0-4B60-AE92-63DA1C3B51ED}.Release|TwinCAT OS (ARMT2).Build.0 = Release|TwinCAT OS (ARMT2)
68 | {FBC3BAF2-75C0-4B60-AE92-63DA1C3B51ED}.Release|TwinCAT RT (x64).ActiveCfg = Release|TwinCAT RT (x64)
69 | {FBC3BAF2-75C0-4B60-AE92-63DA1C3B51ED}.Release|TwinCAT RT (x64).Build.0 = Release|TwinCAT RT (x64)
70 | {FBC3BAF2-75C0-4B60-AE92-63DA1C3B51ED}.Release|TwinCAT RT (x86).ActiveCfg = Release|TwinCAT RT (x86)
71 | {FBC3BAF2-75C0-4B60-AE92-63DA1C3B51ED}.Release|TwinCAT RT (x86).Build.0 = Release|TwinCAT RT (x86)
72 | {CED08849-BA70-4893-887E-F33DB9BA4C06}.Debug|TwinCAT CE7 (ARMV7).ActiveCfg = Debug|TwinCAT CE7 (ARMV7)
73 | {CED08849-BA70-4893-887E-F33DB9BA4C06}.Debug|TwinCAT CE7 (ARMV7).Build.0 = Debug|TwinCAT CE7 (ARMV7)
74 | {CED08849-BA70-4893-887E-F33DB9BA4C06}.Debug|TwinCAT OS (ARMT2).ActiveCfg = Debug|TwinCAT OS (ARMT2)
75 | {CED08849-BA70-4893-887E-F33DB9BA4C06}.Debug|TwinCAT OS (ARMT2).Build.0 = Debug|TwinCAT OS (ARMT2)
76 | {CED08849-BA70-4893-887E-F33DB9BA4C06}.Debug|TwinCAT RT (x64).ActiveCfg = Debug|TwinCAT RT (x64)
77 | {CED08849-BA70-4893-887E-F33DB9BA4C06}.Debug|TwinCAT RT (x64).Build.0 = Debug|TwinCAT RT (x64)
78 | {CED08849-BA70-4893-887E-F33DB9BA4C06}.Debug|TwinCAT RT (x86).ActiveCfg = Debug|TwinCAT RT (x86)
79 | {CED08849-BA70-4893-887E-F33DB9BA4C06}.Debug|TwinCAT RT (x86).Build.0 = Debug|TwinCAT RT (x86)
80 | {CED08849-BA70-4893-887E-F33DB9BA4C06}.Release|TwinCAT CE7 (ARMV7).ActiveCfg = Release|TwinCAT CE7 (ARMV7)
81 | {CED08849-BA70-4893-887E-F33DB9BA4C06}.Release|TwinCAT CE7 (ARMV7).Build.0 = Release|TwinCAT CE7 (ARMV7)
82 | {CED08849-BA70-4893-887E-F33DB9BA4C06}.Release|TwinCAT OS (ARMT2).ActiveCfg = Release|TwinCAT OS (ARMT2)
83 | {CED08849-BA70-4893-887E-F33DB9BA4C06}.Release|TwinCAT OS (ARMT2).Build.0 = Release|TwinCAT OS (ARMT2)
84 | {CED08849-BA70-4893-887E-F33DB9BA4C06}.Release|TwinCAT RT (x64).ActiveCfg = Release|TwinCAT RT (x64)
85 | {CED08849-BA70-4893-887E-F33DB9BA4C06}.Release|TwinCAT RT (x64).Build.0 = Release|TwinCAT RT (x64)
86 | {CED08849-BA70-4893-887E-F33DB9BA4C06}.Release|TwinCAT RT (x86).ActiveCfg = Release|TwinCAT RT (x86)
87 | {CED08849-BA70-4893-887E-F33DB9BA4C06}.Release|TwinCAT RT (x86).Build.0 = Release|TwinCAT RT (x86)
88 | {072FA0DE-2B58-429E-A171-0A0C055F18E4}.Debug|TwinCAT CE7 (ARMV7).ActiveCfg = Debug|TwinCAT CE7 (ARMV7)
89 | {072FA0DE-2B58-429E-A171-0A0C055F18E4}.Debug|TwinCAT CE7 (ARMV7).Build.0 = Debug|TwinCAT CE7 (ARMV7)
90 | {072FA0DE-2B58-429E-A171-0A0C055F18E4}.Debug|TwinCAT OS (ARMT2).ActiveCfg = Debug|TwinCAT OS (ARMT2)
91 | {072FA0DE-2B58-429E-A171-0A0C055F18E4}.Debug|TwinCAT OS (ARMT2).Build.0 = Debug|TwinCAT OS (ARMT2)
92 | {072FA0DE-2B58-429E-A171-0A0C055F18E4}.Debug|TwinCAT RT (x64).ActiveCfg = Debug|TwinCAT RT (x64)
93 | {072FA0DE-2B58-429E-A171-0A0C055F18E4}.Debug|TwinCAT RT (x64).Build.0 = Debug|TwinCAT RT (x64)
94 | {072FA0DE-2B58-429E-A171-0A0C055F18E4}.Debug|TwinCAT RT (x86).ActiveCfg = Debug|TwinCAT RT (x86)
95 | {072FA0DE-2B58-429E-A171-0A0C055F18E4}.Debug|TwinCAT RT (x86).Build.0 = Debug|TwinCAT RT (x86)
96 | {072FA0DE-2B58-429E-A171-0A0C055F18E4}.Release|TwinCAT CE7 (ARMV7).ActiveCfg = Release|TwinCAT CE7 (ARMV7)
97 | {072FA0DE-2B58-429E-A171-0A0C055F18E4}.Release|TwinCAT CE7 (ARMV7).Build.0 = Release|TwinCAT CE7 (ARMV7)
98 | {072FA0DE-2B58-429E-A171-0A0C055F18E4}.Release|TwinCAT OS (ARMT2).ActiveCfg = Release|TwinCAT OS (ARMT2)
99 | {072FA0DE-2B58-429E-A171-0A0C055F18E4}.Release|TwinCAT OS (ARMT2).Build.0 = Release|TwinCAT OS (ARMT2)
100 | {072FA0DE-2B58-429E-A171-0A0C055F18E4}.Release|TwinCAT RT (x64).ActiveCfg = Release|TwinCAT RT (x64)
101 | {072FA0DE-2B58-429E-A171-0A0C055F18E4}.Release|TwinCAT RT (x64).Build.0 = Release|TwinCAT RT (x64)
102 | {072FA0DE-2B58-429E-A171-0A0C055F18E4}.Release|TwinCAT RT (x86).ActiveCfg = Release|TwinCAT RT (x86)
103 | {072FA0DE-2B58-429E-A171-0A0C055F18E4}.Release|TwinCAT RT (x86).Build.0 = Release|TwinCAT RT (x86)
104 | {1187505C-F72E-4DFF-AE32-175AE96FDE48}.Debug|TwinCAT CE7 (ARMV7).ActiveCfg = Debug|TwinCAT CE7 (ARMV7)
105 | {1187505C-F72E-4DFF-AE32-175AE96FDE48}.Debug|TwinCAT CE7 (ARMV7).Build.0 = Debug|TwinCAT CE7 (ARMV7)
106 | {1187505C-F72E-4DFF-AE32-175AE96FDE48}.Debug|TwinCAT OS (ARMT2).ActiveCfg = Debug|TwinCAT OS (ARMT2)
107 | {1187505C-F72E-4DFF-AE32-175AE96FDE48}.Debug|TwinCAT OS (ARMT2).Build.0 = Debug|TwinCAT OS (ARMT2)
108 | {1187505C-F72E-4DFF-AE32-175AE96FDE48}.Debug|TwinCAT RT (x64).ActiveCfg = Debug|TwinCAT RT (x64)
109 | {1187505C-F72E-4DFF-AE32-175AE96FDE48}.Debug|TwinCAT RT (x64).Build.0 = Debug|TwinCAT RT (x64)
110 | {1187505C-F72E-4DFF-AE32-175AE96FDE48}.Debug|TwinCAT RT (x86).ActiveCfg = Debug|TwinCAT RT (x86)
111 | {1187505C-F72E-4DFF-AE32-175AE96FDE48}.Debug|TwinCAT RT (x86).Build.0 = Debug|TwinCAT RT (x86)
112 | {1187505C-F72E-4DFF-AE32-175AE96FDE48}.Release|TwinCAT CE7 (ARMV7).ActiveCfg = Release|TwinCAT CE7 (ARMV7)
113 | {1187505C-F72E-4DFF-AE32-175AE96FDE48}.Release|TwinCAT CE7 (ARMV7).Build.0 = Release|TwinCAT CE7 (ARMV7)
114 | {1187505C-F72E-4DFF-AE32-175AE96FDE48}.Release|TwinCAT OS (ARMT2).ActiveCfg = Release|TwinCAT OS (ARMT2)
115 | {1187505C-F72E-4DFF-AE32-175AE96FDE48}.Release|TwinCAT OS (ARMT2).Build.0 = Release|TwinCAT OS (ARMT2)
116 | {1187505C-F72E-4DFF-AE32-175AE96FDE48}.Release|TwinCAT RT (x64).ActiveCfg = Release|TwinCAT RT (x64)
117 | {1187505C-F72E-4DFF-AE32-175AE96FDE48}.Release|TwinCAT RT (x64).Build.0 = Release|TwinCAT RT (x64)
118 | {1187505C-F72E-4DFF-AE32-175AE96FDE48}.Release|TwinCAT RT (x86).ActiveCfg = Release|TwinCAT RT (x86)
119 | {1187505C-F72E-4DFF-AE32-175AE96FDE48}.Release|TwinCAT RT (x86).Build.0 = Release|TwinCAT RT (x86)
120 | EndGlobalSection
121 | GlobalSection(SolutionProperties) = preSolution
122 | HideSolutionNode = FALSE
123 | EndGlobalSection
124 | GlobalSection(ExtensibilityGlobals) = postSolution
125 | SolutionGuid = {68136443-3350-4B9C-B1CF-2AFB4386650C}
126 | EndGlobalSection
127 | EndGlobal
128 |
--------------------------------------------------------------------------------
/Twinson/Twinson.tspproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Twinson/Twinson.tspproj.bak:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Twinson/Twinson/JsonDecoder/IJsonElement.TcIO:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Twinson/Twinson/JsonDecoder/JsonDecoder.TcPOU:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
25 |
26 |
27 |
28 |
29 |
38 |
39 | 16#2E AND_THEN readPtr^ <> 16#5B AND_THEN readPtr^ <> 16#5D AND_THEN readPtr^ <> 16#0 // eof, . or [
48 | DO
49 | writePtr^ := readPtr^;
50 | writePtr := writePtr + 1;
51 | readPtr := readPtr + 1;
52 | END_WHILE
53 | writePtr^ := 0;
54 |
55 | IF readPtr^ = 16#5D // skip ]
56 | THEN
57 | readPtr := readPtr + 1;
58 | END_IF
59 |
60 | IF readPtr^ = 16#2E // skip .
61 | THEN
62 | readPtr := readPtr + 1;
63 | END_IF
64 |
65 | IF readPtr^ = 16#5B // skip [
66 | THEN
67 | readPtr := readPtr + 1;
68 | END_IF
69 | END_IF
70 |
71 | IF node.Name = _key
72 | THEN
73 | IF readPtr^ <> 0
74 | THEN
75 | node REF= node.Child;
76 | next := TRUE;
77 | ELSIF __ISVALIDREF(node.Element) // direct access, exact match
78 | THEN
79 | _Element := node.Element;
80 | RETURN;
81 | END_IF
82 | ELSE
83 | node REF= node.Next;
84 | END_IF
85 |
86 | END_WHILE]]>
87 |
88 |
89 |
90 |
95 |
96 |
98 |
99 |
100 |
101 |
108 |
109 |
116 |
117 |
118 |
119 |
127 |
128 | _jsonPtr
141 | DO
142 | namePtr^ := memPtr^;
143 | namePtr := namePtr + 1;
144 | memPtr := memPtr + 1;
145 | END_WHILE
146 | namePtr^ := 0;
147 | // reset elements
148 | AddNode.Child REF= 0;
149 | _nodeCount := _nodeCount + 1;
150 |
151 | ]]>
152 |
153 |
154 |
155 |
159 |
160 | 0
167 | DO
168 | SkipWhitespaces();
169 |
170 | CASE GuessElementType()
171 | OF
172 | JsonElementType.Object:
173 | ParseObject(_root);
174 | JsonElementType.Arry:
175 | _memPtr := _jsonPtr;
176 | _root.Child REF= AddNode(_root);
177 | _root.Child.Name := 'array';
178 | ParseArray(_root.Child);
179 | ELSE
180 | Abort('Unexpected character');
181 | RETURN;
182 | END_CASE
183 |
184 | _jsonPtr := _jsonPtr + 1;
185 | END_WHILE]]>
186 |
187 |
188 |
189 |
193 |
194 |
195 |
196 |
197 |
198 |
200 |
201 |
222 |
223 |
224 |
225 |
237 |
238 |
271 |
272 |
273 |
274 |
283 |
284 | 0
304 | THEN
305 | // skip ]
306 | _jsonPtr := _jsonPtr + 1;
307 | END_IF]]>
308 |
309 |
310 |
311 |
319 |
320 |
359 |
360 |
361 |
362 |
370 |
371 | JsonElementType.Strng
379 | THEN
380 | Abort('Unexpected character');
381 | RETURN;
382 | END_IF
383 |
384 | // skip "
385 | _jsonPtr := _jsonPtr + 1;
386 | _memPtr := _jsonPtr;
387 | SkipString();
388 |
389 | // chain key
390 | child REF= AddNode(node);
391 |
392 | // skip " and additional whitespaces
393 | _jsonPtr := _jsonPtr + 1;
394 | SkipWhitespaces();
395 |
396 | IF _jsonPtr^ <> 16#3A // :
397 | THEN
398 | Abort('Expected colon');
399 | RETURN;
400 | END_IF
401 |
402 | // skip :
403 | _jsonPtr := _jsonPtr + 1;
404 | ParseElement(child);
405 |
406 | // got another element in this object?
407 | IF _jsonPtr^ = 16#2C // ,
408 | THEN
409 | _jsonPtr := _jsonPtr + 1; // ,
410 | SkipWhitespaces();
411 | END_IF
412 |
413 | UNTIL _jsonPtr^ = 16#7D OR_ELSE _jsonPtr^ = 0 END_REPEAT // } or EOF
414 |
415 | IF _jsonPtr^ <> 0
416 | THEN
417 | // skip }
418 | _jsonPtr := _jsonPtr + 1;
419 | END_IF]]>
420 |
421 |
422 |
423 |
425 |
426 |
434 |
435 |
436 |
437 |
439 |
440 | = 16#30 AND_THEN _jsonPtr^ <= 16#39) OR_ELSE _jsonPtr^ = 16#2B OR_ELSE _jsonPtr^ = 16#2D OR_ELSE _jsonPtr^ = 16#2E OR_ELSE _jsonPtr^ = 16#65 OR_ELSE _jsonPtr^ = 16#45
441 | DO
442 | _jsonPtr := _jsonPtr + 1;
443 | END_WHILE ]]>
444 |
445 |
446 |
447 |
448 |
449 | 16#22
450 | DO
451 | _jsonPtr := _jsonPtr + 1;
452 | END_WHILE]]>
453 |
454 |
455 |
456 |
458 |
459 | 0 AND_THEN _jsonPtr^ <= 16#20
460 | DO
461 | _jsonPtr := _jsonPtr + 1;
462 | END_WHILE]]>
463 |
464 |
465 |
466 |
--------------------------------------------------------------------------------
/Twinson/Twinson/JsonDecoder/JsonElement.TcPOU:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
13 |
14 |
15 |
21 |
22 | EndPtr
25 | DO
26 | retrn^ := it^;
27 | retrn := retrn + 1;
28 | it := it + 1;
29 | END_WHILE
30 |
31 | retrn^ := 0;]]>
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/Twinson/Twinson/JsonDecoder/JsonElementType.TcDUT:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
17 |
18 |
--------------------------------------------------------------------------------
/Twinson/Twinson/JsonDecoder/JsonNode.TcDUT:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
13 |
14 |
--------------------------------------------------------------------------------
/Twinson/Twinson/JsonDecoder/_Test/JsonDecoderTest.TcPOU:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
18 |
19 | 0, '');
25 | assertions.IsTrue(element1 <> 0, '');
26 | assertions.IsTrue(element2 <> 0, '');
27 |
28 | IF element0 <> 0 AND element1 <> 0 AND element2 <> 0
29 | THEN
30 | assertions.EqualsString('4', element0.AsString(), '');
31 | assertions.EqualsString('2', element1.AsString(), '');
32 | assertions.EqualsString('3', element2.AsString(), '');
33 | END_IF
34 |
35 | ]]>
36 |
37 |
38 |
39 |
46 |
47 |
66 |
67 |
68 |
69 |
76 |
77 |
84 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/Twinson/Twinson/ParameterList.TcGVL:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
--------------------------------------------------------------------------------
/Twinson/Twinson/Twinson.plcproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 1.0.0.0
5 | 2.0
6 | {fbc3baf2-75c0-4b60-ae92-63da1c3b51ed}
7 | True
8 | true
9 | true
10 | false
11 | Twinson
12 | 3.1.4023.0
13 | {04d94465-c10f-450d-8700-f502a2018e30}
14 | {989705c5-82a5-473e-9837-4fff0e29a01c}
15 | {30015076-e5e7-4055-b8b1-20d38a620560}
16 | {e6264601-6628-4927-b5ce-b4f503529407}
17 | {2bb9c6f5-c100-4908-b2ae-6c1a228bb568}
18 | {710a8004-8301-4cb4-83c0-3794ae84cfed}
19 | Stefan Besler
20 | false
21 | Twinson
22 | 0.2.0.0
23 | Twinson
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | Code
35 |
36 |
37 | Code
38 |
39 |
40 | Code
41 |
42 |
43 | Code
44 |
45 |
46 | Code
47 |
48 |
49 | Code
50 |
51 |
52 | Code
53 | true
54 |
55 |
56 | Code
57 |
58 |
59 | Code
60 |
61 |
62 |
63 |
64 | Content
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 | "<ProjectRoot>"
73 |
74 | {192FAD59-8248-4824-A8DE-9177C94C195A}
75 |
76 | "{192FAD59-8248-4824-A8DE-9177C94C195A}"
77 |
78 |
79 |
80 | {8F99A816-E488-41E4-9FA3-846536012284}
81 |
82 | "{8F99A816-E488-41E4-9FA3-846536012284}"
83 |
84 |
85 |
86 | {40450F57-0AA3-4216-96F3-5444ECB29763}
87 |
88 | "{40450F57-0AA3-4216-96F3-5444ECB29763}"
89 |
90 |
91 | ActiveVisuProfile
92 | IR0whWr8bwfwBwAAiD2qpQAAAABVAgAA37x72QAAAAABAAAAAAAAAAEaUwB5AHMAdABlAG0ALgBTAHQAcgBpAG4AZwACTHsAZgA5ADUAYgBiADQAMgA2AC0ANQA1ADIANAAtADQAYgA0ADUALQA5ADQAMAAwAC0AZgBiADAAZgAyAGUANwA3AGUANQAxAGIAfQADCE4AYQBtAGUABDBUAHcAaQBuAEMAQQBUACAAMwAuADEAIABCAHUAaQBsAGQAIAA0ADAAMgA0AC4ANwAFFlAAcgBvAGYAaQBsAGUARABhAHQAYQAGTHsAMQA2AGUANQA1AGIANgAwAC0ANwAwADQAMwAtADQAYQA2ADMALQBiADYANQBiAC0ANgAxADQANwAxADMAOAA3ADgAZAA0ADIAfQAHEkwAaQBiAHIAYQByAGkAZQBzAAhMewAzAGIAZgBkADUANAA1ADkALQBiADAANwBmAC0ANABkADYAZQAtAGEAZQAxAGEALQBhADgAMwAzADUANgBhADUANQAxADQAMgB9AAlMewA5AGMAOQA1ADgAOQA2ADgALQAyAGMAOAA1AC0ANAAxAGIAYgAtADgAOAA3ADEALQA4ADkANQBmAGYAMQBmAGUAZABlADEAYQB9AAoOVgBlAHIAcwBpAG8AbgALBmkAbgB0AAwKVQBzAGEAZwBlAA0KVABpAHQAbABlAA4aVgBpAHMAdQBFAGwAZQBtAE0AZQB0AGUAcgAPDkMAbwBtAHAAYQBuAHkAEAxTAHkAcwB0AGUAbQARElYAaQBzAHUARQBsAGUAbQBzABIwVgBpAHMAdQBFAGwAZQBtAHMAUwBwAGUAYwBpAGEAbABDAG8AbgB0AHIAbwBsAHMAEyhWAGkAcwB1AEUAbABlAG0AcwBXAGkAbgBDAG8AbgB0AHIAbwBsAHMAFCRWAGkAcwB1AEUAbABlAG0AVABlAHgAdABFAGQAaQB0AG8AcgAVIlYAaQBzAHUATgBhAHQAaQB2AGUAQwBvAG4AdAByAG8AbAAWFHYAaQBzAHUAaQBuAHAAdQB0AHMAFwxzAHkAcwB0AGUAbQAYGFYAaQBzAHUARQBsAGUAbQBCAGEAcwBlABkmRABlAHYAUABsAGEAYwBlAGgAbwBsAGQAZQByAHMAVQBzAGUAZAAaCGIAbwBvAGwAGyJQAGwAdQBnAGkAbgBDAG8AbgBzAHQAcgBhAGkAbgB0AHMAHEx7ADQAMwBkADUAMgBiAGMAZQAtADkANAAyAGMALQA0ADQAZAA3AC0AOQBlADkANAAtADEAYgBmAGQAZgAzADEAMABlADYAMwBjAH0AHRxBAHQATABlAGEAcwB0AFYAZQByAHMAaQBvAG4AHhRQAGwAdQBnAGkAbgBHAHUAaQBkAB8WUwB5AHMAdABlAG0ALgBHAHUAaQBkACBIYQBmAGMAZAA1ADQANAA2AC0ANAA5ADEANAAtADQAZgBlADcALQBiAGIANwA4AC0AOQBiAGYAZgBlAGIANwAwAGYAZAAxADcAIRRVAHAAZABhAHQAZQBJAG4AZgBvACJMewBiADAAMwAzADYANgBhADgALQBiADUAYwAwAC0ANABiADkAYQAtAGEAMAAwAGUALQBlAGIAOAA2ADAAMQAxADEAMAA0AGMAMwB9ACMOVQBwAGQAYQB0AGUAcwAkTHsAMQA4ADYAOABmAGYAYwA5AC0AZQA0AGYAYwAtADQANQAzADIALQBhAGMAMAA2AC0AMQBlADMAOQBiAGIANQA1ADcAYgA2ADkAfQAlTHsAYQA1AGIAZAA0ADgAYwAzAC0AMABkADEANwAtADQAMQBiADUALQBiADEANgA0AC0ANQBmAGMANgBhAGQAMgBiADkANgBiADcAfQAmFk8AYgBqAGUAYwB0AHMAVAB5AHAAZQAnVFUAcABkAGEAdABlAEwAYQBuAGcAdQBhAGcAZQBNAG8AZABlAGwARgBvAHIAQwBvAG4AdgBlAHIAdABpAGIAbABlAEwAaQBiAHIAYQByAGkAZQBzACgQTABpAGIAVABpAHQAbABlACkUTABpAGIAQwBvAG0AcABhAG4AeQAqHlUAcABkAGEAdABlAFAAcgBvAHYAaQBkAGUAcgBzACs4UwB5AHMAdABlAG0ALgBDAG8AbABsAGUAYwB0AGkAbwBuAHMALgBIAGEAcwBoAHQAYQBiAGwAZQAsEnYAaQBzAHUAZQBsAGUAbQBzAC1INgBjAGIAMQBjAGQAZQAxAC0AZAA1AGQAYwAtADQAYQAzAGIALQA5ADAANQA0AC0AMgAxAGYAYQA3ADUANgBhADMAZgBhADQALihJAG4AdABlAHIAZgBhAGMAZQBWAGUAcgBzAGkAbwBuAEkAbgBmAG8AL0x7AGMANgAxADEAZQA0ADAAMAAtADcAZgBiADkALQA0AGMAMwA1AC0AYgA5AGEAYwAtADQAZQAzADEANABiADUAOQA5ADYANAAzAH0AMBhNAGEAagBvAHIAVgBlAHIAcwBpAG8AbgAxGE0AaQBuAG8AcgBWAGUAcgBzAGkAbwBuADIMTABlAGcAYQBjAHkAMzBMAGEAbgBnAHUAYQBnAGUATQBvAGQAZQBsAFYAZQByAHMAaQBvAG4ASQBuAGYAbwA0MEwAbwBhAGQATABpAGIAcgBhAHIAaQBlAHMASQBuAHQAbwBQAHIAbwBqAGUAYwB0ADUaQwBvAG0AcABhAHQAaQBiAGkAbABpAHQAeQDQAAIaA9ADAS0E0AUGGgfQBwgaAUUHCQjQAAkaBEUKCwQDAAAABQAAAA0AAAAAAAAA0AwLrQIAAADQDQEtDtAPAS0Q0AAJGgRFCgsEAwAAAAUAAAANAAAAKAAAANAMC60BAAAA0A0BLRHQDwEtENAACRoERQoLBAMAAAAFAAAADQAAAAAAAADQDAutAgAAANANAS0S0A8BLRDQAAkaBEUKCwQDAAAABQAAAA0AAAAUAAAA0AwLrQIAAADQDQEtE9APAS0Q0AAJGgRFCgsEAwAAAAUAAAANAAAAAAAAANAMC60CAAAA0A0BLRTQDwEtENAACRoERQoLBAMAAAAFAAAADQAAAAAAAADQDAutAgAAANANAS0V0A8BLRDQAAkaBEUKCwQDAAAABQAAAA0AAAAAAAAA0AwLrQIAAADQDQEtFtAPAS0X0AAJGgRFCgsEAwAAAAUAAAANAAAAKAAAANAMC60EAAAA0A0BLRjQDwEtENAZGq0BRRscAdAAHBoCRR0LBAMAAAAFAAAADQAAAAAAAADQHh8tINAhIhoCRSMkAtAAJRoFRQoLBAMAAAADAAAAAAAAAAoAAADQJgutAAAAANADAS0n0CgBLRHQKQEtENAAJRoFRQoLBAMAAAADAAAAAAAAAAoAAADQJgutAQAAANADAS0n0CgBLRHQKQEtEJoqKwFFAAEC0AABLSzQAAEtF9AAHy0t0C4vGgPQMAutAQAAANAxC60XAAAA0DIarQDQMy8aA9AwC60CAAAA0DELrQMAAADQMhqtANA0Gq0A0DUarQA=
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 | System.Collections.Hashtable
101 | {54dd0eac-a6d8-46f2-8c27-2f43c7e49861}
102 | System.String
103 |
104 |
105 |
106 |
107 |
--------------------------------------------------------------------------------
/Twinson/Twinson/UnitTest/IAssertions.TcIO:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
15 |
16 |
17 |
23 |
24 |
25 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/Twinson/Twinson/UnitTest/IUnittest.TcIO:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
--------------------------------------------------------------------------------
/benchmark_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stefanbesler/Twinson/71a20245d0d954696e4e126fb9208718cb8e3630/benchmark_2.png
--------------------------------------------------------------------------------