Skip to content

Commit b87f3f1

Browse files
author
Thomas Schmidt
committed
initial upload
0 parents  commit b87f3f1

File tree

400 files changed

+5779
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

400 files changed

+5779
-0
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.db
2+
.project
3+
.directory

GPLv3-license.txt

+674
Large diffs are not rendered by default.

MIT-license.txt

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright (c) 2009-2012 Thomas Schmidt
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this
4+
software and associated documentation files (the "Software"), to deal in the Software
5+
without restriction, including without limitation the rights to use, copy, modify, merge,
6+
publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
7+
to whom the Software is furnished to do so, subject to the following conditions:
8+
9+
The above copyright notice and this permission notice shall be included in all copies or
10+
substantial portions of the Software.
11+
12+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
13+
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
14+
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
15+
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
16+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
17+
DEALINGS IN THE SOFTWARE.
18+
19+
20+

docs/TAME-API.odt

33.3 KB
Binary file not shown.

docs/TAME-API.pdf

670 KB
Binary file not shown.

examples/plc/demo.pro

15.8 KB
Binary file not shown.

examples/readme.txt

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
- Edit "tamex\resources\webservice.js" and change the parameters of the webservice to your needs.
2+
- Copy the "tamex"-folder to your webserver with the ADS-Webservice installed.
3+
- Open the "plc\demo.pro" in TwinCAT, build and run it on your PLC.
4+
- Open "http:\\your_web_server\tamex\index.html" with your favorite browser.
5+
6+

examples/tamex/array/css/demo.css

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/* body */
2+
html, body {
3+
margin-top: 0px;
4+
margin-bottom: 0px;
5+
margin-left: 0px;
6+
margin-right: 0px;
7+
padding-top: 0px;
8+
padding-bottom: 0px;
9+
padding-left: 0px;
10+
padding-right: 0px;
11+
border-top: 0px;
12+
border-bottom: 0px;
13+
border-left: 0px;
14+
border-right: 0px;
15+
font-family: helvetica, arial, sans-serif;
16+
color: #000;
17+
font-size: 12px;
18+
}
19+
20+
21+
/* outer box */
22+
#wrapper {
23+
width: 100%;
24+
height: 100%;
25+
position: absolute;
26+
top: 0px;
27+
left: 0px;
28+
}
29+
30+
h1 {
31+
font-size: 20px;
32+
font-weight: bold;
33+
text-align: center;
34+
color: #fff;
35+
background-color: #f00;
36+
width: 100%;
37+
padding-top: 20px;
38+
padding-bottom: 20px;
39+
margin-top: 0px;
40+
margin-bottom: 30px;
41+
}
42+
43+
h2 {
44+
font-size: 16px;
45+
padding-top: 20px;
46+
padding-bottom: 20px;
47+
margin-left: 50px;
48+
}
49+
50+
51+
.inputfield {
52+
margin-left: 50px;
53+
margin-right: 10px;
54+
}
55+
56+
.inputlabel {
57+
position: relative;
58+
top: -2px;
59+
left: 50px;
60+
font-weight: bold;
61+
}
62+
63+
.recfield {
64+
margin-left: 10px;
65+
border: 1px solid grey;
66+
padding: 2px;
67+
font-size: 14px;
68+
min-width: 100px;
69+
}
70+
71+
.sendbutt {
72+
margin-left: 50px;
73+
}
74+
75+
#stringIdx, #boolIdx {
76+
width: 1em;
77+
margin-left: 50px;
78+
}
79+
80+

examples/tamex/array/index.html

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2+
3+
<html>
4+
<head>
5+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6+
<title>Example Using Arrays With TAME</title>
7+
<link rel="stylesheet" href="css/demo.css" type="text/css" media="screen" charset="utf-8" />
8+
<script src="../resources/tame.js" type="text/javascript"></script>
9+
<script src="../resources/webservice.js" type="text/javascript"></script>
10+
<script src="js/demo.js" type="text/javascript"></script>
11+
</head>
12+
13+
<body>
14+
<div id="wrapper"><!-- begin wrapper -->
15+
16+
<h1>Example Using Arrays With TAME</h1>
17+
18+
<h2>If an array index (0-5) is specified in the "Send only"-field,<br />
19+
only this single item will be sent to the PLC.
20+
</h2>
21+
22+
<h2>An array of string variables.</h2>
23+
24+
<input type="text" id="inputstring0" class="inputfield" maxlength="10" />
25+
<span id="showstring0" class="recfield">No Data</span><br /><br />
26+
27+
<input type="text" id="inputstring1" class="inputfield" maxlength="10" />
28+
<span id="showstring1" class="recfield">No Data</span><br /><br />
29+
30+
<input type="text" id="inputstring2" class="inputfield" maxlength="10" />
31+
<span id="showstring2" class="recfield">No Data</span><br /><br />
32+
33+
<input type="text" id="inputstring3" class="inputfield" maxlength="10" />
34+
<span id="showstring3" class="recfield">No Data</span><br /><br />
35+
36+
<input type="text" id="inputstring4" class="inputfield" maxlength="10" />
37+
<span id="showstring4" class="recfield">No Data</span><br /><br />
38+
39+
<span class="inputlabel">Send only:</span><br />
40+
<input type="text" id="stringIdx" maxlength="1" /><br /><br />
41+
<button class="sendbutt" id="button1">Send</button><br /><br /><br />
42+
43+
<h2>An array of boolean variables.</h2>
44+
45+
<input type="checkbox" id="inputbool0" class="inputfield" maxlength="10" />
46+
<span id="showbool0" class="recfield">No Data</span><br /><br />
47+
48+
<input type="checkbox" id="inputbool1" class="inputfield" maxlength="10" />
49+
<span id="showbool1" class="recfield">No Data</span><br /><br />
50+
51+
<input type="checkbox" id="inputbool2" class="inputfield" maxlength="10" />
52+
<span id="showbool2" class="recfield">No Data</span><br /><br />
53+
54+
<input type="checkbox" id="inputbool3" class="inputfield" maxlength="10" />
55+
<span id="showbool3" class="recfield">No Data</span><br /><br />
56+
57+
<input type="checkbox" id="inputbool4" class="inputfield" maxlength="10" />
58+
<span id="showbool4" class="recfield">No Data</span><br /><br />
59+
60+
<span class="inputlabel">Send only:</span><br />
61+
<input type="text" id="boolIdx" maxlength="1" /><br /><br />
62+
<button class="sendbutt" id="button2">Send</button><br /><br />
63+
64+
</div><!-- end wrapper -->
65+
66+
</body>
67+
</html>

examples/tamex/array/js/demo.js

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
/**
2+
* @author T.Schmidt, 31.10.2011
3+
* Example using arrays with TAME.
4+
*/
5+
6+
//A global variable as namespace
7+
var Demo = {
8+
stringArrayIn: [],
9+
stringArrayOut: [],
10+
boolArrayIn: [],
11+
boolArrayOut: []
12+
};
13+
14+
15+
window.onload = function(){
16+
17+
/*
18+
* Array of STRING
19+
*/
20+
21+
//Button for sending values to the PLC, can be a local variable.
22+
//50ms after writing the function for reading is called.
23+
var button1 = document.getElementById("button1");
24+
25+
button1.onclick = function(){
26+
for (var i = 0; i < 5; i++) {
27+
Demo.stringArrayOut[i] = document.getElementById("inputstring" + i).value;
28+
}
29+
var item = parseInt((document.getElementById("stringIdx").value), 10);
30+
Plc.writeArrayOfString({
31+
addr: '%MB250',
32+
val: Demo.stringArrayOut,
33+
item: item,
34+
arrlen: 5,
35+
strlen: 10,
36+
oc: Demo.readStringArray,
37+
ocd: 50
38+
});
39+
};
40+
41+
Demo.readStringArray = function(){
42+
Plc.readArrayOfString({
43+
addr: '%MB250',
44+
strlen: 10,
45+
arrlen: 5,
46+
jvar: 'Demo.stringArrayIn',
47+
oc: function() {
48+
for (var i = 0; i < 5; i++) {
49+
document.getElementById("showstring" + i).firstChild.data = Demo.stringArrayIn[i];
50+
}
51+
}
52+
});
53+
};
54+
55+
56+
/*
57+
* Array of BOOL
58+
*/
59+
60+
var button2 = document.getElementById("button2");
61+
62+
button2.onclick = function(){
63+
for (var i = 0; i < 5; i++) {
64+
Demo.boolArrayOut[i] = document.getElementById("inputbool" + i).checked;
65+
}
66+
var item2 = parseInt((document.getElementById("boolIdx").value), 10);
67+
Plc.writeArrayOfBool({
68+
addr: '%MB310',
69+
val: Demo.boolArrayOut,
70+
item: item2,
71+
arrlen: 5,
72+
oc: Demo.readBoolArray,
73+
ocd: 50
74+
});
75+
};
76+
77+
Demo.readBoolArray = function(){
78+
Plc.readArrayOfBool({
79+
addr: '%MB310',
80+
arrlen: 5,
81+
jvar: 'Demo.boolArrayIn',
82+
oc: function() {
83+
for (var i = 0; i < 5; i++) {
84+
document.getElementById("showbool" + i).firstChild.data = Demo.boolArrayIn[i];
85+
}
86+
}
87+
});
88+
};
89+
90+
};
91+
92+

examples/tamex/basic/css/demo.css

+114
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
/* body */
2+
html, body {
3+
margin-top: 0px;
4+
margin-bottom: 0px;
5+
margin-left: 0px;
6+
margin-right: 0px;
7+
padding-top: 0px;
8+
padding-bottom: 0px;
9+
padding-left: 0px;
10+
padding-right: 0px;
11+
border-top: 0px;
12+
border-bottom: 0px;
13+
border-left: 0px;
14+
border-right: 0px;
15+
font-family: helvetica, arial, sans-serif;
16+
color: #000;
17+
font-size: 12px;
18+
}
19+
20+
21+
/* outer box */
22+
#wrapper {
23+
width: 100%;
24+
height: 100%;
25+
position: absolute;
26+
top: 0px;
27+
left: 0px;
28+
}
29+
30+
h1 {
31+
font-size: 20px;
32+
font-weight: bold;
33+
text-align: center;
34+
color: #fff;
35+
background-color: #f00;
36+
width: 100%;
37+
padding-top: 20px;
38+
padding-bottom: 20px;
39+
margin-top: 0px;
40+
margin-bottom: 30px;
41+
}
42+
43+
h2 {
44+
font-size: 16px;
45+
padding-top: 20px;
46+
padding-bottom: 20px;
47+
margin-left: 50px;
48+
}
49+
50+
51+
.inputfield {
52+
margin-left: 50px;
53+
margin-right: 10px;
54+
}
55+
56+
.inputlabel {
57+
position: relative;
58+
top: -2px;
59+
left: 50px;
60+
font-weight: bold;
61+
}
62+
63+
.recfield {
64+
margin-left: 10px;
65+
border: 1px solid grey;
66+
padding: 2px;
67+
font-size: 14px;
68+
min-width: 100px;
69+
}
70+
71+
.checkboxlabel {
72+
margin-right: 72px;
73+
}
74+
75+
.sendbutt2 {
76+
margin-left: 50px;
77+
}
78+
79+
#ramps {
80+
position: absolute;
81+
top: 100px;
82+
left: 700px;
83+
font-weight: bold;
84+
font-size: 14px;
85+
}
86+
87+
#ramp1 {
88+
font-weight: bold;
89+
font-size: 30px;
90+
}
91+
92+
#ramp2 {
93+
font-weight: bold;
94+
font-size: 30px;
95+
}
96+
97+
#runlight {
98+
position: absolute;
99+
top: 220px;
100+
left: 700px;
101+
font-weight: bold;
102+
font-size: 14px;
103+
}
104+
105+
.light {
106+
border: 1px solid black;
107+
background: red;
108+
width: 20px;
109+
height: 20px;
110+
margin-right: 5px;
111+
margin-top: 5px;
112+
float: left;
113+
}
114+

0 commit comments

Comments
 (0)