www.ChristianApelt.de
optimiert für Firefox
letzte Aktualisierung: 10.2016


I/O-Modul Compiler / Befehlssatz




#define [Name] [Variable]


Mit dem Befehl "#define" können den Funktionsparametern Namen zugewiesen werden.

Beispiele:
#define Bit_FlipFlop1X$10X$10= Wert in hexadezimaler Schreibweise
#define Byte_MaxWertB11B11= Wert in dezimaler Schreibweise
#define Ausgang2O2
#define Eingang1I1
#define DebugInput1D1
#define Merker3M3

Um den so erstellten Namen in einer Funktion benutzen zu können, muss direkt davor ein Stern "*" eingegeben werden.

Beispiele:
OUTPUT ( *Bit_FlipFlop1, *Ausgang2)



OUTPUT ( [Bit Variable], [Ausgangs] )


Mit dem Befehl "OUTPUT"


Beispiele:



MERKER ( [Bit Variable], [Merker] )


Mit dem Befehl "MERKER"


Beispiele:



INIT1 ( [Bit Konstante], [Bit Variable] )


Mit dem Befehl "INIT1"


Beispiele:



INIT8 ( [Byte Konstante], [Byte Variable] )


Mit dem Befehl "INIT8"


Beispiele:



INIT24 ( [3Byte Konstante], *[3Byte Adr.] )


Mit dem Befehl "INIT24"


Beispiele:



AND1 ( [Bit Variable I1], [Bit Variable I2], [Bit Variable O1] )


Mit dem Befehl "AND1"


Wahrheitstabelle:

I1I2O1
0 0 0
0 1 0
1 0 0
1 1 1



OR1 ( [Bit Variable I1], [Bit Variable I2], [Bit Variable O1] )


Mit dem Befehl "OR1"


Wahrheitstabelle:

I1I2O1
0 0 0
0 1 1
1 0 1
1 1 1



NOT1 ( [Bit Variable I1], [Bit Variable O1] )


Mit dem Befehl "NOT1"


Wahrheitstabelle:

I1O1
0 1
1 0



XOR1 ( [Bit Variable I1], [Bit Variable I2], [Bit Variable O1] )


Mit dem Befehl "XOR1"


Wahrheitstabelle:

I1I2O1
0 0 0
0 1 1
1 0 1
1 1 0



NAND1 ( [Bit Variable I1], [Bit Variable I2], [Bit Variable O1] )


Mit dem Befehl "NAND1"


Wahrheitstabelle:

I1I2O1
0 0 1
0 1 1
1 0 1
1 1 0



NOR1 ( [Bit Variable I1], [Bit Variable I2], [Bit Variable O1] )


Mit dem Befehl "NOR1"


Wahrheitstabelle:

I1I2O1
0 0 1
0 1 0
1 0 0
1 1 0



AND8 ( [Byte Variable I1], [Byte Variable I2], [Byte Variable O1] )


Mit dem Befehl "AND8"


Wahrheitstabelle:

I1I2O1
0 0 0
0 1 0
1 0 0
1 1 1



OR8 ( [Byte Variable I1], [Byte Variable I2], [Byte Variable O1] )


Mit dem Befehl "OR8"


Wahrheitstabelle:

I1I2O1
0 0 0
0 1 1
1 0 1
1 1 1



NOT8 ( [Byte Variable I1], [Byte Variable O1] )


Mit dem Befehl "NOT8"


Wahrheitstabelle:

I1O1
0 1
1 0



XOR8 ( [Byte Variable I1], [Byte Variable I2], [Byte Variable O1] )


Mit dem Befehl "XOR8"


Wahrheitstabelle:

I1I2O1
0 0 0
0 1 1
1 0 1
1 1 0



NAND8 ( [Byte Variable I1], [Byte Variable I2], [Byte Variable O1] )


Mit dem Befehl "NAND8"


Wahrheitstabelle:

I1I2O1
0 0 1
0 1 1
1 0 1
1 1 0



NOR8 ( [Byte Variable I1], [Byte Variable I2], [Byte Variable O1] )


Mit dem Befehl "NOR8"


Wahrheitstabelle:

I1I2O1
0 0 1
0 1 0
1 0 0
1 1 0



COUNTER24 ( [Bit Variable Reset], [Bit Variable Enable], *[3Byte Adr. Zähler], [Bit Variable Überlauf] )


Mit dem Befehl "COUNTER24"


Beispiele:



CMP_K_8 ( [Byte Variable I1], [Byte Variable I2], [Bit Variable O1] )


Mit dem Befehl "CMP_K_8"


Beispiele:



CMP_E_8 ( [Byte Variable I1], [Byte Variable I2], [Bit Variable O1] )


Mit dem Befehl "CMP_E_8"


Beispiele:



CMP_G_8 ( [Byte Variable I1], [Byte Variable I2], [Bit Variable O1] )


Mit dem Befehl "CMP_G_8"


Beispiele:



CMP_K_24 ( *[3Byte Adr. I1], [3Byte Adr. I2], [Bit Variable O1] )


Mit dem Befehl "CMP_K_24"


Beispiele:



CMP_E_24 ( *[3Byte Adr. I1], [3Byte Adr. I2], [Bit Variable O1] )


Mit dem Befehl "CMP_E_24"


Beispiele:



CMP_G_24 ( *[3Byte Adr. I1], [3Byte Adr. I2], [Bit Variable O1] )


Mit dem Befehl "CMP_G_24"


Beispiele:



TON_24 ( [Bit Variable Enable], *[3Byte Adr. Zeitkonstante], *[3Byte Adr. intZähler], [Bit Variable O1] )


Mit dem Befehl "TON_24"


Beispiele:



TOFF_24 ( [Bit Variable Enable], *[3Byte Adr. Zeitkonstante], *[3Byte Adr. intZähler], [Bit Variable O1] )


Mit dem Befehl "TOFF_24"


Beispiele:



TPULS_24 ( [Bit Variable Enable], *[3Byte Adr. Zeitkonstante], *[3Byte Adr. intern], [Bit Variable O1] )


Mit dem Befehl " TPULS_24"


Beispiele:



IMP_NF ( [Bit Variable I1], [Bit Variable intern], [Bit Variable O1] )


Mit dem Befehl "IMP_NF"


Beispiele:



IMP_PF ( [Bit Variable I1], [Bit Variable intern], [Bit Variable O1] )


Mit dem Befehl "IMP_PF"


Beispiele:



ADD_8 ( [Byte Variable I1], [Byte Variable I2], [Byte Variable O1] )


Mit dem Befehl "ADD_8"


Beispiele:
O1 = I1 + I2



SUB_8 ( [Byte Variable I1], [Byte Variable I2], [Byte Variable O1] )


Mit dem Befehl "SUB_8"


Beispiele:
O1 = I1 - I2



MUL_8 ( [Byte Variable I1], [Byte Variable I2], [Byte Variable O1] )


Mit dem Befehl "MUL_8" wird eine multiplikation der Bytes I1 und I2 durchgefüht das Ergebnis O1 ist 8Bit groß. Ein Ergebnis das größer als 8Bit ist wird abgeschnitten.


Beispiele:
O1 = I1 * I2



DIV_8 ( [Byte Variable I1], [Byte Variable I2], [Byte Variable O1] )


Mit dem Befehl "DIV_8"


Beispiele:
O1 = I1 / I2



MOD_8 ( [Byte Variable I1], [Byte Variable I2], [Byte Variable O1] )


Mit dem Befehl "MOD_8"


Beispiele:
O1 = I1 % I2
O1 = I1 mod I2



ADD_C ( [Byte Variable I1], [Byte Variable I2], [Bit Variable CarryIn], [Byte Variable O1], [Bit Variable CarryOut] )


Mit dem Befehl "ADD_C"


Beispiele:
O1 / CarryOut = I1 + I2 + CarryIn



SUB_C ( [Byte Variable I1], [Byte Variable I2], [Bit Variable CarryIn], [Byte Variable O1], [Bit Variable CarryOut] )


Mit dem Befehl "SUB_C"


Beispiele:
O1 / CarryOut = I1 - I2 - CarryIn



MUL_16 ( [Byte Variable I1], [Byte Variable I2], [2Byte Adr. O1] )


Mit dem Befehl "MUL_16" wird eine multiplikation der Bytes I1 und I2 durchgefüht das Ergebnis O1 ist 16Bit groß.

Beispiele:
O1 = I1 * I2



INC_8 ( [Byte Variable IO1] )


Mit dem Befehl "INC_8" wird der Wert von IO1 um eins inkrementiert

Beispiele:
IO1 = IO1 + 1



DEC_8 ( [Byte Variable IO1] )


Mit dem Befehl "DEC_8" wird der Wert von IO1 um eins dekrementiert

Beispiele:
IO1 = IO1 - 1



RS_FF ( [Bit Variable SET], [Bit Variable RESET], [Bit Variable O1] )


Mit dem Befehl "RS_FF" wird die Funktion eines RS-FlipFlops nachgebildet.

Wahrheitstabelle:

RESETSETO1
0 0 O1   keine Änderung
0 1 1
1 0 0
1 1 1   Set hat Vorrang vor Reset



UM_8 ( [Bit Variable SEL], [Byte Variable I1], [Byte Variable I2], [Byte Variable O1] )


Mit dem Befehl "UM_8" (Umschalter) kann O1 abhängig von SEL der Wert von I1 oder I2 zugewiesen werden.

Wahrheitstabelle:

SELO1
0 I1
1 I2



TASK_ZEIT ( [Byte Variable I1] )


Mit dem Befehl "TASK_ZEIT" wird die Zeit des Intervalls festgelegt in der das Programm ausgeführt wird.

Eine Ausnahme gibt es, wenn I1 = 0 ist. Dann ist die Taskzeit abhängig von der größe des Programms und dessen Ausführungszeit. Diese Einstellung ergibt zwar die schnellste Ausführungsgeschwindigkeit, hat aber keine konstante Taskzeit. Das führt bei Funktionen die eine feste Zeitbasis benötigen wie z.B. "TON_24 " zu einer fehlerhaften Funktion.

Die Taskzeit berechnet sich aus I1 * 10ms

Beispiel:
I1 = 5 daraus ergibt sich eine Taskzeit von 50ms



INIT_END


Mit dem Befehl "INIT_END" wird das Ende der Initialisierung gekennzeichnet.

Alle Befehle bis hierher werden nur ein einziges mal ausgeführt. Der nächste Befehl ist der erste Befehl der im Zyklischen Betrieb ausgeführt wird.




END


Mit dem Befehl "END" wird das Ende des Programms gekennzeichnet.

Alle Befehle die nach diesem stehen werden nicht mehr ausgeführt.