123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334 |
- <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
- <!-- Awlsim project file generated by awlsim-0.66.0-pre -->
- <awlsim_project date_create="2016-03-16 00:00:00.000000"
- date_modify="2018-07-08 18:00:17.334763"
- 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="102"
- 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="source"
- type="0"><![CDATA[
- // Digital input (DI) / output (DO) tests.
- // PiXtend DIs are wired to EB 1
- // PiXtend DOs are wired to AB 1
- FUNCTION FC 1 : VOID
- BEGIN
- // Calculate the expected EB 1 from AB 1.
- // The fake PiXtend spidev module wires DI do DO in the following way:
- // EB1 := ((AB1 & 0x0F) | (((AB1 ^ 0x0F) & 0x0F) << 4))
- L AB 1
- UW W#16#0F
- L AB 1
- XOW W#16#0F
- UW W#16#0F
- SLW 4
- OW
- T MB 10
- // Compare the actual EB 1 to the expected EB 1 (MB 10)
- L EB 1
- L MB 10
- __ASSERT== __ACCU 1, __ACCU 2
- // Increment the EB 1 / AB 1 test pattern by one
- L AB 1
- + 1
- T AB 1
- END_FUNCTION
- // GPIO tests
- // PiXtend GPIO 0 is wired to E 2.0
- // PiXtend GPIO 1 is wired to A 2.0
- FUNCTION FC 2 : VOID
- BEGIN
- // Calculate the expected E 2.0 from A 2.0
- // The fake PiXtend spidev module wires GPIO 1 to GPIO 0
- L AB 2
- UW W#16#01
- T MB 20
- // Compare the actual EB 1 to the expected EB 1 (MB 20)
- L EB 2
- L MB 20
- __ASSERT== __ACCU 1, __ACCU 2
- // Increment the EB 2 / AB 2 test pattern by one
- L AB 2
- + 1
- T AB 2
- END_FUNCTION
- // Analog input tests
- FUNCTION FC 3 : VOID
- BEGIN
- // Check AI0
- // The fake PiXtend spidev module always reports 1 V
- L EW 10
- L 2754
- __ASSERT== __ACCU 1, __ACCU 2
- // Check AI1
- // The fake PiXtend spidev module always reports 2 V
- L EW 12
- L 5535
- __ASSERT== __ACCU 1, __ACCU 2
- END_FUNCTION
- // Analog output tests
- FUNCTION FC 4 : VOID
- BEGIN
- // Check DAC_A
- // The magic value is checked by the fake PiXtend-Spidev module
- L 27648
- T AW 10
-
- // Check DAC_B
- // The magic value is checked by the fake PiXtend-Spidev module
- L 2764
- T AW 12
- END_FUNCTION
- // PWM output tests
- FUNCTION FC 5 : VOID
- BEGIN
- // Set PWM0
- // The magic value is checked by the fake PiXtend-Spidev module
- L W#16#1234
- T AW 20
-
- // Set PWM1
- // The magic value is checked by the fake PiXtend-Spidev module
- L W#16#4321
- T AW 22
- END_FUNCTION
- ORGANIZATION_BLOCK OB 1
- BEGIN
- // This test only works with the fake PiXtend-Spidev module
-
- CALL FC 1 // Test DI/DO
- CALL FC 2 // Test GPIOs
- CALL FC 3 // Test analog inputs
- CALL FC 4 // Test analog outputs
- CALL FC 5 // Test PWMs
-
- // If we ran 50 test cycles then exit.
- L MW 100
- + 1
- T MW 100
- L 50
- <I
- BEB
- CALL SFC 46 // Exit test; Stop CPU.
- END_ORGANIZATION_BLOCK
- ORGANIZATION_BLOCK OB 100
- BEGIN
- L 0
- T AB 1
- T AB 2
- T MW 100
- CALL FC 4 // Init analog outputs
- CALL FC 5 // Init PWMs
- 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="IW 10" />
- <param name="analogIn0_nos"
- value="10" />
- <param name="analogIn1_10V"
- value="True" />
- <param name="analogIn1_addr"
- value="IW 12" />
- <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"
- value="AW 10" />
- <param name="analogOut1_addr"
- value="AW 12" />
- <param name="boardType"
- value="v2.x" />
- <param name="digitalIn0_addr"
- value="I 1.0" />
- <param name="digitalIn1_addr"
- value="I 1.1" />
- <param name="digitalIn2_addr"
- value="I 1.2" />
- <param name="digitalIn3_addr"
- value="I 1.3" />
- <param name="digitalIn4_addr"
- value="I 1.4" />
- <param name="digitalIn5_addr"
- value="I 1.5" />
- <param name="digitalIn6_addr"
- value="I 1.6" />
- <param name="digitalIn7_addr"
- value="I 1.7" />
- <param name="digitalOut0_addr"
- value="Q1.0" />
- <param name="digitalOut1_addr"
- value="Q1.1" />
- <param name="digitalOut2_addr"
- value="Q1.2" />
- <param name="digitalOut3_addr"
- value="Q1.3" />
- <param name="digitalOut4_addr" />
- <param name="digitalOut5_addr" />
- <param name="enabled"
- value="True" />
- <param name="gpio0_addr"
- value="I 2.0" />
- <param name="gpio0_hum_addr" />
- <param name="gpio0_mode"
- value="GPIO" />
- <param name="gpio0_pullup"
- value="False" />
- <param name="gpio0_temp_addr" />
- <param name="gpio1_addr"
- value="Q 2.0" />
- <param name="gpio1_hum_addr" />
- <param name="gpio1_mode"
- value="GPIO" />
- <param name="gpio1_pullup"
- value="False" />
- <param name="gpio1_temp_addr" />
- <param name="gpio2_addr" />
- <param name="gpio2_hum_addr" />
- <param name="gpio2_mode"
- value="GPIO" />
- <param name="gpio2_pullup"
- value="False" />
- <param name="gpio2_temp_addr" />
- <param name="gpio3_addr" />
- <param name="gpio3_hum_addr" />
- <param name="gpio3_mode"
- value="GPIO" />
- <param name="gpio3_pullup"
- value="False" />
- <param name="gpio3_temp_addr" />
- <param name="inputAddressBase"
- value="0" />
- <param name="outputAddressBase"
- value="0" />
- <param name="pollIntMs"
- value="2.5" />
- <param name="pwm0A_addr"
- value="AW 20" />
- <param name="pwm0B_addr"
- value="AW 22" />
- <param name="pwm0_baseFreqHz"
- value="16000000" />
- <param name="pwm0_mode"
- value="dutycycle" />
- <param name="pwm0_period"
- value="65000" />
- <param name="pwm1A_addr" />
- <param name="pwm1B_addr" />
- <param name="pwm1_baseFreqHz"
- value="0" />
- <param name="pwm1_mode"
- value="dutycycle" />
- <param name="pwm1_period" />
- <param name="relay0_addr"
- value="Q 0.0" />
- <param name="relay1_addr"
- value="Q 0.1" />
- <param name="relay2_addr"
- value="Q 0.2" />
- <param name="relay3_addr"
- value="Q 0.3" />
- <param name="rs485"
- value="False" />
- <param name="testMode"
- value="True" />
- </params>
- </module>
- </hardware>
- <!-- Graphical user interface configuration -->
- <gui>
- <editor autoindent="1"
- paste_autoindent="1"
- validation="1" />
- </gui>
- </awlsim_project>
|