summaryrefslogtreecommitdiffstats
path: root/tests/tc700_hardware/pixtend/pixtend-peripheral-io.awlpro
blob: b9f924e0817b713882d9137743e6a6924ab7108e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- Awlsim project file generated by awlsim-0.66.0-pre -->
<awlsim_project date_create="2018-02-19 20:48:29.703161"
                date_modify="2018-07-08 18:00:16.840889"
                format_version="1">
	<!-- CPU core configuration -->
	<cpu>
		<!-- CPU core feature specification -->
		<specs call_stack_size="256"
		       nr_accus="2"
		       nr_counters="256"
		       nr_flags="2048"
		       nr_inputs="128"
		       nr_localbytes="1024"
		       nr_outputs="128"
		       nr_timers="256"
		       parenthesis_stack_size="7" />

		<!-- CPU core configuration -->
		<config clock_memory_byte="-1"
		        cycle_time_limit_us="1000000"
		        ext_insns_enable="1"
		        mnemonics="2"
		        ob_startinfo_enable="0"
		        run_time_limit_us="-1" />
	</cpu>

	<!-- AWL/STL language configuration -->
	<language_awl>
		<!-- AWL/STL source code -->
		<source enabled="1"
		        name="Main source"
		        type="0"><![CDATA[
FUNCTION FC 1 : VOID
BEGIN
	// Set PWM0
	// The magic value is checked by the fake PiXtend-Spidev module
	L		W#16#1337
	T		PAW 42
	
	// Set PWM1
	// The magic value is checked by the fake PiXtend-Spidev module
	L		W#16#4224
	T		PAW 420
	
	
	// Check AI0
	// The fake PiXtend spidev module always reports 1 V
	L		PEW 42
	L		2754
	__ASSERT==	__ACCU 1,	__ACCU 2
	
	// Check AI1
	// The fake PiXtend spidev module always reports 2 V
	L		PEW 420
	L		5535
	__ASSERT==	__ACCU 1,	__ACCU 2
	
END_FUNCTION


ORGANIZATION_BLOCK OB 1
BEGIN
	CALL		FC 1
	
	// If we ran 5 test cycles then exit.                                                                              
	L		MW 100
	+		1
	T		MW 100
	L		5
	<I
	BEB
	CALL            SFC 46 // Exit test; Stop CPU.
END_ORGANIZATION_BLOCK


ORGANIZATION_BLOCK OB 100
BEGIN
	L		0
	T		MW 100
	CALL		FC 1
END_ORGANIZATION_BLOCK
]]></source>
	</language_awl>

	<!-- Symbol table configuration -->
	<symbols>
		<!-- symbol table source code -->
		<source enabled="1"
		        name="Main table"
		        type="3"><![CDATA[

]]></source>
	</symbols>

	<!-- Core server link configuration -->
	<core_link>
		<!-- Locally spawned core server -->
		<spawn_local enable="1"
		             interpreters="$DEFAULT"
		             port_range_begin="4183"
		             port_range_end="8278" />

		<!-- Remote server connection -->
		<connect host="localhost"
		         port="4151"
		         timeout_ms="3000" />

		<!-- Transport tunnel -->
		<tunnel local_port="-1"
		        type="0">
			<ssh executable="ssh"
			     port="22"
			     user="pi" />
		</tunnel>
	</core_link>

	<!-- Hardware modules configuration -->
	<hardware>
		<!-- Loaded hardware module -->
		<module name="pixtend">
			<params>
				<param name="analogIn0_10V"
				       value="True" />
				<param name="analogIn0_addr"
				       value="EW 42" />
				<param name="analogIn0_nos"
				       value="10" />
				<param name="analogIn1_10V"
				       value="True" />
				<param name="analogIn1_addr"
				       value="EW 420" />
				<param name="analogIn1_nos"
				       value="10" />
				<param name="analogIn2_addr" />
				<param name="analogIn2_nos"
				       value="10" />
				<param name="analogIn3_addr" />
				<param name="analogIn3_nos"
				       value="10" />
				<param name="analogIn_kHz"
				       value="125" />
				<param name="analogOut0_addr" />
				<param name="analogOut1_addr" />
				<param name="digitalIn0_addr" />
				<param name="digitalIn1_addr" />
				<param name="digitalIn2_addr" />
				<param name="digitalIn3_addr" />
				<param name="digitalIn4_addr" />
				<param name="digitalIn5_addr" />
				<param name="digitalIn6_addr" />
				<param name="digitalIn7_addr" />
				<param name="digitalOut0_addr" />
				<param name="digitalOut1_addr" />
				<param name="digitalOut2_addr" />
				<param name="digitalOut3_addr" />
				<param name="digitalOut4_addr" />
				<param name="digitalOut5_addr" />
				<param name="enabled"
				       value="True" />
				<param name="gpio0_addr" />
				<param name="gpio1_addr" />
				<param name="gpio2_addr" />
				<param name="gpio3_addr" />
				<param name="inputAddressBase"
				       value="0" />
				<param name="outputAddressBase"
				       value="0" />
				<param name="pollIntMs"
				       value="25" />
				<param name="pwm0_addr"
				       value="AW 42" />
				<param name="pwm1_addr"
				       value="AW 420" />
				<param name="pwm_baseFreqHz"
				       value="16000000" />
				<param name="pwm_period" />
				<param name="pwm_servoMode"
				       value="False" />
				<param name="relay0_addr" />
				<param name="relay1_addr" />
				<param name="relay2_addr" />
				<param name="relay3_addr" />
				<param name="rs485"
				       value="False" />
				<param name="testMode"
				       value="False" />
			</params>
		</module>
	</hardware>

	<!-- Graphical user interface configuration -->
	<gui>
		<editor autoindent="1"
		        paste_autoindent="1"
		        validation="1" />
	</gui>
</awlsim_project>
bues.ch cgit interface