3878 lines
206 KiB
C++
3878 lines
206 KiB
C++
|
// generated by txt2c.pl from
|
|||
|
#include <stdlib.h>
|
|||
|
#ifdef LDLANG_DE
|
|||
|
char *HelpTextDe[] = {
|
|||
|
"",
|
|||
|
"EINF<EFBFBD>HRUNG",
|
|||
|
"===========",
|
|||
|
"",
|
|||
|
"LDmicro erzeugt einen systemspezifischen Code f<>r einige Microchip PIC16",
|
|||
|
"und Atmel AVR Mikroprozessoren. <20>blicherweise wird die Software f<>r diese",
|
|||
|
"Prozessoren in Programmsprachen, wie Assembler, C oder BASIC geschrieben.",
|
|||
|
"Ein Programm, welches in einer dieser Sprachen abgefasst ist, enth<74>lt",
|
|||
|
"eine Anweisungsliste. Auch sind die diese Sprachen sehr leistungsf<73>hig",
|
|||
|
"und besonders gut geeignet f<>r die Architektur dieser Prozessoren,",
|
|||
|
"welche diese Anweisungsliste intern abarbeiten.",
|
|||
|
"",
|
|||
|
"Programme f<>r speicherprogrammierbare Steuerungen (SPS) andererseits,",
|
|||
|
"werden oftmals im Kontaktplan (KOP = ladder logic) geschrieben.",
|
|||
|
"Ein einfaches Programm, k<>nnte wie folgt aussehen:",
|
|||
|
"",
|
|||
|
" || ||",
|
|||
|
" || Xbutton1 Tdon Rchatter Yred ||",
|
|||
|
" 1 ||-------]/[---------[TON 1.000 s]-+-------]/[--------------( )-------||",
|
|||
|
" || | ||",
|
|||
|
" || Xbutton2 Tdof | ||",
|
|||
|
" ||-------]/[---------[TOF 2.000 s]-+ ||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || Rchatter Ton Tneu Rchatter ||",
|
|||
|
" 2 ||-------]/[---------[TON 1.000 s]----[TOF 1.000 s]---------( )-------||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" ||------[END]---------------------------------------------------------||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
"",
|
|||
|
" (TON ist eine Anzugsverz<72>gerung, TOF eine Abfallverz<72>gerung.",
|
|||
|
" Die --] [-- Anweisungen bedeuten Eing<6E>nge, die sich <20>hnlich, wie Relais-",
|
|||
|
" kontakte verhalten. Die --( )-- Anweisungen bedeuten Ausg<73>nge, die sich",
|
|||
|
" <20>hnlich, wie Relaisspulen verhalten. Viele gute Bezugsquellen werden f<>r",
|
|||
|
" KOP im Internet oder sonst wo angeboten; Einzelheiten zu dieser speziellen",
|
|||
|
" Ausf<73>hrung werden weiter unten angegeben.)",
|
|||
|
"",
|
|||
|
"Einige Unterschiede sind jedoch offensichtlich:",
|
|||
|
"",
|
|||
|
"* Das Programm wird in einem grafischen Format dargestellt",
|
|||
|
" und nicht mit einer aus Anweisungen bestehenden Textliste. Viele",
|
|||
|
" Anwender werden dies zun<75>chst als besser verst<73>ndlich auffassen.",
|
|||
|
"",
|
|||
|
"* Diese Programme erscheinen wie einfachste Schaltpl<70>ne, mit",
|
|||
|
" Relaiskontakten (Eing<6E>ngen) and Spulen (Ausg<73>ngen). Dies ist recht",
|
|||
|
" intuitiv f<>r Programmierer, die <20>ber Kenntnisse der Theorie von",
|
|||
|
" Elektroschaltpl<70>nen verf<72>gen.",
|
|||
|
"",
|
|||
|
"* Der <20>ladder logic compiler<65> <20>bernimmt was wo berechnet wird.",
|
|||
|
" Es ist nicht notwendig einen Code zu schreiben, um zu errechnen, wann",
|
|||
|
" der Status (Zustand) der Ausg<73>nge neu bestimmt werden muss, z.B. auf",
|
|||
|
" Grund einer <20>nderung eines Eingangs oder Timers. Auch braucht man die",
|
|||
|
" Reihenfolge der Berechnungen nicht anzugeben; die SPS-Hilfsprogramme",
|
|||
|
" <20>bernehmen dies.",
|
|||
|
"",
|
|||
|
"LDmicro kompiliert <20>ladder logic<69> (KOP) in PIC16- oder AVR-Code.",
|
|||
|
"Die folgenden Prozessoren werden unterst<73>tzt:",
|
|||
|
"",
|
|||
|
" * PIC16F877",
|
|||
|
" * PIC16F628",
|
|||
|
" * PIC16F876 (ungetestet)",
|
|||
|
" * PIC16F88 (ungetestet)",
|
|||
|
" * PIC16F819 (ungetestet)",
|
|||
|
" * PIC16F887 (ungetestet)",
|
|||
|
" * PIC16F886 (ungetestet)",
|
|||
|
" * ATmega8 (ungetestet)",
|
|||
|
" * ATmega16 (ungetestet)",
|
|||
|
" * ATmega32 (ungetestet)",
|
|||
|
" * ATmega128",
|
|||
|
" * ATmega64",
|
|||
|
" * ATmega162 (ungetestet)",
|
|||
|
"",
|
|||
|
"Es w<>re einfach noch weitere AVR- oder PIC16-Prozessoren zu unterst<73>tzen,",
|
|||
|
"aber ich habe keine M<>glichkeit diese zu testen. Falls Sie einen",
|
|||
|
"bestimmten ben<65>tigen, so nehmen Sie Kontakt mit mir auf und ich werde",
|
|||
|
"sehen, was ich tun kann.",
|
|||
|
"",
|
|||
|
"Mit LDmicro k<>nnen Sie ein Kontaktplan-Programm zeichnen bzw. entwickeln.",
|
|||
|
"Auch k<>nnen Sie dies in Realzeit mit Ihrem Computer simulieren. Wenn",
|
|||
|
"Sie dann <20>berzeugt sind, dass Ihr Programm korrekt ist, so k<>nnen",
|
|||
|
"Sie die Pins, entsprechend dem Programm als Ein- oder Ausg<73>nge, dem",
|
|||
|
"Mikroprozessor zuweisen. Nach der Zuweisung der Pins k<>nnen Sie den PIC-",
|
|||
|
"oder AVR-Code f<>r Ihr Programm kompilieren. Der Compiler erzeugt eine",
|
|||
|
"Hex-Datei, mit dem Sie dann Ihren Mikroprozessor programmieren. Dies",
|
|||
|
"ist mit jedem PIC/AVR-Programmer m<>glich.",
|
|||
|
"",
|
|||
|
"LDmicro wurde entworfen, um in etwa mit den meisten kommerziellen",
|
|||
|
"SPS-Systemen <20>hnlich zu sein. Es gibt einige Ausnahmen und viele Dinge",
|
|||
|
"sind ohnehin kein Standard in der Industrie. Lesen Sie aufmerksam die",
|
|||
|
"Beschreibung jeder Anweisung, auch wenn Ihnen diese vertraut erscheint.",
|
|||
|
"Dieses Dokument setzt ein Grundwissen an Kontaktplan-Programmierung",
|
|||
|
"und der Struktur von SPS-Software voraus (wie: der Ausf<73>hrungszyklus,",
|
|||
|
"Eing<EFBFBD>nge lesen, rechnen und Ausg<73>nge setzen).",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"WEITERE ZIELE",
|
|||
|
"=============",
|
|||
|
"",
|
|||
|
"Es ist auch m<>glich einen ANSI C - Code zu erzeugen. Diesen k<>nnen",
|
|||
|
"Sie dann f<>r jeden Prozessor verwenden, f<>r den Sie einen C-Compiler",
|
|||
|
"besitzen. Sie sind dann aber selbst verantwortlich, den Ablauf zu",
|
|||
|
"bestimmen. Das hei<65>t, LDmicro erzeugt nur ein Stammprogramm f<>r einen",
|
|||
|
"Funktions- SPS-Zyklus. Sie m<>ssen den SPS-Zyklus bei jedem Durchlauf",
|
|||
|
"aufrufen und auch die Ausf<73>hrung (Implementierung) der E/A-Funktionen,",
|
|||
|
"die der SPS-Zyklus abruft (wie: lesen/schreiben, digitaler Eingang usw.).",
|
|||
|
"F<EFBFBD>r mehr Einzelheiten: Siehe die Kommentare in dem erzeugten Quellcode.",
|
|||
|
"",
|
|||
|
"Ganz zuletzt kann LDmicro auch f<>r eine virtuelle Maschine einen",
|
|||
|
"prozessor-unabh<62>ngigen Byte-Code erzeugen, welche mit der KOP-Kodierung",
|
|||
|
"(ladder logic) laufen soll. Ich habe eine Beispiel-Anwendung des",
|
|||
|
"VM/Interpreters vorgesehen, in ziemlich gutem C geschrieben. Dieses",
|
|||
|
"Anwendungsziel wird halbwegs auf jeder Plattform funktionieren, so lange",
|
|||
|
"Sie Ihre eigene VM vorsehen. Dies k<>nnte f<>r solche Anwendungen n<>tzlich",
|
|||
|
"sein, f<>r die Sie KOP (ladder logic) als Datentransfer-Sprache verwenden",
|
|||
|
"m<EFBFBD>chten, um ein gr<67><72>eres Programm anzupassen. F<>r weitere Einzelheiten:",
|
|||
|
"Siehe die Kommentare in dem Beispiel-Interpreter.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"OPTIONEN DER BEFEHLSZEILEN ",
|
|||
|
"==========================",
|
|||
|
"",
|
|||
|
"ldmicro.exe l<>uft normalerweise ohne eine Befehlszeilen-Option.",
|
|||
|
"Das hei<65>t, dass Sie nur ein Tastenk<6E>rzel zu dem Programm ben<65>tigen",
|
|||
|
"oder es auf dem Desktop abspeichern und dann auf das Symbol (die Ikone)",
|
|||
|
"doppelklicken, um es laufen zu lassen. Danach k<>nnen Sie alles ausf<73>hren,",
|
|||
|
"was das GUI (Graphical User Interface) zul<75>sst.",
|
|||
|
"",
|
|||
|
"Wenn man an LDmicro einen alleinstehenden Dateinamen in der Befehlszeile",
|
|||
|
"vergeben hat (z. B. <20>ldmicro.exe asd.ld<6C>), wird LDmicro versuchen <20>asd.ld<6C>",
|
|||
|
"zu <20>ffnen, falls diese existiert. Dies bedeutet, dass man ldmicro.exe",
|
|||
|
"mit .ld Dateien verbinden kann, sodass dies automatisch abl<62>uft, wenn",
|
|||
|
"man auf eine .ld Datei doppelklickt.",
|
|||
|
"",
|
|||
|
"Wenn man an LDmicro das Argument in der Befehlszeile in folgender Form",
|
|||
|
"vergeben hat: <20>ldmicro.exe /c src.ld dest.hex<65>, so wird es versuchen",
|
|||
|
"<EFBFBD>src.ld<6C> zu kompilieren und unter <20>dest.hex<65> abzuspeichern. LDmicro endet",
|
|||
|
"nach dem Kompilieren, unabh<62>ngig davon, ob die Kompilierung erfolgreich",
|
|||
|
"war oder nicht. Alle Meldungen werden auf der Konsole ausgegeben. Dieser",
|
|||
|
"Modus ist hilfreich, wenn man LDmicro von der Befehlszeile laufen",
|
|||
|
"aus l<>sst.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"GRUNDLAGEN",
|
|||
|
"==========",
|
|||
|
"",
|
|||
|
"Wenn Sie LDmicro ohne Argumente aufrufen, so beginnt es als ein leeres",
|
|||
|
"Programm. Wenn Sie LDmicro mit dem Namen eines <20>ladder<65> (KOP)-Programms",
|
|||
|
"(z.B. xxx.ld) in der Befehlszeile <20>ffnen, dann wird es versuchen dieses",
|
|||
|
"Programm am Anfang zu laden.",
|
|||
|
"",
|
|||
|
"LDmicro verwendet sein eigenes internes Format f<>r das Programm und",
|
|||
|
"man kann kein logisches Zeichen aus einem anderen (Fremd-)Programm",
|
|||
|
"importieren.",
|
|||
|
"",
|
|||
|
"Falls Sie nicht ein schon vorhandenes Programm laden, dann wird Ihnen",
|
|||
|
"ein Programm mit einem leeren Netzwerk geliefert. In dieses k<>nnen Sie",
|
|||
|
"einen Befehl einf<6E>gen; z. B. k<>nnten Sie auch eine Reihe von Kontakten",
|
|||
|
"einf<EFBFBD>gen (Anweisung -> Kontakte Einf<6E>gen), die zun<75>chst mit <20>Xneu<65>",
|
|||
|
"bezeichnet werden. <20>X<EFBFBD> bedeutet, dass der Kontakt auf einen Eingang",
|
|||
|
"des Mikroprozessors festgelegt ist. Diesen Pin k<>nnen Sie sp<73>ter zuweisen,",
|
|||
|
"nachdem Sie den Mikroprozessor gew<65>hlt haben und die Kontakte",
|
|||
|
"umbenannt haben. Der erste Buchstabe zeigt an, um welche Art Objekt es",
|
|||
|
"sich handelt. Zum Beispiel:",
|
|||
|
"",
|
|||
|
" * XName -- Auf einen Eingang des Mikroprozessors festgelegt",
|
|||
|
" * YName -- Auf einen Ausgang des Mikroprozessors festgelegt",
|
|||
|
" * RName -- Merker: Ein Bit im Speicher (Internes Relais)",
|
|||
|
" * TName -- Ein Timer; Anzugs- oder Abfallverz<72>gerung",
|
|||
|
" * CName -- Ein Z<>hler, Aufw<66>rts- oder Abw<62>rtsz<73>hler",
|
|||
|
" * AName -- Eine Ganzzahl, von einem A/D-Wandler eingelesen",
|
|||
|
" * Name -- Eine Allzweck-Variable als Ganzzahl",
|
|||
|
"",
|
|||
|
"W<EFBFBD>hlen Sie den Rest des Namens, sodass dieser beschreibt, was das Objekt",
|
|||
|
"bewirkt und das dieser auch einmalig im Programm ist. Der gleiche Name",
|
|||
|
"bezieht sich immer auf das gleiche Objekt im Programm. Es w<>re zum",
|
|||
|
"Beispiel falsch eine Anzugsverz<72>gerung (TON) <20>TVerz<72>g<EFBFBD> zu nennen und im",
|
|||
|
"selben Programm eine Abfallverz<72>gerung <20>TVerz<72>g<EFBFBD> (TOF), weil jeder Z<>hler",
|
|||
|
"(oder Timer) seinen eigenen Speicher ben<65>tigt. Andererseits w<>re es",
|
|||
|
"korrekt einen <20>Speichernden Timer<65> (RTO) <20>TVerz<72>g<EFBFBD> zu nennen und eine",
|
|||
|
"entsprechende R<>cksetz-Anweisung (RES) = <20>TVerz<72>g<EFBFBD>, weil in diesem",
|
|||
|
"Fall beide Befehle dem gleichen Timer gelten.",
|
|||
|
"",
|
|||
|
"Die Namen von Variablen k<>nnen aus Buchstaben, Zahlen und Unter-",
|
|||
|
"strichen (_) bestehen. Der Name einer Variablen darf nicht mit einer",
|
|||
|
"Nummer beginnen. Die Namen von Variablen sind fallabh<62>ngig.",
|
|||
|
"",
|
|||
|
"Ein Befehl f<>r eine gew<65>hnliche Variable (MOV, ADD, EQU, usw.), kann",
|
|||
|
"mit Variablen mit jedem Namen arbeiten. Das bedeutet, dass diese Zugang",
|
|||
|
"zu den Timer- und Z<>hler-Akkumulatoren haben. Das kann manchmal recht",
|
|||
|
"hilfreich sein; zum Beispiel kann man damit pr<70>fen, ob die Z<>hlung eines",
|
|||
|
"Timers in einem bestimmten Bereich liegt.",
|
|||
|
"",
|
|||
|
"Die Variablen sind immer 16-Bit Ganzzahlen. Das hei<65>t sie k<>nnen von",
|
|||
|
"-32768 bis 32767 reichen. Die Variablen werden immer als vorzeichen-",
|
|||
|
"behaftet behandelt. Sie k<>nnen auch Buchstaben als Dezimalzahlen festlegen",
|
|||
|
"(0, 1234, -56). Auch k<>nnen Sie ASCII-Zeichenwerte (<28>A<EFBFBD>, <20>z<EFBFBD>) festlegen,",
|
|||
|
"indem Sie die Zeichen in <20>Auslassungszeichen<65> einf<6E>gen. Sie k<>nnen",
|
|||
|
"ein ASCII-Zeichen an den meisten Stellen verwenden, an denen Sie eine",
|
|||
|
"Dezimalzahl verwenden k<>nnen.",
|
|||
|
"",
|
|||
|
"Am unteren Ende der Maske (Bildanzeige) sehen Sie eine Liste aller",
|
|||
|
"Objekte (Anweisungen, Befehle) des Programms. Diese Liste wird vom",
|
|||
|
"Programm automatisch erzeugt; es besteht somit keine Notwendigkeit diese",
|
|||
|
"von Hand auf dem Laufenden zu halten. Die meisten Objekte ben<65>tigen",
|
|||
|
"keine Konfiguration. <20>XName<6D>, <20>YName<6D>, und <20>AName<6D> Objekte allerdings,",
|
|||
|
"m<EFBFBD>ssen einem Pin des Mikroprozessors zugeordnet werden. W<>hlen Sie zuerst",
|
|||
|
"welcher Prozessor verwendet wird (Voreinstellungen -> Prozessor). Danach",
|
|||
|
"legen Sie Ihre E/A Pins fest, indem Sie in der Liste auf diese jeweils",
|
|||
|
"doppelklicken.",
|
|||
|
"",
|
|||
|
"Sie k<>nnen das Programm ver<65>ndern, indem Sie Anweisungen (Befehle)",
|
|||
|
"einf<EFBFBD>gen oder l<>schen. Die Schreibmarke (cursor)im Programm blinkt,",
|
|||
|
"um die momentan gew<65>hlte Anweisung und den Einf<6E>gungspunkt anzuzeigen.",
|
|||
|
"Falls diese nicht blinkt, so dr<64>cken Sie den <Tabulator> oder klicken",
|
|||
|
"Sie auf eine Anweisung. Jetzt k<>nnen Sie die momentane Anweisung l<>schen",
|
|||
|
"oder eine neue Anweisung einf<6E>gen; links oder rechts (in Reihenschaltung)",
|
|||
|
"oder <20>ber oder unter (in Parallelschaltung) mit der gew<65>hlten Anweisung.",
|
|||
|
"Einige Handhabungen sind nicht erlaubt, so zum Beispiel weitere",
|
|||
|
"Anweisungen rechts von einer Spule.",
|
|||
|
"",
|
|||
|
"Das Programm beginnt mit nur einem Netzwerk. Sie k<>nnen mehr Netzwerke",
|
|||
|
"hinzuf<EFBFBD>gen, indem Sie <20>Netzwerk Einf<6E>gen Davor/Danach<63> im Programm-Men<65>",
|
|||
|
"w<EFBFBD>hlen. Den gleichen Effekt k<>nnten Sie erzielen, indem Sie viele",
|
|||
|
"komplizierte parallele Unterschaltungen in einem einzigen Netzwerk",
|
|||
|
"unterbringen. Es ist aber <20>bersichtlicher, mehrere Netzwerke zu verwenden.",
|
|||
|
"",
|
|||
|
"Wenn Sie Ihr Programm fertig geschrieben haben, so k<>nnen Sie dieses",
|
|||
|
"mit der Simulation testen. Danach k<>nnen Sie es in eine Hex-Datei f<>r",
|
|||
|
"den zugedachten Mikroprozessor kompilieren.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"SIMULATION",
|
|||
|
"==========",
|
|||
|
"",
|
|||
|
"Um den Simulationsbetrieb einzugeben, w<>hlen Sie <20>Simulieren ->",
|
|||
|
"Simulationsbetrieb<EFBFBD> oder dr<64>cken Sie <Strg+M>. Das Programm wird",
|
|||
|
"im Simulationsbetrieb unterschiedlich dargestellt. Es gibt keine",
|
|||
|
"Schreibmarke (cursor) mehr. Die <20>erregten<65> Anweisungen erscheinen hellrot,",
|
|||
|
"die <20>nicht erregten<65> erscheinen grau. Dr<44>cken Sie die Leertaste, um das",
|
|||
|
"SPS-Programm nur einen einzelnen Zyklus durchlaufen zu lassen. W<>hlen",
|
|||
|
"Sie f<>r einen kontinuierlichen Umlauf in Echtzeit <20>Simulieren -> Start",
|
|||
|
"Echtzeit-Simulation<6F> oder dr<64>cken Sie <Strg+R>. Die Maske (Bildanzeige)",
|
|||
|
"des Programms wird jetzt in Echtzeit, entsprechend der <20>nderungen des",
|
|||
|
"Status (des Zustands) des Programms aktualisiert.",
|
|||
|
"",
|
|||
|
"Sie k<>nnen den Status (Zustand) eines Eingangs im Programm einstellen,",
|
|||
|
"indem Sie auf den jeweiligen auf der Liste am unteren Ende der",
|
|||
|
"Maske (Bildanzeige) doppelklicken oder auf die jeweilige <20>XName<6D>",
|
|||
|
"Kontakt-Anweisung im Programm. Wenn Sie den Status (Zustand) eines",
|
|||
|
"Eingangs-Pins <20>ndern, so wird diese <20>nderung nicht unmittelbar in",
|
|||
|
"der Maske (Bildanzeige) wiedergegeben, sondern erst wenn sich die",
|
|||
|
"SPS im zyklischen Umlauf befindet. Das geschieht automatisch wenn das",
|
|||
|
"SPS-Programm in Echtzeit-Simulation l<>uft, oder wenn Sie die Leertaste",
|
|||
|
"dr<EFBFBD>cken.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"KOMPILIEREN ZUM SYSTEMSPEZIFISCHEN CODE",
|
|||
|
"=======================================",
|
|||
|
"",
|
|||
|
"Letztlich ist es dann nur sinnvoll eine .hex Datei zu erzeugen, mit",
|
|||
|
"der Sie Ihren Mikroprozessor programmieren k<>nnen. Zun<75>chst m<>ssen",
|
|||
|
"Sie die Teilenummer des Mikroprozessors im Men<65> <20>Voreinstellungen ->",
|
|||
|
"Prozessor<EFBFBD> w<>hlen. Danach m<>ssen jedem <20>XName<6D> oder <20>YName<6D> Objekt",
|
|||
|
"einen E/A-Pin zuweisen. Tun Sie dies, indem auf den Namen des Objekts",
|
|||
|
"doppelklicken, welcher sich in der Liste ganz unten in der Maske",
|
|||
|
"(Bildanzeige) befindet. Ein Dialogfenster wird dann erscheinen und Sie",
|
|||
|
"k<EFBFBD>nnen daraufhin einen noch nicht vergebenen Pin von der Liste aussuchen.",
|
|||
|
"",
|
|||
|
"Als n<>chstes m<>ssen Sie die Zykluszeit w<>hlen, mit der Sie das",
|
|||
|
"Programm laufen lassen wollen, auch m<>ssen Sie dem Compiler mitteilen",
|
|||
|
"mit welcher Taktgeschwindigkeit der Prozessor arbeiten soll. Diese",
|
|||
|
"Einstellungen werden im Men<65> <20>Voreinstellungen -> Prozessor Parameter...<2E>",
|
|||
|
"vorgenommen. <20>blicherweise sollten Sie die Zykluszeit nicht <20>ndern,",
|
|||
|
"denn diese ist auf 10ms voreingestellt, dies ist ein guter Wert f<>r",
|
|||
|
"die meisten Anwendungen. Tippen Sie die Frequenz des Quarzes (oder des",
|
|||
|
"Keramik-Resonators) ein, mit der Sie den Prozessor betreiben wollen und",
|
|||
|
"klicken auf Okay.",
|
|||
|
"",
|
|||
|
"Jetzt k<>nnen Sie einen Code von Ihrem Programm erzeugen. W<>hlen Sie",
|
|||
|
"<EFBFBD>Kompilieren -> Kompilieren<65> oder <20>Kompilieren -> Kompilieren unter...<2E>,",
|
|||
|
"falls Sie vorher Ihr Programm schon kompiliert haben und einen neuen Namen",
|
|||
|
"f<EFBFBD>r die Ausgangsdatei vergeben wollen. Wenn Ihr Programm fehlerfrei ist,",
|
|||
|
"wird LDmicro eine Intel IHEX Datei erzeugen, mit der sich Ihr Prozessor",
|
|||
|
"programmieren l<>sst.",
|
|||
|
"",
|
|||
|
"Verwenden Sie hierzu irgendeine Programmier Soft- und Hardware, die Sie",
|
|||
|
"besitzen, um die Hex-Datei in den Mikroprozessor zu laden. Beachten Sie",
|
|||
|
"die Einstellungen f<>r die Konfigurationsbits (fuses)! Bei den PIC16",
|
|||
|
"Prozessoren sind diese Konfigurationsbits bereits in der Hex-Datei",
|
|||
|
"enthalten. Die meisten Programmiersoftwares schauen automatisch nach",
|
|||
|
"diesen. F<>r die AVR-Prozessoren m<>ssen Sie die Konfigurationsbits von",
|
|||
|
"Hand einstellen.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"ANWEISUNGS-VERZEICHNIS",
|
|||
|
"======================",
|
|||
|
"",
|
|||
|
"> KONTAKT, SCHLIESSER XName RName YName",
|
|||
|
" ----] [---- ----] [---- ----] [----",
|
|||
|
"",
|
|||
|
"Wenn ein <20>unwahres<65> Signal diese Anweisung erreicht, so ist das",
|
|||
|
"Ausgangssignal <20>unwahr<68>. Wenn ein <20>wahres<65> Signal diese Anweisung",
|
|||
|
"erreicht, so ist das Ausgangssignal <20>wahr<68>. Dies nur, falls der",
|
|||
|
"vorliegende Eingangspin, Ausgangspin oder eines Merkers (Hilfsrelais)",
|
|||
|
"<EFBFBD>wahr<EFBFBD> ist, anderenfalls ist es unwahr. Diese Anweisung fragt den Status",
|
|||
|
"(Zustand) eines Eingangspins, Ausgangspins oder Merkers (Hilfsrelais) ab.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> KONTAKT, <20>FFNER XName RName YName",
|
|||
|
" ----]/[---- ----]/[---- ----]/[----",
|
|||
|
"",
|
|||
|
"Wenn ein <20>unwahres<65> Signal diese Anweisung erreicht, so ist das",
|
|||
|
"Ausgangssignal <20>unwahr<68>. Wenn ein <20>wahres<65> Signal diese Anweisung",
|
|||
|
"erreicht, so ist das Ausgangssignal <20>wahr<68>. Dies nur, falls der",
|
|||
|
"vorliegende Eingangspin, Ausgangspin oder der Merker (= internes",
|
|||
|
"Hilfsrelais) <20>unwahr<68> ist, anderenfalls ist es <20>unwahr<68>. Diese Anweisung",
|
|||
|
"fragt den Status (Zustand) eines Eingangspins, Ausgangspins oder Merkers",
|
|||
|
"(Hilfsrelais) ab. Dies ist das Gegenteil eines Schlie<69>ers.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> SPULE, NORMAL (MERKER,AUSGANG) RName YName",
|
|||
|
" ----( )---- ----( )----",
|
|||
|
"",
|
|||
|
"Wenn ein <20>unwahres<65> Signal diese Anweisung erreicht, so wird der",
|
|||
|
"vorliegende Merker (Hilfsrelais) oder Ausgangspin nicht angesteuert. Wenn",
|
|||
|
"ein <20>wahres<65> Signal diese Anweisung erreicht, so wird der vorliegende",
|
|||
|
"Merker (Hilfsrelais) oder Ausgangspin angesteuert. Es ist nicht sinnvoll",
|
|||
|
"dieser Spule eine Eingangsvariable zuzuweisen. Diese Anweisung muss",
|
|||
|
"ganz rechts im Netzwerk stehen.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> SPULE, NEGIERT (MERKER,AUSGANG) RName YName",
|
|||
|
" ----(/)---- ----(/)----",
|
|||
|
"",
|
|||
|
"Wenn ein <20>wahres<65> Signal diese Anweisung erreicht, so wird der vorliegende",
|
|||
|
"Merker (Hilfsrelais)oder Ausgangspin nicht angesteuert. Wenn ein",
|
|||
|
"<EFBFBD>unwahres<EFBFBD> Signal diese Anweisung erreicht, so wird der vorliegende Merker",
|
|||
|
"(Hilfsrelais) oder Ausgangspin angesteuert. Es ist nicht sinnvoll dieser",
|
|||
|
"Spule eine Eingangsvariable zuzuweisen. Dies ist das Gegenteil einer",
|
|||
|
"normalen Spule. Diese Anweisung muss im Netzwerk ganz rechts stehen.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> SPULE, SETZEN RName YName",
|
|||
|
" ----(S)---- ----(S)----",
|
|||
|
"",
|
|||
|
"Wenn ein <20>wahres<65> Signal diese Anweisung erreicht, so wird der vorliegende",
|
|||
|
"Merker (Hilfsrelais)oder Ausgangspin auf <20>wahr<68> gesetzt. Anderenfalls",
|
|||
|
"bleibt der Status (Zustand) des Merkers (Hilfsrelais) oder Ausgangspins",
|
|||
|
"unver<EFBFBD>ndert. Diese Anweisung kann nur den Status (Zustand) einer Spule",
|
|||
|
"von <20>unwahr<68> nach <20>wahr<68> ver<65>ndern, insofern wird diese <20>blicherweise in",
|
|||
|
"einer Kombination mit einer R<>cksetz-Anweisung f<>r eine Spule verwendet.",
|
|||
|
"Diese Anweisung muss ganz rechts im Netzwerk stehen.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> SPULE, R<>CKSETZEN RName YName",
|
|||
|
" ----(R)---- ----(R)----",
|
|||
|
"",
|
|||
|
"Wenn ein <20>wahres<65> Signal diese Anweisung erreicht, so wird der vorliegende",
|
|||
|
"Merker (Hilfsrelais) oder Ausgangspin r<>ckgesetzt. Anderenfalls bleibt der",
|
|||
|
"Status (Zustand) des Merkers (Hilfsrelais) oder Ausgangspins unver<65>ndert.",
|
|||
|
"Diese Anweisung kann nur den Status (Zustand) einer Spule von <20>wahr<68> nach",
|
|||
|
"<EFBFBD>unwahr<EFBFBD> ver<65>ndern, insofern wird diese <20>blicherweise in einer Kombination",
|
|||
|
"mit einer Setz-Anweisung f<>r eine Spule verwendet. Diese Anweisung muss",
|
|||
|
"ganz rechts im Netzwerk stehen.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> ANZUGSVERZ<52>GERUNG Tdon",
|
|||
|
" -[TON 1.000 s]-",
|
|||
|
"",
|
|||
|
"Wenn ein Signal diese Anweisung erreicht, welches seinen Status",
|
|||
|
"(Zustand) von <20>unwahr<68> nach <20>wahr<68> <20>ndert, so bleibt das Ausgangssignal",
|
|||
|
"f<EFBFBD>r 1,000 s <20>unwahr<68>, dann wird es <20>wahr<68>. Wenn ein Signal diese",
|
|||
|
"Anweisung erreicht, welches seinen Status (Zustand) von <20>wahr<68> nach",
|
|||
|
"<EFBFBD>unwahr<EFBFBD> <20>ndert, so wird das Ausgangssignal sofort <20>unwahr<68>. Der Timer",
|
|||
|
"wird jedes Mal r<>ckgesetzt (bzw. auf Null gesetzt), wenn der Eingang",
|
|||
|
"<EFBFBD>unwahr<EFBFBD> wird. Der Eingang muss f<>r 1000 aufeinanderfolgende Millisekunden",
|
|||
|
"<EFBFBD>wahr<EFBFBD> bleiben, bevor auch der Ausgang <20>wahr<68> wird. Die Verz<72>gerung",
|
|||
|
"ist konfigurierbar.",
|
|||
|
"",
|
|||
|
"Die <20>TName<6D> Variable z<>hlt, in der Einheit der jeweiligen Zykluszeit,",
|
|||
|
"von Null ab hoch. Der Ausgang der TON-Anweisung wird wahr, wenn die",
|
|||
|
"Z<EFBFBD>hlervariable gr<67><72>er oder gleich der vorliegenden Verz<72>gerung ist.",
|
|||
|
"Es m<>glich die Z<>hlervariable an einer anderen Stelle im Programm zu",
|
|||
|
"bearbeiten, zum Beispiel mit einer TRANSFER-Anweisung (MOV).",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> ABFALLVERZ<52>GERUNG Tdoff",
|
|||
|
" -[TOF 1.000 s]-",
|
|||
|
"",
|
|||
|
"Wenn ein Signal diese Anweisung erreicht, welches seinen Status",
|
|||
|
"(Zustand) von <20>wahr<68> nach <20>unwahr<68> <20>ndert, so bleibt das Ausgangssignal",
|
|||
|
"f<EFBFBD>r 1,000 s <20>wahr<68>, dann wird es <20>unwahr<68>. Wenn ein Signal diese",
|
|||
|
"Anweisung erreicht, welches seinen Status (Zustand) von <20>unwahr<68> nach",
|
|||
|
"<EFBFBD>wahr<EFBFBD> <20>ndert, so wird das Ausgangssignal sofort <20>wahr<68>. Der Timer wird",
|
|||
|
"jedes Mal r<>ckgesetzt (bzw. auf Null gesetzt), wenn der Eingang <20>unwahr<68>",
|
|||
|
"wird. Der Eingang muss f<>r 1000 aufeinanderfolgende Millisekunden <20>unwahr<68>",
|
|||
|
"bleiben, bevor auch der Ausgang <20>unwahr<68> wird. Die Verz<72>gerung ist",
|
|||
|
"konfigurierbar.",
|
|||
|
"",
|
|||
|
"Die <20>TName<6D> Variable z<>hlt, in der Einheit der jeweiligen Zykluszeit,",
|
|||
|
"von Null ab hoch. Der Ausgang der TOF Anweisung wird wahr, wenn die",
|
|||
|
"Z<EFBFBD>hlervariable gr<67><72>er oder gleich der vorliegenden Verz<72>gerung ist.",
|
|||
|
"Es m<>glich die Z<>hlervariable an einer anderen Stelle im Programm zu",
|
|||
|
"bearbeiten, zum Beispiel mit einer TRANSFER-Anweisung (MOV).",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> SPEICHERNDER TIMER Trto",
|
|||
|
" -[RTO 1.000 s]-",
|
|||
|
"",
|
|||
|
"Diese Anweisung zeichnet auf, wie lange sein Eingang <20>wahr<68> gewesen",
|
|||
|
"ist. Wenn der Eingang f<>r mindestens 1.000 s <20>wahr<68> gewesen ist, dann",
|
|||
|
"wird der Ausgang <20>wahr<68>. Andernfalls ist er <20>unwahr<68>. Der Eingang muss",
|
|||
|
"f<EFBFBD>r 1000 aufeinanderfolgende Millisekunden <20>wahr<68> gewesen sein; wenn",
|
|||
|
"der Eingang f<>r 0,6 s <20>wahr<68> war, dann <20>unwahr<68> f<>r 2,0 s und danach f<>r",
|
|||
|
"0,4 s wieder <20>wahr<68>, so wird sein Ausgang <20>wahr<68>. Nachdem der Ausgang",
|
|||
|
"<EFBFBD>wahr<EFBFBD> wurde, so bleibt er <20>wahr<68>, selbst wenn der Eingang <20>unwahr<68>",
|
|||
|
"wird, so lange der Eingang f<>r l<>nger als 1.000 s <20>wahr<68> gewesen ist.",
|
|||
|
"Der Timer muss deshalb von Hand mit Hilfe der R<>cksetz-Anweisung",
|
|||
|
"r<EFBFBD>ckgesetzt (auf Null gesetzt) werden.",
|
|||
|
"",
|
|||
|
"Die <20>TName<6D> Variable z<>hlt, in der Einheit der jeweiligen Zykluszeit,",
|
|||
|
"von Null ab hoch. Der Ausgang der RTO-Anweisung wird wahr, wenn die",
|
|||
|
"Z<EFBFBD>hlervariable gr<67><72>er oder gleich der vorliegenden Verz<72>gerung ist.",
|
|||
|
"Es m<>glich die Z<>hlervariable an einer anderen Stelle im Programm zu",
|
|||
|
"bearbeiten, zum Beispiel mit einer TRANSFER-Anweisung (MOV).",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> R<>CKSETZEN Trto Citems",
|
|||
|
" ----{RES}---- ----{RES}----",
|
|||
|
"",
|
|||
|
"Diese Anweisung r<>cksetzt einen Timer oder Z<>hler. TON oder TOF Timer",
|
|||
|
"werden automatisch r<>ckgesetzt, wenn ihr Eingang <20>wahr<68> oder <20>unwahr<68>",
|
|||
|
"wird, somit ist die RES-Anweisung f<>r diese Timer nicht erforderlich. RTO",
|
|||
|
"Timer und CTU/CTD Z<>hler werden nicht automatisch r<>ckgesetzt, somit",
|
|||
|
"m<EFBFBD>ssen diese von Hand mit Hilfe der RES-Anweisung r<>ckgesetzt (auf Null)",
|
|||
|
"werden. Wenn der Eingang <20>wahr<68> ist, so wird der Timer oder Z<>hler",
|
|||
|
"r<EFBFBD>ckgesetzt; wenn der Eingang <20>unwahr<68> ist, so erfolgt keine Aktion.",
|
|||
|
"Diese Anweisung muss ganz rechts im Netzwerk stehen.",
|
|||
|
"",
|
|||
|
" _",
|
|||
|
"> ONE-SHOT RISING, STEIGENDE FLANKE --[OSR_/ ]--",
|
|||
|
"",
|
|||
|
"Diese Anweisung wird normalerweise <20>unwahr<68> ausgewiesen. Wenn der Eingang",
|
|||
|
"der Anweisung w<>hrend des momentanen Zyklus <20>wahr<68> ist und w<>hrend des",
|
|||
|
"vorgehenden <20>unwahr<68> war, so wird der Ausgang <20>wahr<68>. Daher erzeugt diese",
|
|||
|
"Anweisung bei jeder steigenden Flanke einen Impuls f<>r einen Zyklus.",
|
|||
|
"Diese Anweisung ist hilfreich, wenn Sie Ereignisse an der steigenden",
|
|||
|
"Flanke eines Signals ausl<73>sen wollen.",
|
|||
|
"",
|
|||
|
" _",
|
|||
|
"> ONE-SHOT FALLING, FALLENDE FLANKE --[OSF \\_ ]--",
|
|||
|
"",
|
|||
|
"Diese Anweisung wird normalerweise <20>unwahr<68> ausgewiesen. Wenn der Eingang",
|
|||
|
"der Anweisung w<>hrend des momentanen Zyklus <20>unwahr<68> ist und w<>hrend des",
|
|||
|
"vorgehenden <20>wahr<68> war, so wird der Ausgang <20>wahr<68>. Daher erzeugt diese",
|
|||
|
"Anweisung bei jeder fallenden Flanke einen Impuls f<>r einen Zyklus.",
|
|||
|
"Diese Anweisung ist hilfreich, wenn Sie Ereignisse an der fallenden",
|
|||
|
"Flanke eines Signals ausl<73>sen wollen.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> BR<42>CKE, <20>FFNUNG ----+----+---- ----+ +----",
|
|||
|
"",
|
|||
|
"Der Eingangszustand einer Br<42>cke ist immer gleich seinem Ausgangszustand.",
|
|||
|
"Der Ausgangszustands einer <20>ffnung ist immer <20>unwahr<68>. Diese Anweisungen",
|
|||
|
"sind bei der Fehlerbehebung (debugging) besonders hilfreich.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> MASTER CONTROL RELAIS -{MASTER RLY}-",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"Im Normalfall ist der Anfang (die linke Stromschiene) von jedem Netzwerk",
|
|||
|
"<EFBFBD>wahr<EFBFBD>. Wenn eine <20>Master Control Relais<69> Anweisung ausgef<65>hrt wird dessen",
|
|||
|
"Eingang <20>unwahr<68> ist, so werden die Anf<6E>nge (die linke Stromschiene)",
|
|||
|
"aller folgenden Netzwerke <20>unwahr<68>. Das setzt sich fort bis die n<>chste",
|
|||
|
"<EFBFBD>Master Control Relais<69> Anweisung erreicht wird (unabh<62>ngig von dem",
|
|||
|
"Anfangszustand dieser Anweisung). Diese Anweisungen m<>ssen daher als Paar",
|
|||
|
"verwendet werden: Eine (vielleicht abh<62>ngige), um den <20>gegebenenfalls",
|
|||
|
"gesperrten<EFBFBD> Abschnitt zu starten und eine weitere, um diesen zu beenden.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> TRANSFER, MOV {destvar := } {Tret := }",
|
|||
|
" -{ 123 MOV}- -{ srcvar MOV}-",
|
|||
|
"",
|
|||
|
"Wenn der Eingang dieser Anweisung <20>wahr<68> ist, so setzt diese die",
|
|||
|
"vorliegende Zielvariable gleich der vorliegenden Quellvariablen",
|
|||
|
"oder Konstanten. Wenn der Eingang dieser Anweisung <20>unwahr<68> ist, so",
|
|||
|
"geschieht nichts. Mit der TRANSFER-Anweisung (MOV) k<>nnen Sie jede",
|
|||
|
"Variable zuweisen; dies schlie<69>t Timer und Z<>hler Statusvariablen ein,",
|
|||
|
"welche mit einem vorgestellten <20>T<EFBFBD> oder <20>C<EFBFBD> unterschieden werden. Eine",
|
|||
|
"Anweisung zum Beispiel, die eine <20>0<EFBFBD> in einen <20>TBewahrend<6E> transferiert,",
|
|||
|
"ist <20>quivalent mit einer RES-Anweisung f<>r diesen Timer. Diese Anweisung",
|
|||
|
"muss ganz rechts im Netzwerk stehen.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> ARITHMETISCHE OPERATIONEN {ADD kay :=} {SUB Ccnt :=}",
|
|||
|
" -{ 'a' + 10 }- -{ Ccnt - 10 }-",
|
|||
|
"",
|
|||
|
"> {MUL dest :=} {DIV dv := }",
|
|||
|
" -{ var * -990 }- -{ dv / -10000}-",
|
|||
|
"",
|
|||
|
"Wenn der Eingang einer dieser Anweisungen <20>wahr<68> ist, so setzt diese",
|
|||
|
"die vorliegende Zielvariable gleich dem vorliegenden arithmetischem",
|
|||
|
"Ausdruck. Die Operanden k<>nnen entweder Variabelen (einschlie<69>lich Timer-",
|
|||
|
"und Z<>hlervariabelen) oder Konstanten sein. Diese Anweisungen verwenden",
|
|||
|
"16-Bitzeichen Mathematik. Beachten Sie, dass das Ergebnis jeden Zyklus",
|
|||
|
"ausgewertet wird, wenn der Eingangszustand <20>wahr<68> ist. Falls Sie eine",
|
|||
|
"Variable inkrementieren oder dekrementieren (d.h., wenn die Zielvariable",
|
|||
|
"ebenfalls einer der Operanden ist), dann wollen Sie dies vermutlich",
|
|||
|
"nicht; normalerweise w<>rden Sie einen Impuls (one-shot) verwenden,",
|
|||
|
"sodass die Variable nur bei einer steigenden oder fallenden Flanke des",
|
|||
|
"Eingangszustands ausgewertet wird. Dividieren k<>rzt: D.h. 8 / 3 = 2.",
|
|||
|
"Diese Anweisungen m<>ssen ganz rechts im Netzwerk stehen.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> VERGLEICHEN [var ==] [var >] [1 >=]",
|
|||
|
" -[ var2 ]- -[ 1 ]- -[ Ton]-",
|
|||
|
"",
|
|||
|
"> [var /=] [-4 < ] [1 <=]",
|
|||
|
" -[ var2 ]- -[ vartwo]- -[ Cup]-",
|
|||
|
"",
|
|||
|
"Wenn der Eingang dieser Anweisung <20>unwahr<68> ist, so ist der Ausgang",
|
|||
|
"auch <20>unwahr<68>. Wenn der Eingang dieser Anweisung <20>wahr<68> ist, dann ist",
|
|||
|
"Ausgang <20>wahr<68>; dies aber nur, wenn die vorliegende Bedingung <20>wahr<68>",
|
|||
|
"ist. Diese Anweisungen k<>nnen zum Vergleichen verwendet werden, wie:",
|
|||
|
"Auf gleich, auf gr<67><72>er als, auf gr<67><72>er als oder gleich, auf ungleich,",
|
|||
|
"auf kleiner als, auf kleiner als oder gleich, eine Variable mit einer",
|
|||
|
"Variablen oder eine Variable mit einer 16-Bitzeichen-Konstanten.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> Z<>HLER CName CName",
|
|||
|
" --[CTU >=5]-- --[CTD >=5]<5D>",
|
|||
|
"",
|
|||
|
"Ein Z<>hler inkrementiert (CTU, aufw<66>rtsz<73>hlen) oder dekrementiert",
|
|||
|
"(CTD, abw<62>rtsz<73>hlen) die bezogene Z<>hlung bei jeder steigenden Flanke",
|
|||
|
"des Eingangszustands des Netzwerks (d.h. der Eingangszustand des",
|
|||
|
"Netzwerks geht von <20>unwahr<68> auf <20>wahr<68> <20>ber). Der Ausgangszustand des",
|
|||
|
"Z<EFBFBD>hlers ist <20>wahr<68>, wenn die Z<>hler- variable ist gr<67><72>er oder gleich 5",
|
|||
|
"und andernfalls <20>unwahr<68>. Der Ausgangszustand des Netzwerks kann <20>wahr<68>",
|
|||
|
"sein, selbst wenn der Eingangszustand <20>unwahr<68> ist; das h<>ngt lediglich",
|
|||
|
"von Z<>hlervariablen ab. Sie k<>nnen einer CTU- und CTD-Anweisung den",
|
|||
|
"gleichen Namen zuteilen, um den gleichen Z<>hler zu inkrementieren und",
|
|||
|
"dekrementieren. Die RES-Anweisung kann einen Z<>hler r<>cksetzen oder auch",
|
|||
|
"eine gew<65>hnliche Variablen-Operation mit der Z<>hlervariablen ausf<73>hren.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> ZIRKULIERENDER Z<>HLER CName",
|
|||
|
" --{CTC 0:7}--",
|
|||
|
"",
|
|||
|
"Ein zirkulierender Z<>hler arbeitet wie ein normaler CTU-Z<>hler, au<61>er",
|
|||
|
"nach der Erreichung seiner Obergrenze, r<>cksetzt er seine Z<>hlervariable",
|
|||
|
"auf Null. Zum Beispiel w<>rde der oben gezeigte Z<>hler, wie folgt z<>hlen:",
|
|||
|
"0, 1, 2, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2,.... Dies ist",
|
|||
|
"hilfreich in Kombination mit bedingten Anweisungen der Variablen<65>CName<6D>;",
|
|||
|
"Sie k<>nnen dies als eine Folgeschaltung verwenden. CTC-Z<>hler takten",
|
|||
|
"mit der aufsteigenden Flanke der Eingangsbedingung des Netzwerks.",
|
|||
|
"Diese Anweisung muss ganz rechts im Netzwerk stehen.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> SCHIEBEREGISTER {SHIFT REG }",
|
|||
|
" -{ reg0..3 }-",
|
|||
|
"",
|
|||
|
"Ein Schieberegister besteht aus einer Reihe von Variablen. So best<73>nde",
|
|||
|
"zum Beispiel ein Schieberegister aus den Variablen <20>reg0<67>, <20>reg1<67>,",
|
|||
|
"<EFBFBD>reg2<EFBFBD>, and <20>reg3<67>. Der Eingang des Schieberegisters ist <20>reg0<67>. Bei",
|
|||
|
"jeder steigenden Flanke der Eingansbedingung des Netzwerks, schiebt das",
|
|||
|
"Schieberegister nach rechts. Dies bedeutet es wie folgt zuweist: <20>reg3<67>",
|
|||
|
"nach <20>reg2<67>, <20>reg2<67> nach <20>reg1<67> und <20>reg1<67> nach <20>reg0<67>. <20>reg0<67> bleibt",
|
|||
|
"unver<EFBFBD>ndert. Ein gro<72>es Schieberegister kann leicht viel Speicherplatz",
|
|||
|
"belegen. Diese Anweisung muss ganz rechts im Netzwerk stehen.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> NACHSCHLAG-TABELLE {dest := }",
|
|||
|
" -{ LUT[i] }-",
|
|||
|
"",
|
|||
|
"Eine Nachschlag-Tabelle ist eine Anordnung von n Werten. Wenn die",
|
|||
|
"Eingangsbedingung des Netzwerks <20>wahr<68> ist, so wird die Ganzzahl-Variable",
|
|||
|
"<EFBFBD>dest<EFBFBD> mit dem Eintrag in der Nachschlag-Tabelle gleichgesetzt, der der",
|
|||
|
"Ganzzahl-Variablen <20>i<EFBFBD> entspricht. Das Verzeichnis beginnt bei Null,",
|
|||
|
"insofern muss sich <20>i<EFBFBD> zwischen 0 und (n-1) befinden. Das Verhalten",
|
|||
|
"dieser Anweisung ist undefiniert, wenn sich die Werte des Verzeichnisses",
|
|||
|
"au<EFBFBD>erhalb dieses Bereichs befinden.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> N<>HERUNGS-LINEAR-TABELLE {yvar :=}",
|
|||
|
" -{PWL[xvar] }-",
|
|||
|
"",
|
|||
|
"Dies ist eine gute Methode f<>r die N<>herungsl<73>sung einer komplizierten",
|
|||
|
"Funktion oder Kurve. Sie k<>nnte zum Beispiel hilfreich sein, wenn Sie",
|
|||
|
"versuchen eine Eichkurve zu verwenden, um die rohe Ausgangsspannung",
|
|||
|
"eines F<>hlers in g<>nstigere Einheiten zu wandeln.",
|
|||
|
"",
|
|||
|
"Angenommen Sie versuchen eine N<>herungsl<73>sung f<>r eine Funktion zu finden,",
|
|||
|
"die eine Eingangs-Ganzzahlvariable <20>x<EFBFBD> in Ausgangs-Ganzzahlvariable <20>y<EFBFBD>",
|
|||
|
"wandelt. Einige Punkte der Funktion sind Ihnen bekannt; so w<>rden Sie",
|
|||
|
"z.B. die folgenden kennen:",
|
|||
|
"",
|
|||
|
" f(0) = 2",
|
|||
|
" f(5) = 10",
|
|||
|
" f(10) = 50",
|
|||
|
" f(100) = 100",
|
|||
|
"",
|
|||
|
"Dies bedeutet, dass sich die Punkte",
|
|||
|
"",
|
|||
|
" (x0, y0) = ( 0, 2)",
|
|||
|
" (x1, y1) = ( 5, 10)",
|
|||
|
" (x2, y2) = ( 10, 50)",
|
|||
|
" (x3, y3) = (100, 100)",
|
|||
|
"",
|
|||
|
"in dieser Kurve befinden. Diese 4 Punkte k<>nnen Sie in die Tabelle der",
|
|||
|
"<EFBFBD>N<EFBFBD>herungs-Linear<61>-Anweisung eintragen. Die <20>N<EFBFBD>herungs-Linear<61>-Anweisung",
|
|||
|
"wird dann auf den Wert von <20>xvar<61> schauen und legt den Wert von <20>yvar<61>",
|
|||
|
"fest. Sie stellt <20>yvar<61> so ein, dass die <20>N<EFBFBD>herungs-Linear<61>-Kurve sich",
|
|||
|
"durch alle Punkte bewegt, die Sie vorgegeben haben. Wenn Sie z.B. f<>r",
|
|||
|
"<EFBFBD>xvar<EFBFBD> = 10 vorgegeben haben, dann stellt die Anweisung <20>yvar<61> auf gleich",
|
|||
|
"50 ein.",
|
|||
|
"",
|
|||
|
"Falls Sie dieser Anweisung einen Wert <20>xvar<61> zuweisen, der zwischen zwei",
|
|||
|
"Werten von <20>x<EFBFBD> liegt, denen Sie Punkte zugeordnet haben, dann stellt die",
|
|||
|
"Anweisung <20>yvar<61> so ein, dass (<28>xvar<61>, <20>yvar<61>) in der geraden Linie liegt;",
|
|||
|
"diejenige die, die zwei Punkte in der Tabelle verbindet. Z.B. erzeugt",
|
|||
|
"<EFBFBD>xvar<EFBFBD> = 55 bei <20>yvar<61> = 75. Die beiden Punkte in der Tabelle sind (10,",
|
|||
|
"50) und (100, 100). 55 liegt auf halbem Weg zwischen 10 und 100 und 75",
|
|||
|
"liegt auf halbem Weg zwischen 50 und 100, somit liegt (55, 75) auf der",
|
|||
|
"Linie, die diese zwei Punkte verbindet.",
|
|||
|
"",
|
|||
|
"Die Punkte m<>ssen in aufsteigender Reihenfolge der x-Koordinaten",
|
|||
|
"angegeben werden. Einige mathematische Operationen, erforderlich f<>r",
|
|||
|
"bestimmte Nachschlag-Tabellen mit 16-Bit-Mathematik, kann man ggf. nicht",
|
|||
|
"ausf<EFBFBD>hren. In diesem Falle gibt LDmicro eine Warnmeldung aus. So w<>rde",
|
|||
|
"z.B. die folgende Nachschlag-Tabelle eine Fehlermeldung hervorrufen:",
|
|||
|
"",
|
|||
|
" (x0, y0) = ( 0, 0)",
|
|||
|
" (x1, y1) = (300, 300)",
|
|||
|
"",
|
|||
|
"Sie k<>nnen diesen Fehler beheben, indem sie den Abstand zwischen den",
|
|||
|
"Punkten kleiner machen. So ist zum Beispiel die n<>chste Tabelle <20>quivalent",
|
|||
|
"zur vorhergehenden, ruft aber keine Fehlermeldung hervor.",
|
|||
|
"",
|
|||
|
" (x0, y0) = ( 0, 2)",
|
|||
|
" (x1, y1) = (150, 150)",
|
|||
|
" (x2, y2) = (300, 300)",
|
|||
|
"",
|
|||
|
"Es wird kaum einmal notwendig sein, mehr als f<>nf oder sechs Punkte",
|
|||
|
"zu verwenden. Falls Sie mehr Punkte hinzuf<75>gen, so vergr<67><72>ert dies",
|
|||
|
"Ihren Code und verlangsamt die Ausf<73>hrung. Falls Sie f<>r <20>xvar<61> einen",
|
|||
|
"Wert vergeben, der gr<67><72>er ist, als die gr<67><72>te x-Koordinate der Tabelle",
|
|||
|
"oder kleiner, als die kleinste x-Koordinate in der Tabelle, so ist das",
|
|||
|
"Verhalten der Anweisung undefiniert. Diese Anweisung muss ganz rechts",
|
|||
|
"im Netzwerk stehen.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> A/D-WANDLER EINLESEN AName",
|
|||
|
" --{READ ADC}--",
|
|||
|
"",
|
|||
|
"LDmicro kann einen Code erzeugen, der erm<72>glicht, die A/D-Wandler",
|
|||
|
"zu verwenden, die in manchen Mikroprozessoren vorgesehen sind.",
|
|||
|
"Wenn der Eingangszustand dieser Anweisung <20>wahr<68> ist, dann wird eine",
|
|||
|
"Einzellesung von dem A/D-Wandler entnommen und in der Variablen <20>AName<6D>",
|
|||
|
"gespeichert. Diese Variable kann anschlie<69>end mit einer gew<65>hnlichen",
|
|||
|
"Ganzzahlvariablen bearbeitet werden (wie: Kleiner als, gr<67><72>er als,",
|
|||
|
"arithmetisch usw.). Weisen Sie <20>Axxx<78> in der gleichen Weise einen Pin",
|
|||
|
"zu, wie Sie einen Pin f<>r einen digitalen Ein- oder Ausgang vergeben",
|
|||
|
"w<EFBFBD>rden, indem auf diesen in der Liste unten in der Maske (Bildanzeige)",
|
|||
|
"doppelklicken. Wenn der Eingangszustand dieses Netzwerks <20>unwahr<68> ist,",
|
|||
|
"so wird die Variable <20>AName<6D> unver<65>ndert belassen.",
|
|||
|
"",
|
|||
|
"F<EFBFBD>r alle derzeitig unterst<73>tzten Prozessoren gilt: Eine 0 Volt Lesung",
|
|||
|
"am Eingang des A/D-Wandlers entspricht 0. Eine Lesung gleich der",
|
|||
|
"Versorgungsspannung (bzw. Referenzspannung) entspricht 1023. Falls Sie",
|
|||
|
"AVR-Prozessoren verwenden, so verbinden Sie AREF mit Vdd. (Siehe Atmel",
|
|||
|
"Datenblatt, dort wird eine Induktivit<69>t von 100<30>H empfohlen). Sie k<>nnen",
|
|||
|
"arithmetische Operationen verwenden, um einen g<>nstigeren Ma<4D>stabfaktor",
|
|||
|
"festzulegen, aber beachten Sie, dass das Programm nur Ganzzahl-Arithmetik",
|
|||
|
"vorsieht. Allgemein sind nicht alle Pins als A/D-Wandler verwendbar. Die",
|
|||
|
"Software gestattet Ihnen nicht, einen Pin zuzuweisen, der kein A/D",
|
|||
|
"bzw. analoger Eingang ist. Diese Anweisung muss ganz rechts im Netzwerk",
|
|||
|
"stehen.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> PULSWEITEN MODULATIONSZYKLUS FESTLEGEN duty_cycle",
|
|||
|
" -{PWM 32.8 kHz}-",
|
|||
|
"",
|
|||
|
"LDmicro kann einen Code erzeugen, der erm<72>glicht, die PWM-Peripherie",
|
|||
|
"zu verwenden, die in manchen Mikroprozessoren vorgesehen ist. Wenn die",
|
|||
|
"Eingangsbedingung dieser Anweisung <20>wahr<68> ist, so wird der Zyklus der",
|
|||
|
"PWM-Peripherie mit dem Wert der Variablen <20>duty cycle<6C> gleichgesetzt. Der",
|
|||
|
"<EFBFBD>duty cycle<6C> muss eine Zahl zwischen 0 und 100 sein. 0 entspricht immer",
|
|||
|
"<EFBFBD>low<EFBFBD> und 100 entsprechend immer <20>high<67>. (Wenn Sie damit vertraut sind,",
|
|||
|
"wie die PWM-Peripherie funktioniert, so bemerken Sie, dass dies bedeutet,",
|
|||
|
"dass LDmicro die <20>duty cycle<6C>-Variable automatisch prozentual zu den",
|
|||
|
"PWM-Taktintervallen skaliert [= den Ma<4D>stabfaktor festlegt].)",
|
|||
|
"",
|
|||
|
"Sie k<>nnen die PWM-Zielfrequenz in Hz definieren. Es kann vorkommen, dass",
|
|||
|
"die angegebene Frequenz nicht genau erreicht wird, das h<>ngt davon ab,",
|
|||
|
"wie sich diese innerhalb der Taktfrequenz des Prozessors einteilt. LDmicro",
|
|||
|
"w<EFBFBD>hlt dann die n<>chst erreichbare Frequenz; falls der Fehler zu gro<72> ist,",
|
|||
|
"so wird eine Warnung ausgegeben. H<>here Geschwindigkeiten k<>nnen die",
|
|||
|
"Aufl<EFBFBD>sung beeintr<74>chtigen.",
|
|||
|
"",
|
|||
|
"Diese Anweisung muss ganz rechts im Netzwerk stehen. Die <20>ladder",
|
|||
|
"logic<EFBFBD>-Laufzeit verbraucht (schon) einen Timer, um die Zykluszeit",
|
|||
|
"zu messen. Dies bedeutet, dass die PWM nur bei den Mikroprozessoren",
|
|||
|
"verf<EFBFBD>gbar ist, bei denen mindestens zwei geeignete Timer vorhanden sind.",
|
|||
|
"PWM verwendet den PIN CCP2 (nicht CCP1) bei den PIC16-Prozessoren und",
|
|||
|
"OC2 (nicht OC1A) bei den AVR-Prozessoren.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> REMANENT MACHEN saved_var",
|
|||
|
" --{PERSIST}--",
|
|||
|
"",
|
|||
|
"Wenn der Eingangszustand dieser Anweisung <20>wahr<68> ist, so bewirkt",
|
|||
|
"dies, dass eine angegebene Ganzzahl-Variable automatisch im EEPROM",
|
|||
|
"gespeichert wird. Dies bedeutet, dass ihr Wert bestehen bleiben wird,",
|
|||
|
"auch wenn der Prozessor seine Versorgungsspannung verliert. Es ist",
|
|||
|
"nicht notwendig, die Variable an klarer Stelle im EEPROM zu speichern,",
|
|||
|
"dies geschieht automatisch, so oft sich der Wert der Variablen",
|
|||
|
"<EFBFBD>ndert. Bei Spannungswiederkehr wird die Variable automatisch vom",
|
|||
|
"EEPROM zur<75>ckgespeichert. Falls eine Variable, die h<>ufig ihren Wert",
|
|||
|
"<EFBFBD>ndert, remanent (dauerhaft) gemacht wird, so k<>nnte Ihr Prozessor sehr",
|
|||
|
"rasch verschlei<65>en, weil dieser lediglich f<>r eine begrenzte Anzahl von",
|
|||
|
"Schreibbefehlen konstruiert ist (~100 000). Wenn der Eingangszustand des",
|
|||
|
"Netzwerks <20>unwahr<68> ist, so geschieht nichts. Diese Anweisung muss ganz",
|
|||
|
"rechts im Netzwerk stehen.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> UART (SERIELL) EMPFANGEN var",
|
|||
|
" --{UART RECV}--",
|
|||
|
"",
|
|||
|
"LDmicro kann einen Code erzeugen, der erm<72>glicht UART zu verwenden,",
|
|||
|
"welcher in manchen Mikroprozessoren vorgesehen ist.",
|
|||
|
"Bei AVR-Prozessoren mir mehrfachem UART, wird nur UART1 (nicht UART0)",
|
|||
|
"unterst<EFBFBD>tzt. Konfigurieren Sie die Baudrate, indem Sie <20>Voreinstellungen",
|
|||
|
"-> Prozessor-Parameter<65> verwenden. Bestimmte Baudraten werden mit",
|
|||
|
"bestimmten Quarzfrequenzen nicht erreichbar sein. In diesem Fall gibt",
|
|||
|
"LDmicro eine Warnmeldung.",
|
|||
|
"",
|
|||
|
"Wenn der Eingangszustand dieser Anweisung <20>unwahr<68> ist, so geschieht",
|
|||
|
"nichts. Wenn der Eingangszustand <20>wahr<68> ist, so versucht diese Anweisung",
|
|||
|
"ein einzelnes Schriftzeichen vom UART-Eingang zu empfangen. Wenn",
|
|||
|
"kein Schriftzeichen eingelesen wird, dann ist der Ausgangszustand",
|
|||
|
"<EFBFBD>unwahr<EFBFBD>. Wenn ein ASCII-Zeichen eingelesen wird, so wird sein Wert in",
|
|||
|
"<EFBFBD>var<EFBFBD> abgespeichert und der Ausgangszustand wird f<>r einen einzelnen",
|
|||
|
"Zyklus <20>wahr<68>.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> UART (SERIELL) SENDEN var",
|
|||
|
" --{UART SEND}--",
|
|||
|
"",
|
|||
|
"LDmicro kann einen Code erzeugen, der erm<72>glicht UART zu verwenden,",
|
|||
|
"welcher in manchen Mikroprozessoren vorgesehen ist.",
|
|||
|
"Bei AVR-Prozessoren mir mehrfachem UART, wird nur UART1 (nicht UART0)",
|
|||
|
"unterst<EFBFBD>tzt. Konfigurieren Sie die Baudrate, indem Sie <20>Voreinstellungen",
|
|||
|
"-> Prozessor-Parameter<65> verwenden. Bestimmte Baudraten werden mit",
|
|||
|
"bestimmten Quarzfrequenzen nicht erreichbar sein. In diesem Fall gibt",
|
|||
|
"LDmicro eine Warnmeldung.",
|
|||
|
"",
|
|||
|
"Wenn der Eingangszustand dieser Anweisung <20>unwahr<68> ist, so geschieht",
|
|||
|
"nichts. Wenn der Eingangszustand <20>wahr<68> ist, so schreibt diese",
|
|||
|
"Anweisung ein einzelnes Schriftzeichen zum UART. Der ASCII-Wert des",
|
|||
|
"Schriftzeichens, welches gesendet werden soll, muss vorher in <20>var<61>",
|
|||
|
"abgespeichert worden sein. Der Ausgangszustand dieses Netzwerks ist",
|
|||
|
"<EFBFBD>wahr<EFBFBD>, wenn UART besch<63>ftigt ist (gerade dabei ein Schriftzeichen zu",
|
|||
|
"<EFBFBD>bermitteln) und andernfalls <20>unwahr<68>.",
|
|||
|
"",
|
|||
|
"Denken Sie daran, dass einige Zeit zum Senden von Schriftzeichen",
|
|||
|
"beansprucht wird. <20>berpr<70>fen Sie den Ausgangszustand dieser Anweisung,",
|
|||
|
"sodass das erste Schriftzeichen bereits <20>bermittelt wurde, bevor Sie",
|
|||
|
"versuchen ein zweites Schriftzeichen zu <20>bermitteln. Oder verwenden Sie",
|
|||
|
"einen Timer, um eine Verz<72>gerung zwischen die Schriftzeichen f<>gen. Sie",
|
|||
|
"d<EFBFBD>rfen den Eingangszustand dieser Anweisung nur dann auf <20>wahr<68> setzen",
|
|||
|
"(bzw. ein Schriftzeichen <20>bermitteln), wenn der Ausgangszustand <20>unwahr<68>",
|
|||
|
"ist (bzw. UART unbesch<63>ftigt ist).",
|
|||
|
"",
|
|||
|
"Untersuchen Sie die <20>Formatierte Zeichenfolge<67>-Anweisung, bevor Sie",
|
|||
|
"diese Anweisung verwenden. Die <20>Formatierte Zeichenfolge<67>- Anweisung",
|
|||
|
"ist viel einfacher in der Anwendung und fast sicher f<>hig, das zu tun,",
|
|||
|
"was Sie beabsichtigen.",
|
|||
|
"",
|
|||
|
" ",
|
|||
|
"> FORMATIERTE ZEICHENFOLGE <20>BER UART var",
|
|||
|
" -{\"Druck: \\3\\r\\n\"}-",
|
|||
|
"",
|
|||
|
"LDmicro kann einen Code erzeugen, der erm<72>glicht UART zu verwenden,",
|
|||
|
"welcher in manchen Mikroprozessoren vorgesehen ist.",
|
|||
|
"Bei AVR-Prozessoren mir mehrfachem UART, wird nur UART1 (nicht UART0)",
|
|||
|
"unterst<EFBFBD>tzt. Konfigurieren Sie die Baudrate, indem Sie <20>Voreinstellungen",
|
|||
|
"-> Prozessor-Parameter<65> verwenden. Bestimmte Baudraten werden mit",
|
|||
|
"bestimmten Quarzfrequenzen nicht erreichbar sein. In diesem Fall gibt",
|
|||
|
"LDmicro eine Warnmeldung.",
|
|||
|
"",
|
|||
|
"Wenn der Eingangszustand des Netzwerks f<>r diese Anweisung von <20>unwahr<68>",
|
|||
|
"auf <20>wahr<68> <20>bergeht, so beginnt diese eine vollst<73>ndige Zeichenfolge",
|
|||
|
"<EFBFBD>ber den seriellen Anschluss zu senden. Wenn die Zeichenfolge die",
|
|||
|
"besondere Reihenfolge <20>\\3<EFBFBD> enth<74>lt, dann wird diese Folge durch den Wert",
|
|||
|
"von <20>var<61> ersetzt, welcher automatisch in eine Zeichenfolge gewandelt",
|
|||
|
"wird. Die Variable wird formatiert, sodass diese exakt 3 Schriftzeichen",
|
|||
|
"<EFBFBD>bernimmt. Falls die Variable zum Beispiel gleich 35 ist, dann wird die",
|
|||
|
"exakte ausgegebene Zeichenfolge, wie folgt aussehen: <20>Druck: 35\\r\\n<EFBFBD>",
|
|||
|
"(beachten Sie das zus<75>tzliche Freizeichen). Wenn stattdessen die Variable",
|
|||
|
"gleich 1432 ist, so w<>re das Verhalten der Anweisung undefiniert,",
|
|||
|
"weil 1432 mehr als drei Stellen hat. In diesem Fall w<>re es notwendig",
|
|||
|
"stattdessen <20>\\4<EFBFBD> zu verwenden.",
|
|||
|
"",
|
|||
|
"Falls die Variable negativ ist, so verwenden Sie stattdessen <20>\\-3d<33>",
|
|||
|
"(oder <20>\\-4d<34>). LDmicro wird hierdurch veranlasst eine vorgestellte",
|
|||
|
"Freistelle f<>r positive Zahlen und ein vorgestelltes Minuszeichen f<>r",
|
|||
|
"negative Zahlen auszugeben.",
|
|||
|
"",
|
|||
|
"Falls mehrere <20>Formatierte Zeichenfolge<67>-Anweisungen zugleich ausgegeben",
|
|||
|
"werden (oder wenn eine neue Zeichenfolge ausgegeben wird bevor die",
|
|||
|
"vorherige vollendet ist), oder auch wenn diese mit UART TX Anweisungen",
|
|||
|
"vermischt, so ist das Verhalten undefiniert.",
|
|||
|
"",
|
|||
|
"Es ist auch m<>glich diese Anweisung f<>r eine feste Zeichenfolge zu",
|
|||
|
"verwenden, die <20>ber den seriellen Anschluss gesendet wird, ohne den Wert",
|
|||
|
"einer Ganzzahlvariablen in den Text zu interpolieren. In diesem Fall",
|
|||
|
"f<EFBFBD>gen Sie einfach diese spezielle Steuerungsfolge nicht ein.",
|
|||
|
"",
|
|||
|
"Verwenden Sie <20>\\\\<EFBFBD> f<>r einen zeichengetreuen verkehrten Schr<68>gstrich.",
|
|||
|
"Zus<EFBFBD>tzlich zur Steuerungsfolge f<>r die Interpolierung einer Ganzzahl-",
|
|||
|
"Variablen, sind die folgenden Steuerungszeichen erh<72>ltlich:",
|
|||
|
"",
|
|||
|
" * \\r -- carriage return Zeilenschaltung",
|
|||
|
" * \\n -- new line Zeilenwechsel",
|
|||
|
" * \\f -- form feed Formularvorschub",
|
|||
|
" * \\b -- backspace R<>cksetzen",
|
|||
|
" * \\xAB -- character with ASCII value 0xAB (hex)",
|
|||
|
" -- Schriftzeichen mit ASCII-Wert 0xAB (hex)",
|
|||
|
"",
|
|||
|
"Der Ausgangszustand des Netzwerks dieser Anweisung ist <20>wahr<68>, w<>hrend",
|
|||
|
"diese Daten <20>bertr<74>gt, ansonsten <20>unwahr<68>. Diese Anweisung ben<65>tigt eine",
|
|||
|
"gro<EFBFBD>e Menge des Programmspeichers, insofern sollte sie sparsam verwendet",
|
|||
|
"werden. Die gegenw<6E>rtige Umsetzung ist nicht besonders effizient, aber",
|
|||
|
"eine bessere w<>rde <20>nderungen an s<>mtlichen Ausl<73>ufern des Programms",
|
|||
|
"ben<EFBFBD>tigen.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"EIN HINWEIS ZUR VERWENDUNG DER MATHEMATIK",
|
|||
|
"=========================================",
|
|||
|
"",
|
|||
|
"Denken Sie daran, dass LDmicro nur 16-Bit mathematische Operationen",
|
|||
|
"ausf<EFBFBD>hrt. Dies bedeutet, dass das Endresultat jeder Berechnung,",
|
|||
|
"die Sie vornehmen, eine Ganzzahl zwischen -32768 und 32767 sein muss.",
|
|||
|
"Dies bedeutet auch, dass die Zwischenergebnisse Ihrer Berechnungen alle",
|
|||
|
"in diesem Bereich liegen m<>ssen.",
|
|||
|
"",
|
|||
|
"Wollen wir zum Beispiel annehmen, dass Sie folgendes berechnen m<>chten",
|
|||
|
"y = (1/x) * 1200, in der x zwischen 1 und 20 liegt.",
|
|||
|
"Dann liegt y zwischen 1200 und 60, was in eine 16-Bit Ganzzahl passt,",
|
|||
|
"so w<>re es zumindest theoretisch m<>glich diese Berechnung auszuf<75>hren.",
|
|||
|
"Es gibt zwei M<>glichkeiten, wie Sie dies codieren k<>nnten: Sie k<>nnen",
|
|||
|
"die Reziproke (Kehrwert) ausf<73>hren and dann multiplizieren:",
|
|||
|
"",
|
|||
|
" || {DIV temp :=} ||",
|
|||
|
" ||---------{ 1 / x }----------||",
|
|||
|
" || ||",
|
|||
|
" || {MUL y := } ||",
|
|||
|
" ||----------{ temp * 1200}----------||",
|
|||
|
" || ||",
|
|||
|
"",
|
|||
|
"Oder Sie k<>nnten einfach die Division in einem Schritt direkt vornehmen.",
|
|||
|
"",
|
|||
|
" || {DIV y :=} ||",
|
|||
|
" ||-----------{ 1200 / x }-----------||",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"Mathematisch sind die zwei <20>quivalent; aber wenn Sie diese ausprobieren,",
|
|||
|
"so werden Sie herausfinden, dass die erste ein falsches Ergebnis von",
|
|||
|
"y = 0 liefert. Dies geschieht, weil die Variable einen Unterlauf",
|
|||
|
"[= resultatabh<62>ngige Kommaverschiebung] ergibt. So sei zum Beispiel x = 3,",
|
|||
|
"(1 / x) = 0.333, dies ist aber keine Ganzzahl; die Divisionsoperation",
|
|||
|
"n<EFBFBD>hert dies, als 'temp = 0'. Dann ist y = temp * 1200 = 0. Im zweiten",
|
|||
|
"Fall gibt es kein Zwischenergebnis, welches einen Unterlauf [= resultats-",
|
|||
|
"abh<EFBFBD>ngige Kommaverschiebung] ergibt, somit funktioniert dann alles.",
|
|||
|
"",
|
|||
|
"Falls Sie Probleme bei Ihren mathematischen Operationen erkennen,",
|
|||
|
"dann <20>berpr<70>fen Sie die Zwischenergebnisse auf Unterlauf [eine",
|
|||
|
"resultatabh<EFBFBD>ngige Kommaverschiebung] (oder auch auf <20>berlauf, der dann",
|
|||
|
"im Programm in Umlauf kommt; wie zum Beispiel 32767 + 1 = -32768).",
|
|||
|
"Wann immer m<>glich, w<>hlen Sie Einheiten, deren Werte in einem Bereich",
|
|||
|
"von -100 bis 100 liegen.",
|
|||
|
"",
|
|||
|
"Falls Sie eine Variable um einen bestimmten Faktor vergr<67><72>ern m<>ssen, tun",
|
|||
|
"Sie dies, indem Sie eine Multiplikation und eine Division verwenden. Um",
|
|||
|
"zum Beispiel y = 1.8 * x zu vergr<67><72>ern, berechnen Sie y = (9/5) * x,",
|
|||
|
"(was dasselbe ist, weil 1,8 = 9/5 ist), und codieren Sie dies als",
|
|||
|
"y = (9 * x)/5, indem Sie die Multiplikation zuerst ausf<73>hren.",
|
|||
|
"",
|
|||
|
" || {MUL temp :=} ||",
|
|||
|
" ||---------{ x * 9 }----------||",
|
|||
|
" || ||",
|
|||
|
" || {DIV y :=} ||",
|
|||
|
" ||-----------{ temp / 5 }-----------||",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"Dies funktioniert mit allen x < (32767 / 9), oder x < 3640. Bei h<>heren",
|
|||
|
"Werten w<>rde die Variable <20>temp<6D> <20>berflie<69>en. F<>r x gibt es eine",
|
|||
|
"<EFBFBD>hnliche Untergrenze.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"KODIER-STIL",
|
|||
|
"===========",
|
|||
|
"",
|
|||
|
"Ich gestatte mehrere Spulen in Parallelschaltung in einem einzigen",
|
|||
|
"Netzwerk unterzubringen. Das bedeutet, sie k<>nnen ein Netzwerk, wie",
|
|||
|
"folgt schreiben:",
|
|||
|
"",
|
|||
|
" || Xa Ya ||",
|
|||
|
" 1 ||-------] [--------------( )-------||",
|
|||
|
" || ||",
|
|||
|
" || Xb Yb ||",
|
|||
|
" ||-------] [------+-------( )-------||",
|
|||
|
" || | ||",
|
|||
|
" || | Yc ||",
|
|||
|
" || +-------( )-------||",
|
|||
|
" || ||",
|
|||
|
" ",
|
|||
|
"Anstatt diesem:",
|
|||
|
"",
|
|||
|
" || Xa Ya ||",
|
|||
|
" 1 ||-------] [--------------( )-------||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || Xb Yb ||",
|
|||
|
" 2 ||-------] [--------------( )-------||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || Xb Yc ||",
|
|||
|
" 3 ||-------] [--------------( )-------||",
|
|||
|
" || ||",
|
|||
|
"",
|
|||
|
"Rein theoretisch bedeutet das, dass Sie irgendein Programm, als ein",
|
|||
|
"gigantisches Netzwerk, schreiben k<>nnten. Und es best<73>nde <20>berhaupt",
|
|||
|
"keine Notwendigkeit mehrere Netzwerke zu verwenden. In der Praxis ist",
|
|||
|
"dies aber eine schlechte Idee, denn wenn Netzwerke komplexer werden, so",
|
|||
|
"werden sie auch schwieriger zu editieren, ohne L<>schen und neu Schreiben",
|
|||
|
"von Anweisungen.",
|
|||
|
"",
|
|||
|
"Jedoch, ist es manchmal ein guter Einfall, verwandte Logik in einem",
|
|||
|
"einzelnen Netzwerk zusammenzufassen. Dies erzeugt einen beinahe",
|
|||
|
"identischen Code, als ob sie getrennte Netzwerke entworfen h<>tten, es",
|
|||
|
"zeigt aber, dass diese Anweisungen (Logik) verwandt ist, wenn man diese",
|
|||
|
"im Netzwerk-Diagramm betrachtet.",
|
|||
|
"",
|
|||
|
" * * *",
|
|||
|
"",
|
|||
|
"Im Allgemeinen h<>lt man es f<>r eine schlechte Form, den Code in einer",
|
|||
|
"solchen Weise zu schreiben, dass sein Ergebnis von einer Folge von",
|
|||
|
"Netzwerken abh<62>ngt. So zum Beispiel ist der folgende Code nicht besonders",
|
|||
|
"gut, falls <20>xa<78> und <20>xb<78> jemals <20>wahr<68> w<>rden.",
|
|||
|
"",
|
|||
|
" || Xa {v := } ||",
|
|||
|
" 1 ||-------] [--------{ 12 MOV}--||",
|
|||
|
" || ||",
|
|||
|
" || Xb {v := } ||",
|
|||
|
" ||-------] [--------{ 23 MOV}--||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || [v >] Yc ||",
|
|||
|
" 2 ||------[ 15]-------------( )-------||",
|
|||
|
" || ||",
|
|||
|
"",
|
|||
|
"Ich werde diese Regel brechen und indem ich dies so mache, entwerfe ich",
|
|||
|
"einen Code-Abschnitt, der erheblich kompakter ist. Hier zum Beispiel,",
|
|||
|
"zeige ich auf, wie ich eine 4-Bit bin<69>re Gr<47><72>e von <20>xb3:0<> in eine",
|
|||
|
"Ganzzahl wandeln w<>rde.",
|
|||
|
"",
|
|||
|
" || {v := } ||",
|
|||
|
" 3 ||-----------------------------------{ 0 MOV}--||",
|
|||
|
" || ||",
|
|||
|
" || Xb0 {ADD v :=} ||",
|
|||
|
" ||-------] [------------------{ v + 1 }-----------||",
|
|||
|
" || ||",
|
|||
|
" || Xb1 {ADD v :=} ||",
|
|||
|
" ||-------] [------------------{ v + 2 }-----------||",
|
|||
|
" || ||",
|
|||
|
" || Xb2 {ADD v :=} ||",
|
|||
|
" ||-------] [------------------{ v + 4 }-----------||",
|
|||
|
" || ||",
|
|||
|
" || Xb3 {ADD v :=} ||",
|
|||
|
" ||-------] [------------------{ v + 8 }-----------||",
|
|||
|
" || ||",
|
|||
|
"",
|
|||
|
"Falls die TRANSFER-Anweisung (MOV) an das untere Ende des Netzwerks",
|
|||
|
"gebracht w<>rde, anstatt auf das obere, so w<>rde der Wert von <20>v<EFBFBD>, an",
|
|||
|
"anderer Stelle im Programm gelesen, gleich Null sein. Das Ergebnis dieses",
|
|||
|
"Codes h<>ngt daher von der Reihenfolge ab, in welcher die Anweisungen",
|
|||
|
"ausgewertet werden. Im Hinblick darauf, wie hinderlich es w<>re, diesen",
|
|||
|
"Code auf eine andere Weise zu schreiben, nehme ich dies so hin.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"BUGS",
|
|||
|
"====",
|
|||
|
"",
|
|||
|
"LDmicro erzeugt keinen sehr effizienten Code; es ist langsam in der",
|
|||
|
"Ausf<EFBFBD>hrung und geht verschwenderisch mit dem Flash- und RAM-Speicher",
|
|||
|
"um. Trotzdem kann ein mittelgro<72>er PIC- oder AVR-Prozessor alles, was",
|
|||
|
"eine kleine SPS kann, somit st<73>rt dies mich nicht besonders.",
|
|||
|
"",
|
|||
|
"Die maximale L<>nge der Variabelen-Bezeichnungen (-Namen) ist sehr",
|
|||
|
"begrenzt. Dies ist so, weil diese so gut in das KOP-Programm (ladder)",
|
|||
|
"passen. Somit sehe ich keine gute L<>sung f<>r diese Angelegenheit.",
|
|||
|
"",
|
|||
|
"Falls Ihr Programm zu gro<72> f<>r die Zeit-, Programmspeicher- oder",
|
|||
|
"Datenspeicher-Beschr<68>nkungen des Prozessors ist, den Sie gew<65>hlt haben,",
|
|||
|
"so erhalten Sie keine Fehlermeldung. Es wird einfach irgendwo anders alles",
|
|||
|
"vermasseln. (Anmerkung: Das AVR STK500 gibt hierzu Fehlermeldungen aus.)",
|
|||
|
"",
|
|||
|
"Unsorgf<EFBFBD>ltiges Programmieren bei den Datei <20>ffnen/Abspeichern-Routinen",
|
|||
|
"f<EFBFBD>hren wahrscheinlich zu der M<>glichkeit eines Absturzes oder es wird",
|
|||
|
"ein willk<6C>rlicher Code erzeugt, der eine besch<63>digte oder b<>sartige .ld",
|
|||
|
"Datei ergibt.",
|
|||
|
"",
|
|||
|
"Bitte berichten Sie zus<75>tzliche Bugs oder richten Sie Anfragen f<>r neue",
|
|||
|
"Programm-Bestandteile an den Autor (in Englisch).",
|
|||
|
"",
|
|||
|
"Thanks to:",
|
|||
|
" * Marcelo Solano, for reporting a UI bug under Win98",
|
|||
|
" * Serge V. Polubarjev, for not only noticing that RA3:0 on the",
|
|||
|
" PIC16F628 didn't work but also telling me how to fix it",
|
|||
|
" * Maxim Ibragimov, for reporting and diagnosing major problems",
|
|||
|
" with the till-then-untested ATmega16 and ATmega162 targets",
|
|||
|
" * Bill Kishonti, for reporting that the simulator crashed when the",
|
|||
|
" ladder logic program divided by zero",
|
|||
|
" * Mohamed Tayae, for reporting that persistent variables were broken",
|
|||
|
" on the PIC16F628",
|
|||
|
" * David Rothwell, for reporting several user interface bugs and a",
|
|||
|
" problem with the \"Export as Text\" function",
|
|||
|
"",
|
|||
|
"Particular thanks to Heinz Ullrich Noell, for this translation (of both",
|
|||
|
"the manual and the program's user interface) into German.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"COPYING, AND DISCLAIMER",
|
|||
|
"=======================",
|
|||
|
"",
|
|||
|
"DO NOT USE CODE GENERATED BY LDMICRO IN APPLICATIONS WHERE SOFTWARE",
|
|||
|
"FAILURE COULD RESULT IN DANGER TO HUMAN LIFE OR DAMAGE TO PROPERTY. THE",
|
|||
|
"AUTHOR ASSUMES NO LIABILITY FOR ANY DAMAGES RESULTING FROM THE OPERATION",
|
|||
|
"OF LDMICRO OR CODE GENERATED BY LDMICRO.",
|
|||
|
"",
|
|||
|
"This program is free software: you can redistribute it and/or modify it",
|
|||
|
"under the terms of the GNU General Public License as published by the",
|
|||
|
"Free Software Foundation, either version 3 of the License, or (at your",
|
|||
|
"option) any later version.",
|
|||
|
"",
|
|||
|
"This program is distributed in the hope that it will be useful, but",
|
|||
|
"WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY",
|
|||
|
"or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License",
|
|||
|
"for more details.",
|
|||
|
"",
|
|||
|
"You should have received a copy of the GNU General Public License along",
|
|||
|
"with this program. If not, see <http://www.gnu.org/licenses/>.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"Jonathan Westhues",
|
|||
|
"",
|
|||
|
"Rijswijk -- Dec 2004",
|
|||
|
"Waterloo ON -- Jun, Jul 2005",
|
|||
|
"Cambridge MA -- Sep, Dec 2005",
|
|||
|
" Feb, Mar 2006",
|
|||
|
"",
|
|||
|
"Email: user jwesthues, at host cq.cx",
|
|||
|
"",
|
|||
|
"",
|
|||
|
NULL
|
|||
|
};
|
|||
|
#endif
|
|||
|
|
|||
|
#ifdef LDLANG_FR
|
|||
|
char *HelpTextFr[] = {
|
|||
|
"INTRODUCTION",
|
|||
|
"============",
|
|||
|
"",
|
|||
|
"LDmicro g<>n<EFBFBD>re du code natif pour certains microcontroleurs Microchip",
|
|||
|
"PIC16F et Atmel AVR. Usuellement les programmes de developpement pour ces",
|
|||
|
"microcontrolleurs sont <20>crits dans des langages comme l'assembleur , le",
|
|||
|
"C ou le Basic. Un programme qui utilise un de ces langages est une suite",
|
|||
|
"de commandes. Ces programmes sont puissants et adapt<70>s <20> l'architecture",
|
|||
|
"des processeurs, qui de fa<66>on interne ex<65>cutent une liste d'instructions.",
|
|||
|
"",
|
|||
|
"Les API (Automates Programmables Industriels, PLC en anglais, SPS en",
|
|||
|
"allemand) utilisent une autre voie et sont programm<6D>s en Langage <20>",
|
|||
|
"Contacts (ou LADDER). Un programme simple est repr<70>sent<6E> comme ceci :",
|
|||
|
"",
|
|||
|
"",
|
|||
|
" || ||",
|
|||
|
" || Xbutton1 Tdon Rchatter Yred ||",
|
|||
|
" 1 ||-------]/[---------[TON 1.000 s]-+-------]/[--------------( )-------||",
|
|||
|
" || | ||",
|
|||
|
" || Xbutton2 Tdof | ||",
|
|||
|
" ||-------]/[---------[TOF 2.000 s]-+ ||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || Rchatter Ton Tnew Rchatter ||",
|
|||
|
" 2 ||-------]/[---------[TON 1.000 s]----[TOF 1.000 s]---------( )-------||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" ||------[END]---------------------------------------------------------||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
"",
|
|||
|
"(TON est une tempo travail; TOF est une tempo repos. les commandes --] [-- ",
|
|||
|
"repr<EFBFBD>sentent des Entr<74>es, qui peuvent <20>tre des contacts de relais. Les ",
|
|||
|
"commandes --( )-- sont des Sorties, qui peuvent repr<70>senter des bobines de ",
|
|||
|
"relais. Beaucoup de r<>f<EFBFBD>rences de programmes de langage <20> contacts (LADDER) ",
|
|||
|
"existent sur Internet et sont <20> quelques d<>tails pr<70>s, identiques <20> ",
|
|||
|
"l'impl<70>mentation repr<70>sent<6E>e ci-dessus.",
|
|||
|
"",
|
|||
|
"Un certain nombre de diff<66>rences apparaissent entre les programmes en",
|
|||
|
"langage <20>volu<6C>s ( C, Basic, Etc..) et les programmes pour API:",
|
|||
|
"",
|
|||
|
" * Le programme est repr<70>sent<6E> dans un format graphique, et non",
|
|||
|
" comme une liste de commandes en format texte. Beaucoup de personnes",
|
|||
|
" trouve cela plus facile <20> comprendre.",
|
|||
|
"",
|
|||
|
" * Au niveau de base, le programme apparait comme un diagramme",
|
|||
|
" de circuit avec des contacts de relais (Entr<74>es) et des bobines",
|
|||
|
" (Sorties). Ceci est intuitif pour les programmeurs qui connaissent",
|
|||
|
" la th<74>orie des circuits <20>lectriques.",
|
|||
|
"",
|
|||
|
" * Le compilateur de langage <20> contacts v<>rifie tout ceci lors",
|
|||
|
" de la compilation. Vous n'avez pas <20> <20>crire de code quand une",
|
|||
|
" Sortie est remplac<61>e et est remise en Entr<74>e ou si une temporisation",
|
|||
|
" est modifi<66>e, vous n'avez pas non plus <20> sp<73>cifier l'ordre o<> les",
|
|||
|
" calculs doivent <20>tre effectu<74>s. L'outil API (PLC) s'occupe de cela",
|
|||
|
" pour vous.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"LDmicro compile le langage <20> contact (ladder) en code pour PIC16F ou",
|
|||
|
"AVR. Les processeurs suivants sont support<72>s:",
|
|||
|
"",
|
|||
|
" * PIC16F877",
|
|||
|
" * PIC16F628",
|
|||
|
" * PIC16F876 (non test<73>)",
|
|||
|
" * PIC16F88 (non test<73>)",
|
|||
|
" * PIC16F819 (non test<73>)",
|
|||
|
" * PIC16F887 (non test<73>)",
|
|||
|
" * PIC16F886 (non test<73>)",
|
|||
|
" * ATmega128",
|
|||
|
" * ATmega64",
|
|||
|
" * ATmega162 (non test<73>)",
|
|||
|
" * ATmega32 (non test<73>)",
|
|||
|
" * ATmega16 (non test<73>)",
|
|||
|
" * ATmega8 (non test<73>)",
|
|||
|
"",
|
|||
|
"Il doit <20>tre facile de supporter d'autres PIC ou AVR, mais je n'est",
|
|||
|
"aucun moyen pour les tester. Si vous en voulez un en particulier faites",
|
|||
|
"moi parvenir votre demande et je verrai ce que je peux faire.",
|
|||
|
"",
|
|||
|
"En utilisant LDmicro, vous dessinez un diagramme <20> contacts pour votre",
|
|||
|
"programme. Vous pouvez simuler le fonctionnement logique en temps r<>el sur",
|
|||
|
"votre PC. Quand vous <20>tes convaincu que le fonctionnement est correct,",
|
|||
|
"vous pouvez affecter les broches du microcontroleur pour les Entr<74>es et",
|
|||
|
"Sorties, ensuite vous compilez votre programmeen code AVR ou PIC. Le",
|
|||
|
"fichier de sortie du compilateur est un fichier .HEX que vous devrez",
|
|||
|
"mettre dans le microcontroleur en utilisant un programmateur pour PIC",
|
|||
|
"ou AVR.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"LDmicro est con<6F>u pour <20>tre similaire <20> la majorit<69> des API commerciaux.",
|
|||
|
"Il y a quelques exceptions, et une partie des possibilit<69>s n'est",
|
|||
|
"pas standard avec le mat<61>riel industriel. Lire attentivement la",
|
|||
|
"description de chaque instruction m<>me si elle parait famili<6C>re. Ce",
|
|||
|
"document consid<69>re que vous avez une connaisance de base du langage <20>",
|
|||
|
"contact et de la structure des logiciels pour automates programmables.",
|
|||
|
"Cycle d'ex<65>cution : Lecture des Entr<74>es -> Calculs -> Ecriture des Sorties",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"CIBLES ADDITIONNELLES ",
|
|||
|
"=====================",
|
|||
|
"",
|
|||
|
"Il est aussi possible de g<>n<EFBFBD>rer du code ANSI C . Vous pouvez utiliser",
|
|||
|
"ceci pour n'importe quel processeur dont vous avez un compilateur C,",
|
|||
|
"mais le runtime est de votre responsabilit<69>. LDmicro g<>r<EFBFBD>re uniquement",
|
|||
|
"le source pour le cycle de l'API. Vous <20>tes responsable de l'appel de",
|
|||
|
"chaque s<>quence du cycle et de l'impl<70>mentation de toutes les Entr<74>es",
|
|||
|
"/ Sorties (Lecture/Ecriture des Entr<74>es digitales, etc ...). Voir les",
|
|||
|
"commentaires dans le code source pour plus de d<>tails.",
|
|||
|
"",
|
|||
|
"Finalement, LDmicro peut g<>n<EFBFBD>rer un code byte ind<6E>pendant du processeur",
|
|||
|
"pour une machine virtuelle pr<70>vue pour faire fonctionner ce type de code.",
|
|||
|
"J'ai pr<70>vu un exemple simple d'impl<70>mentation d'un interpr<70>teur /VM",
|
|||
|
"<EFBFBD>crit en code C le plus portable possible. La cible fonctionne juste sur",
|
|||
|
"quelques plateformes ou vous pouvez pr<70>voir votre VM. Ceci peut <20>tre utile",
|
|||
|
"pour des applications ou vous pouvez utiliser le languages <20> contacts",
|
|||
|
"comme du langage script pour customiser un programme important. Voir",
|
|||
|
"les commentaires dans l'exemple pour les d<>tails.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"OPTIONS LIGNE DE COMMANDE",
|
|||
|
"=========================",
|
|||
|
"",
|
|||
|
"LDmicro.exe fonctionne normallement sans options de ligne de commande.",
|
|||
|
"Vous pouvez faire un raccourci vers le programme et le sauvegarder sur",
|
|||
|
"l'<27>cran , il suffit alors de faire un double clic pour le faire d<>marrer",
|
|||
|
"et vous vous retrouvez ainsi dans l'interface utilisateur.",
|
|||
|
"",
|
|||
|
"Si un nom de fichier est pass<73> en ligne de de commande de LDmicro, (ex:",
|
|||
|
"`ldmicro.exe asd.ld'), alors LDmicro va essayer d'ouvrir `asd.ld', si",
|
|||
|
"il existe. Une erreur se produira si `asd.ld' n'existe pas. Vous avez",
|
|||
|
"la possibilit<69> d'associer LDmicro avec les fichiers d'extention .ld.",
|
|||
|
"Ceci permet <20> LDmicro de d<>marrer automatiquement lors d'un double clic",
|
|||
|
"sur un fichier xxx.ld.",
|
|||
|
"",
|
|||
|
"Si les arguments de la ligne de commande sont pass<73>s sous la forme:",
|
|||
|
"`ldmicro.exe /c src.ld dest.hex', LDmicro compilera le programme`src.ld',",
|
|||
|
"et sauvegardera le fichier compil<69> sous`dest.hex'. Apr<70>s compilation",
|
|||
|
"LDmicro se termine, que la compilation soit correcte ou pas. Aucun",
|
|||
|
"message n'est affich<63> sur la console. Ce mode est pratique uniquement",
|
|||
|
"lorsque vous ex<65>cutez LDmicro en ligne de commande.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"BASES",
|
|||
|
"=====",
|
|||
|
"",
|
|||
|
"Si vous ex<65>cutez LDmicro sans arguments de ligne de commande, il d<>marre",
|
|||
|
"avec un programme vide. Si vous d<>marrer avec le nom d'un programme",
|
|||
|
"langage <20> contacts (xxx.ld) en ligne de commande, il va essayer de",
|
|||
|
"charger le programme au d<>marrage. LDmicro utilise son format interne",
|
|||
|
"pour le programme , il ne peut pas importer de programmes <20>dit<69>s par",
|
|||
|
"d'autres outils.",
|
|||
|
"",
|
|||
|
"Si vous ne chargez pas un programme existant, LDmicro d<>marre en ins<6E>rant",
|
|||
|
"une ligne vide. Vous pouvez ajouter les instructions pour votre programme:",
|
|||
|
"par exemple ajouter un jeu de contacts (Instruction -> Ins<6E>rer Contact)",
|
|||
|
"qui sera nomm<6D> `Xnew'. `X' d<>signe un contact qui peut <20>tre li<6C> <20> une",
|
|||
|
"broche d'entr<74>e du microcontroleur, vous pouvez affecter la broche pour",
|
|||
|
"ce contact plus tard apr<70>s avoir choisi le microcontroleur et renomm<6D>",
|
|||
|
"les contacts. La premi<6D>re lettre indique de quel type de composants il",
|
|||
|
"s'agit par exemple :",
|
|||
|
"",
|
|||
|
" * Xnom -- Reli<6C> <20> une broche d'entr<74>e du microcontroleur",
|
|||
|
" * Ynom -- Reli<6C> <20> une broche de sortie du microcontroleur",
|
|||
|
" * Rnom -- `Relais interne': un bit en m<>moire",
|
|||
|
" * Tnom -- Temporisation; Tempo travail, tempo repos, ou totalisatrice",
|
|||
|
" * Cnom -- Compteur, Compteur ou d<>compteur",
|
|||
|
" * Anom -- Un entier lu sur un comvertisseur A/D ",
|
|||
|
" * nom -- Variable g<>n<EFBFBD>rique (Entier : Integer)",
|
|||
|
"",
|
|||
|
"Choisir le reste du nom pour d<>crire l'utilisation de ce que fait cet",
|
|||
|
"objet et qui doit <20>tre unique dans tout le programme. Un m<>me nom doit",
|
|||
|
"toujours se r<>f<EFBFBD>rer au m<>me objet dans le programme en entier.Par",
|
|||
|
"exemple , vous aurez une erreur si vous utilisez une tempo travail",
|
|||
|
"(TON) appell<6C>e TDelai et une tempo repos (TOF) appell<6C>e aussi TDelai",
|
|||
|
"dans le m<>me programme, le comptage effectu<74> par ces tempo utilisera le",
|
|||
|
"m<EFBFBD>me emplacement en m<>moire, mais il est acceptable d'avoir une tempo",
|
|||
|
"sauvegard<EFBFBD>e (RTO) Tdelai m<>me nom avec une instruction de RES, dans ce",
|
|||
|
"cas l'instruction fonctionne avec le m<>me timer.",
|
|||
|
"",
|
|||
|
"Les noms de variables peuvent <20>tre des lettres, chiffres ou le",
|
|||
|
"caract<EFBFBD>re _. Un nom de variable ne doit pas commencer par un chiffre.",
|
|||
|
"Les noms de variables sont sensibles <20> la casse (majuscule/minuscules).",
|
|||
|
"",
|
|||
|
"Les instructions de manipulation de variables (MOV, ADD, EQU,",
|
|||
|
"etc.) peuvent travailler avec des variables de n'importe quel nom. Elles",
|
|||
|
"peuvent avoir acc<63>s aux accumulateurs des temporisations ou des",
|
|||
|
"compteurs. Cela peut quelquefois <20>tre tr<74>s utile, par exemple si vous",
|
|||
|
"voulez contr<74>ler la valeur d'un compteur ou d'une temporisation dans",
|
|||
|
"une ligne particuli<6C>re.",
|
|||
|
"",
|
|||
|
"Les variables sont toujours des entiers 16 bits. Leur valeur peut",
|
|||
|
"donc <20>tre comprise entre -32768 et 32767 inclus. Les variables sont",
|
|||
|
"toujours sign<67>es. Vous pouvez les sp<73>cifier de fa<66>on litt<74>rale comme",
|
|||
|
"des nombres d<>cimaux normaux (0, 1234, -56), vous pouvez aussi les",
|
|||
|
"sp<EFBFBD>cifier en caract<63>res ASCII ('A', 'z') en mettant le caract<63>re entre",
|
|||
|
"des guillemets simples. Vous pouvez utiliser un caract<63>re ASCII dans la",
|
|||
|
"majorit<EFBFBD> des endroits o<> vous pouvez utiliser les nombres d<>cimaux.",
|
|||
|
"",
|
|||
|
"En bas de l'<27>cran, vous pouvez voir la liste de tous les objets",
|
|||
|
"utilis<EFBFBD>s dans votre programme. La liste est automatiquement g<>n<EFBFBD>r<EFBFBD>e",
|
|||
|
"<EFBFBD> partir du programme. La majorit<69> des objets ne necessitent aucune",
|
|||
|
"configuration. Seuls : les objets `Xnom', `Ynom', and `Anom' doivent <20>tre",
|
|||
|
"affect<EFBFBD>s <20> une broche du micro La premi<6D>re chose <20> faire est de choisir",
|
|||
|
"la microcontroleur utilis<69> : Param<61>res -> Microcontroleur ensuite vous",
|
|||
|
"affectez les broches en faisant un double clic dans la liste.",
|
|||
|
"",
|
|||
|
"Vous pouvez modifier le programme en ins<6E>rant ou supprimant des",
|
|||
|
"instructions. Le curseur clignote dans la programme pour indiquer",
|
|||
|
"l'instruction courante s<>lectionn<6E>e et le point d'insertion. S'il ne",
|
|||
|
"clignote pas pressez <Tab> ou cliquer sur une instruction, ou vous",
|
|||
|
"pouvez ins<6E>rer une nouvelle instruction <20> la droite ou <20> la gauche",
|
|||
|
"(en s<>rie avec), ou au dessous ou au dessus (en parall<6C>le avec) de",
|
|||
|
"l'instruction s<>lectionn<6E>e. Quelques op<6F>rations ne sont pas permises ,",
|
|||
|
"par exemple aucune instruction permise <20> droite de la bobine.",
|
|||
|
"",
|
|||
|
"Le programme d<>marre avec uniquement une ligne. Vous pouvez ajouter",
|
|||
|
"plusieurs lignes en s<>lectionnant Insertion -> Ligne avant ou apr<70>s",
|
|||
|
"dans le menu. Vous pouvez faire un circuit complexe en pla<6C>ant plusieurs",
|
|||
|
"branches en parall<6C>le ou en s<>rie avec une ligne, mais il est plus clair",
|
|||
|
"de faire plusieurs lignes.",
|
|||
|
"",
|
|||
|
"Une fois votre programme <20>crit, vous pouvez le tester par simulation,",
|
|||
|
"et le compiler dans un fichier HEX pour le microcontroleur de destination.",
|
|||
|
"",
|
|||
|
"SIMULATION",
|
|||
|
"==========",
|
|||
|
"",
|
|||
|
"Pour entrer dans la mode simulation choisir Simulation -> Simuler",
|
|||
|
"ou presser <Ctrl+M> le programme est affich<63> diff<66>remment en mode",
|
|||
|
"simulation. Les instructions activ<69>es sont affich<63>es en rouge vif, les",
|
|||
|
"instructions qui ne le sont pas sont affich<63>es en gris<69>. Appuyer sur la",
|
|||
|
"barre d'espace pour d<>marrer l'API pour 1 cycle. Pour faire fonctionner",
|
|||
|
"continuellement en temps r<>el choisir Simulation ->D<>marrer la simulation",
|
|||
|
"en temps r<>el ou presser <Ctrl+R> L'affichage du programme est mise <20>",
|
|||
|
"jour en temps r<>el en fonction des changements d'<27>tat des entr<74>es.",
|
|||
|
"",
|
|||
|
"Vous pouvez valider l'<27>tat des entr<74>es du programme en faisant un",
|
|||
|
"double clic sur l'entr<74>e dans la liste au bas de l'<27>cran, ou sur le",
|
|||
|
"contact `Xnom' de l'instruction dans le programme, pour avoir le reflet",
|
|||
|
"automatiquement de la validation d'une entr<74>e dans le programme, il",
|
|||
|
"faut que le programme soit en cycle.(le d<>marrer par <Ctrl+R> ou barre",
|
|||
|
"d'espace pour un seul cycle).",
|
|||
|
"",
|
|||
|
"COMPILER EN CODE NATIF",
|
|||
|
"======================",
|
|||
|
"",
|
|||
|
"Le point final est de g<>n<EFBFBD>rer un fichier .HEX qui sera programm<6D> dans le",
|
|||
|
"microcontroleur que vous avez choisi par Param<61>tres -> Microcontroleur",
|
|||
|
"Vous devez affecter les broches d'entr<74>es sorties pour chaque 'Xnom'",
|
|||
|
"et 'Ynom'. Vous pouvez faire cela en faisant un double clic sur la nom",
|
|||
|
"de l'objet dans la liste au bas de l'<27>cran. Une boite de dialogue vous",
|
|||
|
"demande de choisir une des broches non affect<63>es dans la liste.",
|
|||
|
"",
|
|||
|
"Vous devez aussi choisir la temps de cycle que voulez utiliser pour",
|
|||
|
"votre application, vous devez aussi choisir la fr<66>quence d'horloge du",
|
|||
|
"processeur. Faire Param<61>tres -> Param<61>tres MCU dans le menu. En g<>n<EFBFBD>ral,",
|
|||
|
"le temps de cycle peut <20>tre laiss<73> <20> la valeur par d<>faut (10 ms) qui est",
|
|||
|
"une bonne valeur pour la majorit<69> des applications. Indiquer la fr<66>quence",
|
|||
|
"du quartz utilis<69> (ou du r<>sonateur c<>ramique ou autres..) et cliquer OK.",
|
|||
|
"",
|
|||
|
"Maintenant vous pouvez cr<63>er le fichier pour int<6E>grer dans le",
|
|||
|
"microcontroleur. Choisir Compilation -> Compiler, ou compiler sous...",
|
|||
|
"Si vous avez pr<70>c<EFBFBD>demment compil<69> votre programme, vous pouvez sp<73>cifier",
|
|||
|
"un nom diff<66>rent de fichier de sortie. Si votre programme ne comporte",
|
|||
|
"pas d'erreur (li<6C> <20> la structure du programme), LDmicro g<>n<EFBFBD>re un fichier",
|
|||
|
"IHEX pr<70>t <20> <20>tre programm<6D> dans le chip.",
|
|||
|
"",
|
|||
|
"Utilisez votre logiciel et mat<61>riel de programmation habituel pour",
|
|||
|
"charger le fichier HEX dans la microcontroleur. V<>rifiez et validez",
|
|||
|
"les bits de configuration (fuses), pour les processeurs PIC16Fxxx ces",
|
|||
|
"bits sont inclus dans le fichier HEX, et la majorit<69> des logiciels de",
|
|||
|
"programmation les valident automatiquement, pour les processeurs AVR ,",
|
|||
|
"vous devez le faire manuellement.",
|
|||
|
"",
|
|||
|
"REFERENCE DES INSTRUCTIONS ",
|
|||
|
"==========================",
|
|||
|
"",
|
|||
|
"> CONTACT, NORMALLEMENT OUVERT Xnom Rnom Ynom",
|
|||
|
" ----] [---- ----] [---- ----] [----",
|
|||
|
"",
|
|||
|
" Si le signal arrivant <20> cette instruction est FAUX (0) le signal",
|
|||
|
" de sortie est aussi faux (0), s'il est vrai , il sera aussi vrai",
|
|||
|
" en sortie si et uniquement si la broche d'Entr<74>e ou de Sortie",
|
|||
|
" ou de Relais interne est vraie, sinon l'instruction sera fausse.",
|
|||
|
" Cette instruction peut v<>rifier l'<27>tat d'une broche d'entr<74>e, d'une",
|
|||
|
" broche de sortie ou d'un relais interne",
|
|||
|
"",
|
|||
|
" ",
|
|||
|
"> CONTACT, NORMALLEMENT FERME Xnom Rnom Ynom",
|
|||
|
" ----]/[---- ----]/[---- ----]/[----",
|
|||
|
"",
|
|||
|
" Si le signal arrivant <20> cette instruction est FAUX (0) le signal",
|
|||
|
" de sortie est vrai (1), s'il est vrai , il sera faux en sortie .",
|
|||
|
" Cette instruction peut v<>rifier l'<27>tat d'une broche d'entr<74>e, d'une",
|
|||
|
" broche de sortie ou d'un relais interne. Fonctionne en opposition",
|
|||
|
" par rapport au contact normallement ouvert.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> BOBINE, NORMALE Rnom Ynom",
|
|||
|
" ----( )---- ----( )----",
|
|||
|
"",
|
|||
|
" Si le signal arrivant <20> cette instruction est faux, alors le relais ",
|
|||
|
" interne ou la broche de sortie est faux (mise <20> z<>ro). Si le signal",
|
|||
|
" arrivant <20> cette instruction est vrai(1), alors le relais interne ou",
|
|||
|
" la broche de sortie est valid<69>e (mise <20> 1). Il n'est pas important",
|
|||
|
" d'affecter une variable <20> une bobine.",
|
|||
|
" Cette instruction est plac<61>e le plus <20> droite dans une s<>quence.",
|
|||
|
" ",
|
|||
|
"",
|
|||
|
"> BOBINE, INVERSE Rnom Ynom",
|
|||
|
" ----(/)---- ----(/)----",
|
|||
|
"",
|
|||
|
" Si le signal arrivant <20> cette instruction est vrai, alors le relais ",
|
|||
|
" interne ou la broche de sortie est faux (mise <20> z<>ro). Si le signal",
|
|||
|
" arrivant <20> cette instruction est faux(0), alors le relais interne ou",
|
|||
|
" la broche de sortie est valid<69>e (mise <20> 1). Il n'est pas important ",
|
|||
|
" d'affecter une variable <20> une bobine.",
|
|||
|
" Cette instruction est plac<61>e le plus <20> droite dans une s<>quence.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> BOBINE, ACCROCHAGE Rnom Ynom",
|
|||
|
" ----(S)---- ----(S)----",
|
|||
|
"",
|
|||
|
" Si le signal arrivant <20> cette instruction est vrai, alors le",
|
|||
|
" relais interne ou la broche de sortie est valid<69>e (mise <20> 1). Cette",
|
|||
|
" instruction permet de changer l'<27>tat d'un relais ou d'une sortie :",
|
|||
|
" uniquement passe <20> vrai, ou reste vrai si elle <20>tait d<>j<EFBFBD> <20> 1,",
|
|||
|
" elle est typiquement utilis<69>e en combinaison avec une Bobine REMISE",
|
|||
|
" A ZERO.",
|
|||
|
" Cette instruction est plac<61>e le plus <20> droite dans une s<>quence.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> BOBINE, REMISE A ZERO Rnom Ynom",
|
|||
|
" ----(R)---- ----(R)----",
|
|||
|
"",
|
|||
|
" Si le signal arrivant <20> cette instruction est vrai, alors le relais ",
|
|||
|
" interne ou la sortie est mise <20> z<>ro (0), si elle <20>tait d<>j<EFBFBD> <20> 0, ",
|
|||
|
" il n'y a aucun changement, cette instruction change l'<27>tat d'une ",
|
|||
|
" sortie uniquement si elle <20>tait <20> 1, cette instruction fonctionne en ",
|
|||
|
" combinaison avec l'instruction ci-dessus Bobine <20> ACCROCHAGE.",
|
|||
|
" Cette instruction est plac<61>e le plus <20> droite dans une s<>quence.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> TEMPORISATION TRAVAIL Tdon ",
|
|||
|
" -[TON 1.000 s]-",
|
|||
|
"",
|
|||
|
" Quand la signal arrivant <20> cette instruction passe de faux <20> vrai",
|
|||
|
" (0 <20> 1), le signal de sortie attend 1.000 seconde avant de passer",
|
|||
|
" <20> 1. Quand le signal de commande de cette instruction passe ZERO,",
|
|||
|
" le signal de sortie passe imm<6D>diatement <20> z<>ro. La tempo est remise",
|
|||
|
" <20> z<>ro <20> chaque fois que l'entr<74>e repasse <20> z<>ro. L'entr<74>e doit <20>tre",
|
|||
|
" maintenue vraie <20> 1 pendant au moins 1000 millisecondes cons<6E>cutives",
|
|||
|
" avant que la sortie ne devienne vraie. le d<>lai est configurable.",
|
|||
|
"",
|
|||
|
" La variable `Tnom' compte depuis z<>ro en unit<69>s de temps de scan.",
|
|||
|
" L'instruction Ton devient vraie en sortie quand la variable du",
|
|||
|
" compteur est plus grande ou <20>gale au delai fix<69>. Il est possible",
|
|||
|
" de manipuler la variable du compteur en dehors, par exemple par une",
|
|||
|
" instruction MOVE.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> TEMPORISATION REPOS Tdoff ",
|
|||
|
" -[TOF 1.000 s]-",
|
|||
|
"",
|
|||
|
" Quand le signal qui arrive <20> l'instruction passe de l'<27>tat vrai",
|
|||
|
" (1) <20> l'<27>tat faux (0), la sortie attend 1.000 s avant de d<>venir",
|
|||
|
" faux (0) Quand le signal arrivant <20> l'instruction passe de l'<27>tat",
|
|||
|
" faux <20> l'<27>tat vrai, le signal passe <20> vrai imm<6D>diatement. La",
|
|||
|
" temporisation est remise <20> z<>ro <20> chaque fois que l'entr<74>e devient",
|
|||
|
" fausse. L'entr<74>e doit <20>tre maintenue <20> l'<27>tat faux pendant au moins",
|
|||
|
" 1000 ms cons<6E>cutives avant que la sortie ne passe <20> l'<27>tat faux. La",
|
|||
|
" temporisation est configurable.",
|
|||
|
"",
|
|||
|
" La variable `Tname' compte depuis z<>ro en unit<69>s de temps de scan.",
|
|||
|
" L'instruction Ton devient vraie en sortie quand la variable du",
|
|||
|
" compteur est plus grande ou <20>gale au delai fix<69>. Il est possible",
|
|||
|
" de manipuler la variable du compteur en dehors, par exemple par une",
|
|||
|
" instruction MOVE.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> TEMPORISATION TOTALISATRICE Trto ",
|
|||
|
" -[RTO 1.000 s]-",
|
|||
|
"",
|
|||
|
" Cette instruction prend en compte le temps que l'entr<74>e a <20>t<EFBFBD> <20> l'<27>tat",
|
|||
|
" vrai (1). Si l'entr<74>e a <20>t<EFBFBD> vraie pendant au moins 1.000s la sortie",
|
|||
|
" devient vraie (1).L'entr<74>e n'a pas besoin d'<27>tre vraie pendant 1000 ms",
|
|||
|
" cons<6E>cutives. Si l'entr<74>e est vraie pendant 0.6 seconde puis fausse",
|
|||
|
" pendant 2.0 secondes et ensuite vraie pendant 0.4 seconde, la sortie",
|
|||
|
" va devenir vraie. Apr<70>s <20>tre pass<73> <20> l'<27>tat vrai, la sortie reste",
|
|||
|
" vraie quelque soit la commande de l'instruction. La temporisation",
|
|||
|
" doit <20>tre remise <20> z<>ro par une instruction de RES (reset).",
|
|||
|
"",
|
|||
|
" La variable `Tnom' compte depuis z<>ro en unit<69>s de temps de scan.",
|
|||
|
" L'instruction Ton devient vraie en sortie quand la variable du",
|
|||
|
" compteur est plus grande ou <20>gale au delai fix<69>. Il est possible",
|
|||
|
" de manipuler la variable du compteur en dehors, par exemple par une",
|
|||
|
" instruction MOVE.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> RES Remise <20> Z<>ro Trto Citems",
|
|||
|
" ----{RES}---- ----{RES}----",
|
|||
|
"",
|
|||
|
" Cette instruction fait un remise <20> z<>ro d'une temporisation ou d'un",
|
|||
|
" compteur. Les tempos TON et TOF sont automatiquement remisent <20> z<>ro",
|
|||
|
" lorsque leurs entr<74>es deviennent respectivement fausses ou vraies,",
|
|||
|
" RES n'est pas donc pas n<>cessaire pour ces tempos. Les tempos RTO",
|
|||
|
" et les compteurs d<>compteurs CTU / CTD ne sont pas remis <20> z<>ro",
|
|||
|
" automatiquement, il faut donc utiliser cette instruction. Lorsque",
|
|||
|
" l'entr<74>e est vraie , le compteur ou la temporisation est remis <20>",
|
|||
|
" z<>ro. Si l'entr<74>e reste <20> z<>ro, aucune action n'est prise.",
|
|||
|
" Cette instruction est plac<61>e le plus <20> droite dans une s<>quence.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> FRONT MONTANT _",
|
|||
|
" --[OSR_/ ]--",
|
|||
|
"",
|
|||
|
" La sortie de cette instruction est normallement fausse. Si",
|
|||
|
" l'instruction d'entr<74>e est vraie pendant ce scan et qu'elle <20>tait",
|
|||
|
" fausse pendant le scan pr<70>c<EFBFBD>dent alors la sortie devient vraie. Elle",
|
|||
|
" g<>n<EFBFBD>re une impulsion <20> chaque front montant du signal d'entr<74>e. Cette",
|
|||
|
" instruction est utile si vous voulez intercepter le front montant",
|
|||
|
" du signal.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> FRONT DESCENDANT _",
|
|||
|
" --[OSF \\_]--",
|
|||
|
"",
|
|||
|
" La sortie de cette instruction est normallement fausse. Si",
|
|||
|
" l'instruction d'entr<74>e est fausse (0) pendant ce scan et qu'elle",
|
|||
|
" <20>tait vraie (1) pendant le scan pr<70>c<EFBFBD>dent alors la sortie devient",
|
|||
|
" vraie. Elle g<>n<EFBFBD>re une impulsion <20> chaque front descendant du signal",
|
|||
|
" d'entr<74>e. Cette instruction est utile si vous voulez intercepter le",
|
|||
|
" front descendant d'un signal.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> COURT CIRCUIT (SHUNT), CIRCUIT OUVERT",
|
|||
|
" ----+----+---- ----+ +----",
|
|||
|
"",
|
|||
|
" Une instruction shunt donne en sortie une condition qui est toujours ",
|
|||
|
" <20>gale <20> la condition d'entr<74>e. Une instruction Circuit Ouvert donne ",
|
|||
|
" toujours une valeur fausse en sortie.",
|
|||
|
" Ces instructions sont en g<>n<EFBFBD>ral utilis<69>es en phase de test.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> RELAIS DE CONTROLE MAITRE",
|
|||
|
" -{MASTER RLY}-",
|
|||
|
"",
|
|||
|
" Par d<>faut, la condition d'entr<74>e d'une ligne est toujours vraie. Si",
|
|||
|
" une instruction Relais de contr<74>le maitre est ex<65>cut<75>e avec une",
|
|||
|
" valeur d'entr<74>e fausse, alors toutes les lignes suivantes deviendront",
|
|||
|
" fausses. Ceci va continuer jusqu'<27> la rencontre de la prochaine",
|
|||
|
" instruction relais de contr<74>le maitre qui annule l'instruction de",
|
|||
|
" d<>part. Ces instructions doivent toujours <20>tre utilis<69>es par paires:",
|
|||
|
" une pour commencer (qui peut <20>tre sous condition) qui commence la",
|
|||
|
" partie d<>activ<69>e et une pour la terminer.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> MOUVOIR {destvar := } {Tret := }",
|
|||
|
" -{ 123 MOV}- -{ srcvar MOV}-",
|
|||
|
"",
|
|||
|
" Lorsque l'entr<74>e de cette instruction est vraie, elle va mettre la",
|
|||
|
" variable de destination <20> une valeur <20>gale <20> la variable source ou <20>",
|
|||
|
" la constante source. Quand l'entr<74>e de cette instruction est fausse",
|
|||
|
" rien ne se passe. Vous pouvez affecter n'importe quelle variable",
|
|||
|
" <20> une instruction de d<>placement, ceci inclu l'<27>tat de variables",
|
|||
|
" compteurs ou temporisateurs qui se distinguent par l'ent<6E>te T ou",
|
|||
|
" C. Par exemple mettre 0 dans Tsauvegard<72> <20>quivaut <20> faire une RES",
|
|||
|
" de la temporisation. Cette instruction doit <20>tre compl<70>tement <20>",
|
|||
|
" droite dans une s<>quence.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> OPERATIONS ARITHMETIQUES {ADD kay :=} {SUB Ccnt :=}",
|
|||
|
" -{ 'a' + 10 }- -{ Ccnt - 10 }-",
|
|||
|
"",
|
|||
|
"> {MUL dest :=} {DIV dv := }",
|
|||
|
" -{ var * -990 }- -{ dv / -10000}-",
|
|||
|
"",
|
|||
|
" Quand l'entr<74>e de cette instruction est vraie, elle place en",
|
|||
|
" destination la variable <20>gale <20> l'expression calcul<75>e. Les op<6F>randes",
|
|||
|
" peuvent <20>tre des variables (en incluant les variables compteurs et",
|
|||
|
" tempos) ou des constantes. Ces instructions utilisent des valeurs 16",
|
|||
|
" bits sign<67>es. Il faut se souvenir que le r<>sultat est <20>valu<6C> <20> chaque",
|
|||
|
" cycle tant que la condition d'entr<74>e est vraie. Si vous incr<63>mentez",
|
|||
|
" ou d<>cr<63>mentez une variable (si la variable de destination est",
|
|||
|
" aussi une des op<6F>randes), le r<>sultat ne sera pas celui escompt<70>,",
|
|||
|
" il faut utiliser typiquement un front montant ou descendant de la",
|
|||
|
" condition d'entr<74>e qui ne sera <20>valu<6C> qu'une seule fois. La valeur",
|
|||
|
" est tronqu<71>e <20> la valeur enti<74>re. Cette instruction doit <20>tre",
|
|||
|
" compl<70>tement <20> droite dans une s<>quence.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> COMPARER [var ==] [var >] [1 >=]",
|
|||
|
" -[ var2 ]- -[ 1 ]- -[ Ton]-",
|
|||
|
"",
|
|||
|
"> [var /=] [-4 < ] [1 <=]",
|
|||
|
" -[ var2 ]- -[ vartwo]- -[ Cup]-",
|
|||
|
"",
|
|||
|
" Si l'entr<74>e de cette instruction est fausse alors la sortie est",
|
|||
|
" fausse. Si l'entr<74>e est vraie, alors la sortie sera vraie si et",
|
|||
|
" uniquement si la condition de sortie est vraie. Cette instruction",
|
|||
|
" est utilis<69>e pour comparer (Egalit<69>, plus grand que,plus grand ou",
|
|||
|
" <20>gal <20>, in<69>gal, plus petit que, plus petit ou <20>gal <20>) une variable <20>",
|
|||
|
" une autre variable, ou pour comparer une variable avec une constante",
|
|||
|
" 16 bits sign<67>e.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> COMPTEUR DECOMPTEUR Cnom Cnom",
|
|||
|
" --[CTU >=5]-- --[CTD >=5]--",
|
|||
|
"",
|
|||
|
" Un compteur incr<63>mente ( Compteur CTU, count up) ou d<>cr<63>mente",
|
|||
|
" (D<>compteur CTD, count down) une variable <20> chaque front montant de",
|
|||
|
" la ligne en condition d'entr<74>e (CAD quand la signal passe de l'<27>tat",
|
|||
|
" 0 <20> l'<27>tat 1. La condition de sortie du compteur est vraie si la",
|
|||
|
" variable du compteur est <20>gale ou plus grande que 5 (dans l'exemple),",
|
|||
|
" et faux sinon. La condition de sortie de la ligne peut <20>tre vraie,",
|
|||
|
" m<>me si la condition d'entr<74>e est fausse, cela d<>pend uniquement de la",
|
|||
|
" valeur de la variable du compteur. Vous pouvez avoir un compteur ou",
|
|||
|
" un d<>compteur avec le m<>me nom, qui vont incr<63>m<EFBFBD>nter ou decr<63>menter",
|
|||
|
" une variable. L'instruction Remise <20> Z<>ro permet de resetter un",
|
|||
|
" compteur (remettre <20> z<>ro), il est possible de modifier par des",
|
|||
|
" op<6F>rations les variables des compteurs d<>compteurs.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> COMPTEUR CYCLIQUE Cnom",
|
|||
|
" --{CTC 0:7}--",
|
|||
|
"",
|
|||
|
" Un compteur cyclique fonctionne comme un compteur normal",
|
|||
|
" CTU, exception faite, lorsque le compteur arrive <20> sa",
|
|||
|
" limite sup<75>rieure, la variable du compteur revient <20> 0. dans",
|
|||
|
" l'exemple la valeur du compteur <20>volue de la fa<66>on suivante :",
|
|||
|
" 0,1,2,4,5,6,7,0,1,2,3,4,5,6,7,0,1,3,4,5,etc. Ceci est tr<74>s pratique",
|
|||
|
" en conbinaison avec des intructions conditionnelles sur la variable",
|
|||
|
" Cnom. On peut utiliser ceci comme un s<>quenceur, l'horloge du compteur",
|
|||
|
" CTC est valid<69>e par la condition d'entr<74>e associ<63>e <20> une instruction",
|
|||
|
" de front montant.",
|
|||
|
" Cette instruction doit <20>tre compl<70>tement <20> droite dans une s<>quence.",
|
|||
|
" ",
|
|||
|
"",
|
|||
|
"> REGISTRE A DECALAGE {SHIFT REG }",
|
|||
|
" -{ reg0..3 }-",
|
|||
|
"",
|
|||
|
" Un registre <20> d<>calage est associ<63> avec un jeu de variables. Le",
|
|||
|
" registre <20> d<>calage de l'exemple donn<6E> est associ<63> avec les",
|
|||
|
" variables`reg0', `reg1', `reg2', and `reg3'. L'entr<74>e du registre <20>",
|
|||
|
" d<>calage est `reg0'. A chaque front montant de la condition d'entr<74>e",
|
|||
|
" de la ligne, le registre <20> d<>calage va d<>caler d'une position <20>",
|
|||
|
" droite. Ce qui donne `reg3 := reg2', `reg2 := reg1'. et `reg1 :=",
|
|||
|
" reg0'.`reg0' est <20> gauche sans changement. Un registre <20> d<>calage",
|
|||
|
" de plusieurs <20>l<EFBFBD>ments peut consommer beaucoup de place en m<>moire.",
|
|||
|
" Cette instruction doit <20>tre compl<70>tement <20> droite dans une s<>quence.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> TABLEAU INDEXE {dest := }",
|
|||
|
" -{ LUT[i] }-",
|
|||
|
"",
|
|||
|
" Un tableau index<65> et un groupe ordonn<6E> de n valeurs Quand la condition",
|
|||
|
" d'entr<74>e est vraie, la variable enti<74>re `dest' est mise <20> la valeur",
|
|||
|
" correspondand <20> l'index i du tableau. L'index est compris entre 0 et",
|
|||
|
" (n-1). Le comportement de cette instruction est ind<6E>fini si l'index",
|
|||
|
" est en dehors du tableau",
|
|||
|
" Cette instruction doit <20>tre compl<70>tement <20> droite dans une s<>quence.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> TABLEAU ELEMENTS LINEAIRES {yvar := }",
|
|||
|
" -{ PWL[xvar] }-",
|
|||
|
"",
|
|||
|
" C'est une bonne m<>thode pour <20>valuer de fa<66>on approximative une",
|
|||
|
" fonction compliqu<71>e ou une courbe. Tr<54>s pratique par exemple pour",
|
|||
|
" appliquer une courbe de calibration pour lin<69>ariser tension de sortie",
|
|||
|
" d'un capteur dans une unit<69> convenable.",
|
|||
|
"",
|
|||
|
" Supposez que vous essayez de faire une fonction pour convertir une",
|
|||
|
" variable d'entr<74>e enti<74>re, x, en une variable de sortie enti<74>re, y,",
|
|||
|
" vous connaissez la fonction en diff<66>rents points, par exemple vous",
|
|||
|
" connaissez :",
|
|||
|
"",
|
|||
|
" f(0) = 2",
|
|||
|
" f(5) = 10",
|
|||
|
" f(10) = 50",
|
|||
|
" f(100) = 100",
|
|||
|
"",
|
|||
|
" Ceci donne les points",
|
|||
|
"",
|
|||
|
" (x0, y0) = ( 0, 2)",
|
|||
|
" (x1, y1) = ( 5, 10)",
|
|||
|
" (x2, y2) = ( 10, 50)",
|
|||
|
" (x3, y3) = (100, 100)",
|
|||
|
"",
|
|||
|
" li<6C>s <20> cette courbe. Vous pouvez entrer ces 4 points dans un",
|
|||
|
" tableau associ<63> <20> l'instruction tableau d'<27>l<EFBFBD>ments lin<69>aires. Cette",
|
|||
|
" instruction regarde la valeur de xvar et fixe la valeur de yvar",
|
|||
|
" correspondante. Par exemple si vous mettez xvar = 10 , l'instruction",
|
|||
|
" validera yvar = 50.",
|
|||
|
"",
|
|||
|
" Si vous mettez une instruction avec une valeur xvar entre deux valeurs",
|
|||
|
" de x du tableau (et par cons<6E>quence aussi de yvar). Une moyenne",
|
|||
|
" proportionnelle entre les deux valeurs , pr<70>c<EFBFBD>dente et suivante de",
|
|||
|
" xvar et de la valeur li<6C>e yvar, est effectu<74>e. Par exemple xvar =",
|
|||
|
" 55 donne en sortie yvar = 75 Les deux points xvar (10.50) et yvar",
|
|||
|
" (50,75) , 55 est la moyenne entre 10 et 100 et 75 est la moyenne",
|
|||
|
" entre 50 et 100, donc (55,75) sont li<6C>s ensemble par une ligne de",
|
|||
|
" connection qui connecte ces deux points.",
|
|||
|
"",
|
|||
|
" Ces points doivent <20>tre sp<73>cifi<66>s dans l'ordre ascendant des",
|
|||
|
" coordonn<6E>es x. Il peut <20>tre impossible de faire certaines op<6F>rations",
|
|||
|
" math<74>matiques n<>cessaires pour certains tableaux, utilisant des",
|
|||
|
" entiers 16 bits. Dans ce LDmicro va provoquer une alarme. Ce tableau",
|
|||
|
" va provoquer une erreur :",
|
|||
|
"",
|
|||
|
" (x0, y0) = ( 0, 0)",
|
|||
|
" (x1, y1) = (300, 300)",
|
|||
|
"",
|
|||
|
" Vous pouvez supprimer ces erreurs en diminuant l'<27>cart entre les",
|
|||
|
" points du tableau, par exemple ce tableau est <20>quivalent <20> celui ci",
|
|||
|
" dessus , mais ne provoque pas d'erreur:",
|
|||
|
"",
|
|||
|
" (x0, y0) = ( 0, 0)",
|
|||
|
" (x1, y1) = (150, 150)",
|
|||
|
" (x2, y2) = (300, 300)",
|
|||
|
"",
|
|||
|
" Il n'est pratiquement jamais n<>cessaire d'utiliser plus de 5 ou",
|
|||
|
" 6 points. Ajouter des points augmente la taille du code et diminue",
|
|||
|
" sa vitesse d'ex<65>cution. Le comportement, si vous passez une valeur",
|
|||
|
" <20> xvar plus grande que la plus grande valeur du tableau , ou plus",
|
|||
|
" petit que la plus petite valeur, est ind<6E>fini.",
|
|||
|
" Cette instruction doit <20>tre compl<70>tement <20> droite dans une s<>quence.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> LECTURE CONVERTISSEUR A/D Anom",
|
|||
|
" --{READ ADC}--",
|
|||
|
"",
|
|||
|
" LDmicro peut g<>n<EFBFBD>rer du code pour utiliser les convertisseurs A/D",
|
|||
|
" contenus dans certains microcontroleurs. Si la condition d'entr<74>e",
|
|||
|
" de l'instruction est vraie, alors une acquisition du convertisseur",
|
|||
|
" A/D est <20>ffectu<74>e et stock<63>e dans la variable Anom. Cette variable",
|
|||
|
" peut <20>tre par la suite trait<69>e comme les autres variables par les",
|
|||
|
" diff<66>rentes op<6F>rations arithm<68>tiques ou autres. Vous devez affecter",
|
|||
|
" une broche du micro <20> la variable Anom de la m<>me fa<66>on que pour",
|
|||
|
" les entr<74>es et sorties digitales par un double clic dans la list",
|
|||
|
" affich<63>e au bas de l'<27>cran. Si la condition d'entr<74>e de la s<>quence",
|
|||
|
" est fausse la variable Anom reste inchang<6E>e.",
|
|||
|
"",
|
|||
|
" Pour tous les circuits support<72>s actuellement, 0 volt en entr<74>e",
|
|||
|
" correspond <20> une lecture ADC de 0, et une valeur <20>gale <20> VDD (la",
|
|||
|
" tension d'alimentation ) correspond <20> une lecture ADC de 1023. Si",
|
|||
|
" vous utilisez un circuit AVR, vous devez connecter Aref <20> VDD.",
|
|||
|
"",
|
|||
|
" Vous pouvez utiliser les op<6F>rations arithm<68>tiques pour mettre <20> ",
|
|||
|
" l'<27>chelle les lectures effectu<74>es dans l'unit<69> qui vous est la plus ",
|
|||
|
" appropri<72>e. Mais souvenez vous que tous les calculs sont faits en ",
|
|||
|
" utilisant les entiers.",
|
|||
|
"",
|
|||
|
" En g<>n<EFBFBD>ral, toutes les broches ne sont pas utilisables pour les ",
|
|||
|
" lecture de convertisseur A/D. Le logiciel ne vous permet pas ",
|
|||
|
" d'affecter une broche non A/D pour une entr<74>e convertisseur.",
|
|||
|
" Cette instruction doit <20>tre compl<70>tement <20> droite dans une s<>quence.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> FIXER RAPPORT CYCLE PWM duty_cycle",
|
|||
|
" -{PWM 32.8 kHz}-",
|
|||
|
"",
|
|||
|
" LDmicro peut g<>n<EFBFBD>rer du code pour utiliser les p<>riph<70>riques PWM",
|
|||
|
" contenus dans certains microcontroleurs. Si la condition d'entr<74>e",
|
|||
|
" de cette instruction est vraie, le rapport de cycle du p<>riph<70>rique",
|
|||
|
" PWM va <20>tre fix<69> <20> la valeur de la variable Rapport de cycle PWM.",
|
|||
|
" Le rapport de cycle est un nombre compris entre 0 (toujours au",
|
|||
|
" niveau bas) et 100 (toujours au niveau haut). Si vous connaissez la",
|
|||
|
" mani<6E>re dont les p<>riph<70>riques fonctionnent vous noterez que LDmicro",
|
|||
|
" met automatiquement <20> l'<27>chelle la variable du rapport de cycle en",
|
|||
|
" pourcentage de la p<>riode d'horloge PWM.",
|
|||
|
"",
|
|||
|
" Vous pouvez sp<73>cifier la fr<66>quence de sortie PWM, en Hertz. Le",
|
|||
|
" fr<66>quence que vous sp<73>cifiez peut ne pas <20>tre exactement accomplie, en",
|
|||
|
" fonction des divisions de la fr<66>quence d'horloge du microcontroleur,",
|
|||
|
" LDmicro va choisir une fr<66>quence approch<63>e. Si l'erreur est trop",
|
|||
|
" importante, il vous avertit.Les vitesses rapides sont au d<>triment",
|
|||
|
" de la r<>solution. Cette instruction doit <20>tre compl<70>tement <20> droite",
|
|||
|
" dans une s<>quence.",
|
|||
|
"",
|
|||
|
" Le runtime du language <20> contacts consomme un timers (du micro) pour",
|
|||
|
" le temps de cycle, ce qui fait que le PWM est uniquement possible",
|
|||
|
" avec des microcontroleurs ayant au moins deux timers utilisables.",
|
|||
|
" PWM utilise CCP2 (pas CCP1) sur les PIC16F et OC2(pas OC1) sur les",
|
|||
|
" Atmel AVR.",
|
|||
|
"",
|
|||
|
"> METTRE PERSISTANT saved_var",
|
|||
|
" --{PERSIST}--",
|
|||
|
"",
|
|||
|
" Quand la condition d'entr<74>e de cette instruction est vraie, la",
|
|||
|
" variable enti<74>re sp<73>cifi<66>e va <20>tre automatiquement sauvegard<72>e en",
|
|||
|
" EEPROM, ce qui fait que cette valeur persiste m<>me apr<70>s une coupure",
|
|||
|
" de l'alimentation du micro. Il n'y a pas <20> sp<73>cifier ou elle doit",
|
|||
|
" <20>tre sauvegard<72>e en EEPROM, ceci est fait automatiquement, jusqu'a",
|
|||
|
" ce quelle change <20> nouveau. La variable est automatiquement charg<72>e",
|
|||
|
" <20> partir de l'EEPROM suite <20> un reset <20> la mise sous tension.",
|
|||
|
"",
|
|||
|
" Si une variables, mise persistante, change fr<66>quemment, l'EEPROM de",
|
|||
|
" votre micro peut <20>tre d<>truite tr<74>s rapidement, Le nombre de cycles",
|
|||
|
" d'<27>criture dans l'EEPROM est limit<69> <20> environ 100 000 cycles Quand",
|
|||
|
" la condition est fausse, rien n'apparait. Cette instruction doit",
|
|||
|
" <20>tre compl<70>tement <20> droite dans une s<>quence.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> RECEPTION UART (SERIE) var",
|
|||
|
" --{UART RECV}--",
|
|||
|
"",
|
|||
|
" LDmicro peut g<>n<EFBFBD>rer du code pour utiliser l'UART, existant dans",
|
|||
|
" certains microcontroleurs. Sur les AVR, avec de multiples UART,",
|
|||
|
" uniquement l'UART1 est utilisable (pas l'UART0). Configurer la",
|
|||
|
" vitesse en utilisant -> Param<61>tres -> Param<61>tres MCU. Toutes les",
|
|||
|
" vitesses de liaison ne sont pas utilisables avec tous les quartz de",
|
|||
|
" toutyes les fr<66>quences. Ldmicro vous avertit dans ce cas.",
|
|||
|
"",
|
|||
|
" Si la condition d'entr<74>e de cette instruction est fausse, rien ne se",
|
|||
|
" passe. Si la condition d'entr<74>e est vraie, elle essaie de recevoir",
|
|||
|
" un caract<63>re en provenance de l'UART. Si aucun caract<63>re n'est lu",
|
|||
|
" alors la condition de sortie devient fausse. Si un caract<63>re est",
|
|||
|
" lu la valeur ASCII est stock<63>e dans 'var' et la condition de sortie",
|
|||
|
" est vraie pour un seul cycle API.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> EMMISION UART (SERIE) var",
|
|||
|
" --{UART SEND}--",
|
|||
|
"",
|
|||
|
" LDmicro peut g<>n<EFBFBD>rer du code pour utiliser l'UART, existant dans ",
|
|||
|
" certains microcontroleurs. Sur les AVR, avec de multiples UART, ",
|
|||
|
" uniquement l'UART1 est utilisable (pas l'UART0). Configurer la ",
|
|||
|
" vitesse en utilisant -> Param<61>tres -> Param<61>tres MCU. Toutes les ",
|
|||
|
" vitesses de liaison ne sont pas utilisables avec tous les quartz ",
|
|||
|
" de toutyes les fr<66>quences. Ldmicro vous avertit dans ce cas.",
|
|||
|
"",
|
|||
|
" Si la condition d'entr<74>e de cette instruction est fausse, rien ne",
|
|||
|
" se passe. Si la condition d'entr<74>e est vraie alors cette instruction",
|
|||
|
" <20>crit un seul caract<63>re vers l'UART. La valeur ASCII du caract<63>re <20>",
|
|||
|
" transmettre doit avoir <20>t<EFBFBD> stock<63> dans 'var' par avance. La condition",
|
|||
|
" de sortie de la s<>quence est vraie, si l'UART est occup<75>e (en cours",
|
|||
|
" de transmission d'un caract<63>re), et fausse sinon.",
|
|||
|
"",
|
|||
|
" Rappelez vous que les caract<63>res mettent un certain temps pour <20>tre",
|
|||
|
" transmis. V<>rifiez la condition de sortie de cette instruction pour",
|
|||
|
" vous assurer que le premier caract<63>re <20> bien <20>t<EFBFBD> transmis, avant",
|
|||
|
" d'essayer d'envoyer un second caract<63>re, ou utiliser une temporisation",
|
|||
|
" pour ins<6E>rer un d<>lai entre caract<63>res; Vous devez uniquement v<>rifier",
|
|||
|
" que la condition d'entr<74>e est vraie (essayez de transmettre un",
|
|||
|
" caract<63>re) quand la condition de sortie est fausse(UART non occupp<70>e).",
|
|||
|
"",
|
|||
|
" Regardez l'instruction Chaine formatt<74>e(juste apr<70>s) avant d'utiliser",
|
|||
|
" cette instruction, elle est plus simple <20> utiliser, et dans la",
|
|||
|
" majorit<69> des cas, est capable de faire ce dont on a besoin.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> CHAINE FORMATTEE SUR UART var",
|
|||
|
" -{\"Pression: \\3\\r\\n\"}-",
|
|||
|
"",
|
|||
|
" LDmicro peut g<>n<EFBFBD>rer du code pour utiliser l'UART, existant dans ",
|
|||
|
" certains microcontroleurs. Sur les AVR, avec de multiples UART, ",
|
|||
|
" uniquement l'UART1 est utilisable (pas l'UART0). Configurer la ",
|
|||
|
" vitesse en utilisant -> Param<61>tres -> Param<61>tres MCU. Toutes les ",
|
|||
|
" vitesses de liaison ne sont pas utilisables avec tous les quartz ",
|
|||
|
" de toutyes les fr<66>quences. Ldmicro vous avertit dans ce cas.",
|
|||
|
"",
|
|||
|
" Quand la condition d'entr<74>e de cette instruction passe de faux <20> vrai,",
|
|||
|
" elle commence <20> envoyer une chaine compl<70>te vers le port s<>rie. Si",
|
|||
|
" la chaine comporte la s<>quence sp<73>ciale '3', alors cette s<>quence",
|
|||
|
" va <20>tre remplac<61>e par la valeur de 'var', qui est automatiquement",
|
|||
|
" converti en une chaine. La variable va <20>tre formatt<74>e pour prendre",
|
|||
|
" exactement trois caract<63>res; par exemple si var = 35, la chaine",
|
|||
|
" exacte qui va <20>tre \"imprim<EFBFBD>e\" sera 'Pression: 35\\r\\n' (notez les",
|
|||
|
" espaces suppl<70>mentaires). Si au lieu de cela var = 1432 , la sortie",
|
|||
|
" est ind<6E>finie parceque 1432 comporte plus de 3 digits. Dans ce cas",
|
|||
|
" vous devez n<>cessairement utiliser '\\4' <20> la place.",
|
|||
|
"",
|
|||
|
" Si la variable peut <20>tre n<>gative, alors utilisez '\\-3d' (ou `\\-4d'",
|
|||
|
" etc.) <20> la place. Ceci oblige LDmicro <20> imprimer un espace d'ent<6E>te",
|
|||
|
" pour les nombres positifs et un signe moins d'ent<6E>te pour les chiffres",
|
|||
|
" n<>gatifs.",
|
|||
|
"",
|
|||
|
" Si de multiples instructions de chaines formatt<74>es sont activ<69>es au",
|
|||
|
" m<>me moment (ou si une est activ<69>e avant de finir la pr<70>c<EFBFBD>dente)",
|
|||
|
" ou si ces instructions sont imbriqu<71>es avec des instructions TX",
|
|||
|
" (transmission), le comportement est ind<6E>fini.",
|
|||
|
"",
|
|||
|
" Il est aussi possible d'utiliser cette instruction pour sortie une",
|
|||
|
" chaine fixe, sans l'intervention d'une variable en valeur enti<74>re",
|
|||
|
" dans le texte qui est envoy<6F>e sur la ligne s<>rie. Dans ce cas,",
|
|||
|
" simplement ne pas inclure de s<>quence sp<73>ciale Escape.",
|
|||
|
"",
|
|||
|
" Utiliser `\\\\' pour l'anti-slash. en addition <20> une s<>quence escape ",
|
|||
|
" pour intervenir sue une variables enti<74>re, les caract<63>res de ",
|
|||
|
" contr<74>les suivants sont utilisables :",
|
|||
|
" ",
|
|||
|
" * \\r -- retour en d<>but de ligne",
|
|||
|
" * \\n -- nouvelle ligne",
|
|||
|
" * \\f -- saut de page",
|
|||
|
" * \\b -- retour arri<72>re",
|
|||
|
" * \\xAB -- caract<63>re avec valeur ASCII 0xAB (hex)",
|
|||
|
"",
|
|||
|
" La condition de sortie de cette instruction est vraie quand elle",
|
|||
|
" transmet des donn<6E>es, sinon elle est fausse. Cette instruction",
|
|||
|
" consomme une grande quantit<69> de m<>moire, elle doit <20>tre utilis<69>e",
|
|||
|
" avec mod<6F>ration. L'impl<70>mentation pr<70>sente n'est pas efficace, mais",
|
|||
|
" une meilleure impl<70>mentation demanderait une modification de tout",
|
|||
|
" le reste.",
|
|||
|
"",
|
|||
|
"NOTE CONCERNANT LES MATHS",
|
|||
|
"=========================",
|
|||
|
"",
|
|||
|
"Souvenez vous que LDmicro travaille uniquement en math<74>matiques entiers",
|
|||
|
"16 bits. Ce qui fait que le r<>sultat final de m<>me que tous les calculs",
|
|||
|
"m<EFBFBD>mes interm<72>diaires seront compris entre -32768 et 32767.",
|
|||
|
"",
|
|||
|
"Par exemple, si vous voulez calculer y = (1/x)*1200,ou x est compris",
|
|||
|
"entre 1 et 20, ce qui donne un r<>sultat entre 1200 et 60,le r<>sultat est",
|
|||
|
"bien <20> l'int<6E>rieur d'un entier 16 bits, il doit donc <20>tre th<74>oriquement",
|
|||
|
"possible de faire le calcul. Nous pouvons faire le calcul de deux fa<66>ons",
|
|||
|
"d'abord faire 1/x et ensuite la multiplication:",
|
|||
|
"",
|
|||
|
" || {DIV temp :=} ||",
|
|||
|
" ||---------{ 1 / x }----------||",
|
|||
|
" || ||",
|
|||
|
" || {MUL y := } ||",
|
|||
|
" ||----------{ temp * 1200}----------||",
|
|||
|
" || ||",
|
|||
|
"",
|
|||
|
"Ou uniquement faire simplement la division en une seule ligne :",
|
|||
|
"",
|
|||
|
" || {DIV y :=} ||",
|
|||
|
" ||-----------{ 1200 / x }-----------||",
|
|||
|
"",
|
|||
|
"Math<EFBFBD>matiquement c'est identique, la premi<6D>re donne y = 0 , c'est <20> dire",
|
|||
|
"une mauvais r<>sultat, si nous prenons par exemple x = 3 , 1/x = 0.333 mais",
|
|||
|
"comme il s'agit d'un entier, la valeur pour Temp est de 0 et 0*1200 = 0 ",
|
|||
|
"donc r<>sultat faux.Dans le deuxi<78>me cas, il n'y a pas de r<>sultat ",
|
|||
|
"interm<EFBFBD>diaire et le r<>sultat est correct dans tous les cas.",
|
|||
|
"",
|
|||
|
"Si vous trouvez un probl<62>me avec vos calculs math<74>matiques, v<>rifiez les",
|
|||
|
"r<EFBFBD>sultats interm<72>diaires, si il n'y a pas de d<>passement de capacit<69>s par",
|
|||
|
"rapports aux valeurs enti<74>res. (par exemple 32767 + 1 = -32768). Quand",
|
|||
|
"cela est possible essayer de choisir des valeurs entre -100 et 100.",
|
|||
|
"",
|
|||
|
"Vous pouvez utiliser un certain facteur de multiplication ou division pour ",
|
|||
|
"mettre <20> l'echelle les variables lors de calculs par exemple : pour mettre",
|
|||
|
"mettre <20> l'echelle y = 1.8*x , il est possible de faire y =(9/5)*x ",
|
|||
|
"(9/5 = 1.8) et coder ainsi y = (9*x)/5 en faisant d'abord la multiplication",
|
|||
|
"",
|
|||
|
" || {MUL temp :=} ||",
|
|||
|
" ||---------{ x * 9 }----------||",
|
|||
|
" || ||",
|
|||
|
" || {DIV y :=} ||",
|
|||
|
" ||-----------{ temp / 5 }-----------||",
|
|||
|
"",
|
|||
|
"Ceci fonctionne tant que x < (32767 / 9), or x < 3640. Pour les grandes ",
|
|||
|
"valeurs de x,la variable `temp' va se mettre en d<>passement. Ceci est ",
|
|||
|
"similaire vers la limite basse de x.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"STYLE DE CODIFICATION",
|
|||
|
"=====================",
|
|||
|
"",
|
|||
|
"Il est permis d'avoir plusieurs bobines en parall<6C>le, contr<74>l<EFBFBD>es par",
|
|||
|
"une simple ligne comme ci-dessous :",
|
|||
|
"",
|
|||
|
" || Xa Ya ||",
|
|||
|
" 1 ||-------] [--------------( )-------||",
|
|||
|
" || ||",
|
|||
|
" || Xb Yb ||",
|
|||
|
" ||-------] [------+-------( )-------||",
|
|||
|
" || | ||",
|
|||
|
" || | Yc ||",
|
|||
|
" || +-------( )-------||",
|
|||
|
" || ||",
|
|||
|
"",
|
|||
|
"<EFBFBD> la place de ceci :",
|
|||
|
"",
|
|||
|
" || Xa Ya ||",
|
|||
|
" 1 ||-------] [--------------( )-------||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || Xb Yb ||",
|
|||
|
" 2 ||-------] [--------------( )-------||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || Xb Yc ||",
|
|||
|
" 3 ||-------] [--------------( )-------||",
|
|||
|
" || ||",
|
|||
|
"",
|
|||
|
"Il est permis th<74>oriquement d'<27>crire un programme avec une s<>quence tr<74>s",
|
|||
|
"importante et de ne pas utiliser plusieurs lignes pour la faire. En",
|
|||
|
"pratique c'est une mauvaise id<69>e, <20> cause de la compl<70>xit<69> que cela",
|
|||
|
"peut engendrer et plus difficile <20> <20>diter sans effacer et redessiner un",
|
|||
|
"certain nombre d'<27>l<EFBFBD>ments de logique.",
|
|||
|
"",
|
|||
|
"N<EFBFBD>anmoins, c'est une bonne id<69>e de regrouper diff<66>rents <20>l<EFBFBD>ments d'un bloc",
|
|||
|
"logique dans une seule s<>quence. Le code g<>n<EFBFBD>r<EFBFBD> est identique dans les",
|
|||
|
"deux cas, et vous pouvez voir ce que fait la s<>quence dans le diagramme",
|
|||
|
"<EFBFBD> contacts.",
|
|||
|
"",
|
|||
|
" * * *",
|
|||
|
"",
|
|||
|
"En g<>n<EFBFBD>ral, il est consid<69>r<EFBFBD> comme mauvais d'<27>crire du code dont la",
|
|||
|
"sortie d<>pend de l'ordre d'ex<65>cution. Exemple : ce code n'est pas tr<74>s",
|
|||
|
"bon lorsque xa et xb sont vrai en m<>me temps :",
|
|||
|
"",
|
|||
|
" || Xa {v := } ||",
|
|||
|
" 1 ||-------] [--------{ 12 MOV}--||",
|
|||
|
" || ||",
|
|||
|
" || Xb {v := } ||",
|
|||
|
" ||-------] [--------{ 23 MOV}--||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || [v >] Yc ||",
|
|||
|
" 2 ||------[ 15]-------------( )-------||",
|
|||
|
" || ||",
|
|||
|
"",
|
|||
|
"Ci-dessous un exemple pour convertir 4 bits Xb3:0 en un entier :",
|
|||
|
"",
|
|||
|
" || {v := } ||",
|
|||
|
" 3 ||-----------------------------------{ 0 MOV}--||",
|
|||
|
" || ||",
|
|||
|
" || Xb0 {ADD v :=} ||",
|
|||
|
" ||-------] [------------------{ v + 1 }-----------||",
|
|||
|
" || ||",
|
|||
|
" || Xb1 {ADD v :=} ||",
|
|||
|
" ||-------] [------------------{ v + 2 }-----------||",
|
|||
|
" || ||",
|
|||
|
" || Xb2 {ADD v :=} ||",
|
|||
|
" ||-------] [------------------{ v + 4 }-----------||",
|
|||
|
" || ||",
|
|||
|
" || Xb3 {ADD v :=} ||",
|
|||
|
" ||-------] [------------------{ v + 8 }-----------||",
|
|||
|
" || ||",
|
|||
|
"",
|
|||
|
"Si l'instruction MOV est d<>plac<61>e en dessous des instructions ADD, la",
|
|||
|
"valeur de la variable v, quand elle est lue autrepart dans le programme,",
|
|||
|
"serait toujours 0. La sortie du code d<>pend alors de l'ordre d'<27>valuations",
|
|||
|
"des instructions. Ce serait possible de modifier ce code pour <20>viter cela,",
|
|||
|
"mais le code deviendrait tr<74>s encombrant.",
|
|||
|
"",
|
|||
|
"DEFAUTS",
|
|||
|
"=======",
|
|||
|
"",
|
|||
|
"LDmicro ne g<>n<EFBFBD>re pas un code tr<74>s efficace; il est lent <20> ex<65>cuter et",
|
|||
|
"il est gourmand en Flash et RAM. Un PIC milieu de gamme ou un AVR peut",
|
|||
|
"tout de m<>me faire ce qu'un petit automate peut faire.",
|
|||
|
"",
|
|||
|
"La longueur maximum des noms de variables est tr<74>s limit<69>e, ceci pour",
|
|||
|
"<EFBFBD>tre int<6E>gr<67>e correctement dans le diagramme logique, je ne vois pas de",
|
|||
|
"solution satisfaisante pour solutionner ce probl<62>me.",
|
|||
|
"",
|
|||
|
"Si votre programme est trop important, vitesse ex<65>cution, m<>moire",
|
|||
|
"programme ou contraintes de m<>moire de donn<6E>es pour le processeur que vous",
|
|||
|
"avez choisi, il n'indiquera probablement pas d'erreur. Il se blocquera",
|
|||
|
"simplement quelque part.",
|
|||
|
"",
|
|||
|
"Si vous <20>tes programmeur n<>gligent dans les sauvegardes et les",
|
|||
|
"chargements, il est possible qu'un crash se produise ou ex<65>cute un code",
|
|||
|
"arbitraire corrompu ou un mauvais fichier .ld .",
|
|||
|
"",
|
|||
|
"SVP, faire un rapport sur les bogues et les demandes de modifications.",
|
|||
|
"",
|
|||
|
"Thanks to:",
|
|||
|
" * Marcelo Solano, for reporting a UI bug under Win98",
|
|||
|
" * Serge V. Polubarjev, for not only noticing that RA3:0 on the",
|
|||
|
" PIC16F628 didn't work but also telling me how to fix it",
|
|||
|
" * Maxim Ibragimov, for reporting and diagnosing major problems",
|
|||
|
" with the till-then-untested ATmega16 and ATmega162 targets",
|
|||
|
" * Bill Kishonti, for reporting that the simulator crashed when the",
|
|||
|
" ladder logic program divided by zero",
|
|||
|
" * Mohamed Tayae, for reporting that persistent variables were broken",
|
|||
|
" on the PIC16F628",
|
|||
|
" * David Rothwell, for reporting several user interface bugs and a",
|
|||
|
" problem with the \"Export as Text\" function",
|
|||
|
"",
|
|||
|
"Particular thanks to Marcel Vaufleury, for this translation (of both",
|
|||
|
"the manual and the program's user interface) into French.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"COPYING, AND DISCLAIMER",
|
|||
|
"=======================",
|
|||
|
"",
|
|||
|
"DO NOT USE CODE GENERATED BY LDMICRO IN APPLICATIONS WHERE SOFTWARE",
|
|||
|
"FAILURE COULD RESULT IN DANGER TO HUMAN LIFE OR DAMAGE TO PROPERTY. THE",
|
|||
|
"AUTHOR ASSUMES NO LIABILITY FOR ANY DAMAGES RESULTING FROM THE OPERATION",
|
|||
|
"OF LDMICRO OR CODE GENERATED BY LDMICRO.",
|
|||
|
"",
|
|||
|
"This program is free software: you can redistribute it and/or modify it",
|
|||
|
"under the terms of the GNU General Public License as published by the",
|
|||
|
"Free Software Foundation, either version 3 of the License, or (at your",
|
|||
|
"option) any later version.",
|
|||
|
"",
|
|||
|
"This program is distributed in the hope that it will be useful, but",
|
|||
|
"WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY",
|
|||
|
"or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License",
|
|||
|
"for more details.",
|
|||
|
"",
|
|||
|
"You should have received a copy of the GNU General Public License along",
|
|||
|
"with this program. If not, see <http://www.gnu.org/licenses/>.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"Jonathan Westhues",
|
|||
|
"",
|
|||
|
"Rijswijk -- Dec 2004",
|
|||
|
"Waterloo ON -- Jun, Jul 2005",
|
|||
|
"Cambridge MA -- Sep, Dec 2005",
|
|||
|
" Feb, Mar 2006",
|
|||
|
"",
|
|||
|
"Email: user jwesthues, at host cq.cx",
|
|||
|
"",
|
|||
|
"",
|
|||
|
NULL
|
|||
|
};
|
|||
|
#endif
|
|||
|
|
|||
|
#ifdef LDLANG_TR
|
|||
|
char *HelpTextTr[] = {
|
|||
|
"",
|
|||
|
"KULLANIM K<>TAP<41>I<EFBFBD>I",
|
|||
|
"==================",
|
|||
|
"LDMicro desteklenen MicroChip PIC16 ve Atmel AVR mikrokontrolc<6C>ler i<>in ",
|
|||
|
"gerekli kodu <20>retir. Bu i<> i<>in kullan<61>labilecek de<64>i<EFBFBD>ik programlar vard<72>r.",
|
|||
|
"<EFBFBD>rne<EFBFBD>in BASIC, C, assembler gibi. Bu programlar kendi dillerinde yaz<61>lm<6C><6D>",
|
|||
|
"programlar<EFBFBD> i<>lemcilerde <20>al<61><6C>abilecek dosyalar haline getirirler.",
|
|||
|
"",
|
|||
|
"PLC'de kullan<61>lan dillerden biri ladder diyagram<61>d<EFBFBD>r. A<>a<EFBFBD><61>da LDMicro ile",
|
|||
|
"yaz<EFBFBD>lm<EFBFBD><EFBFBD> basit bir program g<>r<EFBFBD>lmektedir.",
|
|||
|
"",
|
|||
|
" || ||",
|
|||
|
" || Xbutton1 Tdon Rchatter Yred ||",
|
|||
|
" 1 ||-------]/[---------[TON 1.000 s]-+-------]/[--------------( )-------||",
|
|||
|
" || | ||",
|
|||
|
" || Xbutton2 Tdof | ||",
|
|||
|
" ||-------]/[---------[TOF 2.000 s]-+ ||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || Rchatter Ton Tnew Rchatter ||",
|
|||
|
" 2 ||-------]/[---------[TON 1.000 s]----[TOF 1.000 s]---------( )-------||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" ||------[END]---------------------------------------------------------||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
"",
|
|||
|
"(TON=turn-on gecikme; TOF-turn-off gecikme. --] [-- giri<72>ler, di<64>er bir ",
|
|||
|
"deyi<EFBFBD>le kontaklard<72>r. --( )-- ise <20><>k<EFBFBD><6B>lard<72>r. Bunlar bir r<>lenin bobini ",
|
|||
|
"gibi davran<61>rlar. Ladder diyagram<61> ile ilgili bol miktarda kaynak internet",
|
|||
|
"<EFBFBD>zerinde bulunmaktad<61>r. Burada LDMicro'ya has <20>zelliklerden bahsedece<63>iz.",
|
|||
|
"",
|
|||
|
"LDmicro ladder diyagram<61>n<EFBFBD> PIC16 veya AVR koduna <20>evirir. A<>a<EFBFBD><61>da desteklenen",
|
|||
|
"i<EFBFBD>lemcilerin listesi bulunmaktad<61>r:",
|
|||
|
" * PIC16F877",
|
|||
|
" * PIC16F628",
|
|||
|
" * PIC16F876 (denenmedi)",
|
|||
|
" * PIC16F88 (denenmedi)",
|
|||
|
" * PIC16F819 (denenmedi)",
|
|||
|
" * PIC16F887 (denenmedi)",
|
|||
|
" * PIC16F886 (denenmedi)",
|
|||
|
" * ATmega128",
|
|||
|
" * ATmega64",
|
|||
|
" * ATmega162 (denenmedi)",
|
|||
|
" * ATmega32 (denenmedi)",
|
|||
|
" * ATmega16 (denenmedi)",
|
|||
|
" * ATmega8 (denenmedi)",
|
|||
|
"",
|
|||
|
"Asl<EFBFBD>nda daha fazla PIC16 ve AVR i<>lemci desteklenebilir. Ancak test ettiklerim",
|
|||
|
"ve destekledi<64>ini d<><64><EFBFBD>nd<6E>klerimi yazd<7A>m. <20>rne<6E>in PIC16F648 ile PIC16F628 ",
|
|||
|
"aras<EFBFBD>nda fazla bir fark bulunmamaktad<61>r. E<>er bir i<>lemcinin desteklenmesini",
|
|||
|
"istiyorsan<EFBFBD>z ve bana bildirirseniz ilgilenirim.",
|
|||
|
"",
|
|||
|
"LDMicro ile ladder diyagram<61>n<EFBFBD> <20>izebilir, devrenizi denemek i<>in ger<65>ek zamanl<6E> ",
|
|||
|
"sim<EFBFBD>lasyon yapabilirsiniz. Program<61>n<EFBFBD>z<EFBFBD>n <20>al<61><6C>t<EFBFBD><74><EFBFBD>ndan eminseniz programdaki ",
|
|||
|
"giri<EFBFBD> ve <20><>k<EFBFBD><6B>lara mikrokontrol<6F>r<EFBFBD>n bacaklar<61>n<EFBFBD> atars<72>n<EFBFBD>z. <20><>lemci bacaklar<61> ",
|
|||
|
"belli olduktan sonra program<61>n<EFBFBD>z<EFBFBD> derleyebilirsiniz. Derleme sonucunda olu<6C>an",
|
|||
|
"dosya .hex dosyas<61>d<EFBFBD>r. Bu dosyay<61> PIC/AVR programlay<61>c<EFBFBD> ile i<>lemcinize kaydedersiniz.",
|
|||
|
"PIC/AVR ile u<>ra<72>anlar konuya yabanc<6E> de<64>ildir.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"LDMicro ticari PLC programlar<61> gibi tasarlanm<6E><6D>t<EFBFBD>r. Baz<61> eksiklikler vard<72>r. ",
|
|||
|
"Kitap<EFBFBD><EFBFBD><EFBFBD><EFBFBD> dikkatlice okuman<61>z<EFBFBD> tavsiye ederim. Kullan<61>m esnas<61>nda PLC ve ",
|
|||
|
"PIC/AVR hakk<6B>nda temel bilgilere sahip oldu<64>unuz d<><64><EFBFBD>n<EFBFBD>lm<6C><6D>t<EFBFBD>r.",
|
|||
|
"",
|
|||
|
"D<EFBFBD><EFBFBD>ER AMA<4D>LAR",
|
|||
|
"==================",
|
|||
|
"",
|
|||
|
"ANSI C kodunu olu<6C>turmak m<>mk<6D>nd<6E>r. C derleyicisi olan herhangi bir",
|
|||
|
"i<EFBFBD>lemci i<>in bu <20>zellikten faydalanabilirsiniz. Ancak <20>al<61><6C>t<EFBFBD>rmak i<>in ",
|
|||
|
"gerekli dosyalar<61> siz sa<73>lamal<61>s<EFBFBD>n<EFBFBD>z. Yani, LDMicro sadece PlcCycle()",
|
|||
|
"isimli fonksiyonu <20>retir. Her d<>ng<6E>de PlcCycle fonksiyonunu <20>a<EFBFBD><61>rmak, ve",
|
|||
|
"PlcCycle() fonksiyonunun <20>a<EFBFBD><61>rd<72><64><EFBFBD> dijital giri<72>i yazma/okuma vs gibi",
|
|||
|
"G/<2F> fonksiyonlar<61> sizin yapman<61>z gereken i<>lemlerdir.",
|
|||
|
"Olu<EFBFBD>turulan kodu incelerseniz faydal<61> olur.",
|
|||
|
"",
|
|||
|
"KOMUT SATIRI SE<53>ENEKLER<45>",
|
|||
|
"========================",
|
|||
|
"",
|
|||
|
"Normal <20>artlarda ldmicro.exe komut sat<61>r<EFBFBD>ndan se<73>enek almadan <20>al<61><6C><EFBFBD>r.",
|
|||
|
"LDMicro'ya komut sat<61>r<EFBFBD>ndan dosya ismi verebilirsiniz. <20>rne<6E>in;komut",
|
|||
|
"sat<EFBFBD>r<EFBFBD>ndan 'ldmicro.exe asd.ld' yazarsan<61>z bu dosya a<><61>lmaya <20>al<61><6C><EFBFBD>rl<72>r.",
|
|||
|
"Dosya varsa a<><61>l<EFBFBD>r. Yoksa hata mesaj<61> al<61>rs<72>n<EFBFBD>z. <20>sterseniz .ld uzant<6E>s<EFBFBD>n<EFBFBD>",
|
|||
|
"ldmicro.exe ile ili<6C>kilendirirseniz .ld uzant<6E>l<EFBFBD> bir dosyay<61> <20>ift t<>klatt<74><74><EFBFBD>n<EFBFBD>zda",
|
|||
|
"bu dosya otomatik olarak a<><61>l<EFBFBD>r. Bkz. Klas<61>r Se<53>enekleri (Windows).",
|
|||
|
"",
|
|||
|
"`ldmicro.exe /c src.ld dest.hex', <20>eklinde kullan<61>l<EFBFBD>rsa src.ld derlenir",
|
|||
|
"ve haz<61>rlanan derleme dest.hex dosyas<61>na kaydedilir. <20><>lem bitince LDMicro kapan<61>r.",
|
|||
|
"Olu<EFBFBD>abilecek t<>m mesajlar konsoldan g<>r<EFBFBD>n<EFBFBD>r.",
|
|||
|
"",
|
|||
|
"TEMEL B<>LG<4C>LER",
|
|||
|
"==============",
|
|||
|
"",
|
|||
|
"LDMicro a<><61>ld<6C><64><EFBFBD>nda bo<62> bir program ile ba<62>lar. Varolan bir dosya ile ba<62>lat<61>rsan<61>z",
|
|||
|
"bu program a<><61>l<EFBFBD>r. LDMicro kendi dosya bi<62>imini kulland<6E><64><EFBFBD>ndan di<64>er dosya",
|
|||
|
"bi<EFBFBD>imlerinden dosyalar<61> a<>amazs<7A>n<EFBFBD>z.",
|
|||
|
"",
|
|||
|
"Bo<EFBFBD> bir dosya ile ba<62>larsan<61>z ekranda bir tane bo<62> sat<61>r g<>r<EFBFBD>rs<72>n<EFBFBD>z. Bu sat<61>ra",
|
|||
|
"komutlar<EFBFBD> ekleyebilir, sat<61>r say<61>s<EFBFBD>n<EFBFBD> art<72>rabilirsiniz. Sat<61>rlara Rung denilir.",
|
|||
|
"<EFBFBD>rne<EFBFBD>in; Komutlar->Kontak Ekle diyerek bir kontak ekleyebilirsiniz. Bu konta<74>a",
|
|||
|
"'Xnew' ismi verilir. 'X' bu konta<74><61>n i<>lemcinin baca<63><61>na denk geldi<64>ini g<>sterir.",
|
|||
|
"Bu konta<74>a derlemeden <20>nce isim vermeli ve mikrokontrol<6F>r<EFBFBD>n bir baca<63><61> ile",
|
|||
|
"e<EFBFBD>le<EFBFBD>tirmelisiniz. E<>le<6C>tirme i<>lemi i<>inde <20>nce i<>lemciyi se<73>melisiniz.",
|
|||
|
"Elemanlar<EFBFBD>n ilk harfi o eleman<61>n ne oldu<64>u ile ilgilidir. <20>rnekler:",
|
|||
|
"",
|
|||
|
" * Xname -- mikrokontrol<6F>rdeki bir giri<72> baca<63><61>",
|
|||
|
" * Yname -- mikrokontrol<6F>rdeki bir <20><>k<EFBFBD><6B> baca<63><61>",
|
|||
|
" * Rname -- `dahili r<>le': haf<61>zada bir bit.",
|
|||
|
" * Tname -- zamanlay<61>c<EFBFBD>; turn-on, turn-off yada retentive ",
|
|||
|
" * Cname -- say<61>c<EFBFBD>, yukar<61> yada a<>a<EFBFBD><61> say<61>c<EFBFBD>",
|
|||
|
" * Aname -- A/D <20>eviriciden okunan bir tamsay<61> de<64>er",
|
|||
|
" * name -- genel de<64>i<EFBFBD>ken (tamsay<61>)",
|
|||
|
"",
|
|||
|
"<EFBFBD>stedi<EFBFBD>iniz ismi se<73>ebilirsiniz. Se<53>ilen bir isim nerede kullan<61>l<EFBFBD>rsa",
|
|||
|
"kullan<EFBFBD>ls<EFBFBD>n ayn<79> yere denk gelir. <20>rnekler; bir sat<61>rda Xasd kulland<6E><64><EFBFBD>n<EFBFBD>zda",
|
|||
|
"bir ba<62>ka sat<61>rda Xasd kullan<61>rsan<61>z ayn<79> de<64>ere sahiptirler. ",
|
|||
|
"Bazen bu mecburi olarak kullan<61>lmaktad<61>r. Ancak baz<61> durumlarda hatal<61> olabilir.",
|
|||
|
"Mesela bir (TON) Turn-On Gecikmeye Tgec ismini verdikten sonra bir (TOF)",
|
|||
|
"Turn_Off gecikme devresine de Tgec ismini verirseniz hata yapm<70><6D> olursunuz.",
|
|||
|
"Dikkat ederseniz yapt<70><74><EFBFBD>n<EFBFBD>z bir mant<6E>k hatas<61>d<EFBFBD>r. Her gecikme devresi kendi",
|
|||
|
"haf<EFBFBD>zas<EFBFBD>na sahip olmal<61>d<EFBFBD>r. Ama Tgec (TON) turn-on gecikme devresini s<>f<EFBFBD>rlamak",
|
|||
|
"i<EFBFBD>in kullan<61>lan RES komutunda Tgec ismini kullanmak gerekmektedir.",
|
|||
|
"",
|
|||
|
"De<EFBFBD>i<EFBFBD>ken isimleri harfleri, say<61>lar<61>, alt <20>izgileri ihtiva edebilir.",
|
|||
|
"(_). De<44>i<EFBFBD>ken isimleri say<61> ile ba<62>lamamal<61>d<EFBFBD>r. De<44>i<EFBFBD>ken isimleri b<>y<EFBFBD>k-k<><6B><EFBFBD>k harf duyarl<72>d<EFBFBD>r.",
|
|||
|
"<EFBFBD>rne<EFBFBD>in; TGec ve Tgec ayn<79> zamanlay<61>c<EFBFBD>lar de<64>ildir.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"Genel de<64>i<EFBFBD>kenlerle ilgili komutlar (MOV, ADD, EQU vs) herhangi bir",
|
|||
|
"isimdeki de<64>i<EFBFBD>kenlerle <20>al<61><6C><EFBFBD>r. Bunun anlam<61> bu komutlar zamanlay<61>c<EFBFBD>lar",
|
|||
|
"ve say<61>c<EFBFBD>larla <20>al<61><6C><EFBFBD>r. Zaman zaman bu faydal<61> olabilir. <20>rne<6E>in; bir ",
|
|||
|
"zamanlay<EFBFBD>c<EFBFBD>n<EFBFBD>n de<64>eri ile ilgili bir kar<61><72>la<6C>t<EFBFBD>rma yapabilirsiniz.",
|
|||
|
"",
|
|||
|
"De<EFBFBD>i<EFBFBD>kenler hr zaman i<>in 16 bit tamsay<61>d<EFBFBD>r. -32768 ile 32767 aras<61>nda",
|
|||
|
"bir de<64>ere sahip olabilirler. Her zaman i<>in i<>aretlidir. (+ ve - de<64>ere",
|
|||
|
"sahip olabilirler) Onluk say<61> sisteminde say<61> kullanabilirsiniz. T<>rnak",
|
|||
|
"aras<EFBFBD>na koyarak ('A', 'z' gibi) ASCII karakterler kullanabilirsiniz.",
|
|||
|
"",
|
|||
|
"Ekran<EFBFBD>n alt taraf<61>ndaki k<>s<EFBFBD>mda kullan<61>lan t<>m elemanlar<61>n bir listesi g<>r<EFBFBD>n<EFBFBD>r.",
|
|||
|
"Bu liste program taraf<61>ndan otomatik olarak olu<6C>turulur ve kendili<6C>inden",
|
|||
|
"g<EFBFBD>ncelle<EFBFBD>tirilir. Sadece 'Xname', 'Yname', 'Aname' elemanlar<61> i<>in",
|
|||
|
"mikrokontrol<EFBFBD>r<EFBFBD>n bacak numaralar<61> belirtilmelidir. <20>nce Ayarlar-><3E><>lemci Se<53>imi",
|
|||
|
"men<EFBFBD>s<EFBFBD>nden i<>lemciyi se<73>iniz. Daha sonra G/<2F> u<>lar<61>n<EFBFBD> <20>ift t<>klatarak a<><61>lan",
|
|||
|
"pencereden se<73>iminizi yap<61>n<EFBFBD>z.",
|
|||
|
"",
|
|||
|
"Komut ekleyerek veya <20><>kararak program<61>n<EFBFBD>z<EFBFBD> de<64>i<EFBFBD>tirebilirsiniz. Programdaki",
|
|||
|
"kurs<EFBFBD>r eleman eklenecek yeri veya hakk<6B>nda i<>lem yap<61>lacak eleman<61> g<>stermek",
|
|||
|
"amac<EFBFBD>yla yan<61>p s<>ner. Elemanlar aras<61>nda <Tab> tu<74>u ile gezinebilirsiniz. Yada",
|
|||
|
"eleman<EFBFBD> fare ile t<>klatarak i<>lem yap<61>lacak eleman<61> se<73>ebilirsiniz. Kurs<72>r eleman<61>n",
|
|||
|
"solunda, sa<73><61>nda, alt<6C>nda ve <20>st<73>nde olabilir. Solunda ve sa<73><61>nda oldu<64>unda",
|
|||
|
"ekleme yapt<70><74><EFBFBD>n<EFBFBD>zda eklenen eleman o tarafa eklenir. <20>st<73>nde ve alt<6C>nda iken",
|
|||
|
"eleman eklerseniz eklenen eleman se<73>ili elemana paralel olarak eklenir.",
|
|||
|
"Baz<EFBFBD> i<>lemleri yapamazs<7A>n<EFBFBD>z. <20>rne<6E>in bir bobinin sa<73><61>na eleman ekleyemezsiniz.",
|
|||
|
"LDMicro buna izin vermeyecektir.",
|
|||
|
"",
|
|||
|
"Program bo<62> bir sat<61>rla ba<62>lar. Kendiniz alta ve <20>ste sat<61>r ekleyerek diledi<64>iniz",
|
|||
|
"gibi diyagram<61>n<EFBFBD>z<EFBFBD> olu<6C>turabilirsiniz. Yukar<61>da bahsedildi<64>i gibi alt devreler",
|
|||
|
"olu<EFBFBD>turabilirsiniz.",
|
|||
|
"",
|
|||
|
"Program<EFBFBD>n<EFBFBD>z yazd<7A><64><EFBFBD>n<EFBFBD>zda sim<69>lasyon yapabilir, .hex dosyas<61>n<EFBFBD> olu<6C>turabilirsiniz.",
|
|||
|
"",
|
|||
|
"S<EFBFBD>M<EFBFBD>LASYON",
|
|||
|
"==========",
|
|||
|
"",
|
|||
|
"Sim<EFBFBD>lasyon moduna ge<67>mek i<>in Sim<69>lasyon->Sim<69>lasyon modu men<65>s<EFBFBD>n<EFBFBD> t<>klatabilir,",
|
|||
|
"yada <Ctrl+M> tu<74> kombinasyonuna basabilirsiniz. Sim<69>lasyon modunda program",
|
|||
|
"farkl<EFBFBD> bir g<>r<EFBFBD>nt<6E> al<61>r. Kurs<72>r g<>r<EFBFBD>nmez olur. Enerji alan yerler ve elemanlar",
|
|||
|
"parlak k<>rm<72>z<EFBFBD>, enerji almayan yerler ve elemanlar gri g<>r<EFBFBD>n<EFBFBD>r. Bo<42>luk tu<74>una",
|
|||
|
"basarak bir <20>evrim ilerleyebilir yada men<65>den Sim<69>lasyon->Ger<65>ek Zamanl<6E> Sim<69>lasyonu Ba<42>lat",
|
|||
|
"diyerek (veya <Ctrl+R>) devaml<6D> bir <20>evrim ba<62>latabilirsiniz. Ladder diyagram<61>n<EFBFBD>n",
|
|||
|
"<EFBFBD>al<EFBFBD><EFBFBD>mas<EFBFBD>na g<>re ger<65>ek zamanl<6E> olarak elemanlar ve yollar program taraf<61>ndan de<64>i<EFBFBD>tirilir.",
|
|||
|
"",
|
|||
|
"Giri<EFBFBD> elemanlar<61>n<EFBFBD>n durumunu <20>ift t<>klatarak de<64>i<EFBFBD>tirebilirsiniz. Mesela, 'Xname'",
|
|||
|
"konta<EFBFBD><EFBFBD>n<EFBFBD> <20>ift t<>klat<61>ran<61>z a<><61>ktan kapal<61>ya veya kapal<61>dan a<><61><EFBFBD>a ge<67>i<EFBFBD> yapar.",
|
|||
|
"",
|
|||
|
"DERLEME",
|
|||
|
"=======",
|
|||
|
"",
|
|||
|
"Ladder diyagram<61>n<EFBFBD>n yap<61>lmas<61>ndaki ama<6D> i<>lemciye y<>klenecek .hex dosyas<61>n<EFBFBD>n",
|
|||
|
"olu<EFBFBD>turulmas<EFBFBD>d<EFBFBD>r. Buna 'derleme' denir. Derlemeden <20>nce <20>u a<>amalar tamamlanmal<61>d<EFBFBD>r:",
|
|||
|
" 1- <20><>lemci se<73>ilmelidir. Ayarlar-><3E><>lemci Se<53>imi men<65>s<EFBFBD>nden yap<61>l<EFBFBD>r.",
|
|||
|
" 2- G/<2F> u<>lar<61>n<EFBFBD>n mikrokontrol<6F>rdeki hangi bacaklara ba<62>lanaca<63><61> se<73>ilmelidir.",
|
|||
|
" Eleman<61>n <20>zerine <20>ift t<>klan<61>r ve <20><>kan listeden se<73>im yap<61>l<EFBFBD>r.",
|
|||
|
" 3- <20>evrim s<>resi tan<61>mlanmal<61>d<EFBFBD>r. Ayarlar-><3E><>lemci Ayarlar<61> men<65>s<EFBFBD>nden yap<61>l<EFBFBD>r.",
|
|||
|
" Bu s<>re i<>lemcinin <20>al<61><6C>t<EFBFBD><74><EFBFBD> frekansa ba<62>l<EFBFBD>d<EFBFBD>r. <20>o<EFBFBD>u uygulamalar i<>in 10ms",
|
|||
|
" uygun bir se<73>imdir. Ayn<79> yerden kristal frekans<6E>n<EFBFBD> ayarlamay<61> unutmay<61>n<EFBFBD>z.",
|
|||
|
"",
|
|||
|
"Art<EFBFBD>k kodu <20>retebilirsiniz. Derle->Derle yada Derle->Farkl<6B> Derle se<73>eneklerinden",
|
|||
|
"birini kullanacaks<6B>n<EFBFBD>z. Aradaki fark Kaydet ve Farkl<6B> Kaydet ile ayn<79>d<EFBFBD>r. Sonu<6E>ta",
|
|||
|
"Intel IHEX dosyan<61>z program<61>n<EFBFBD>zda hata yoksa <20>retilecektir. Program<61>n<EFBFBD>zda hata varsa",
|
|||
|
"uyar<EFBFBD> al<61>rs<72>n<EFBFBD>z.",
|
|||
|
"",
|
|||
|
"Progamlay<EFBFBD>c<EFBFBD>n<EFBFBD>z ile bu dosyay<61> i<>lemcinize y<>klemelisiniz. Buradaki en <20>nemli nokta",
|
|||
|
"i<EFBFBD>lemcinin konfig<69>rasyon bitlerinin ayarlanmas<61>d<EFBFBD>r. PIC16 i<>lemciler i<>in gerekli ",
|
|||
|
"ayar bilgileri hex dosyas<61>na kaydedildi<64>inden programlay<61>c<EFBFBD>n<EFBFBD>z bu ayarlar<61> alg<6C>layacakt<6B>r.",
|
|||
|
"Ancak AVR i<>lemciler i<>in gerekli ayarlar<61> siz yapmal<61>s<EFBFBD>n<EFBFBD>z.",
|
|||
|
"",
|
|||
|
"KOMUTLAR ve ELEMANLAR",
|
|||
|
"=====================",
|
|||
|
"",
|
|||
|
"> KONTAK, NORMALDE A<>IK Xname Rname Yname",
|
|||
|
" ----] [---- ----] [---- ----] [----",
|
|||
|
"",
|
|||
|
" Normalde a<><61>k bir anahtar gibi davran<61>r. Komutu kontrol eden sinyal 0 ise ",
|
|||
|
" <09><>k<EFBFBD><6B><EFBFBD>ndaki sinyalde 0 olur. E<>er kontrol eden sinyal 1 olursa <20><>k<EFBFBD><6B><EFBFBD> da 1",
|
|||
|
" olur ve <20><>k<EFBFBD><6B>a ba<62>l<EFBFBD> bobin aktif olur. Bu kontak i<>lemci baca<63><61>ndan al<61>nan",
|
|||
|
" bir giri<72>, <20><>k<EFBFBD><6B> baca<63><61> yada dahili bir r<>le olabilir.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> KONTAK, NORMALDE KAPALI Xname Rname Yname",
|
|||
|
" ----]/[---- ----]/[---- ----]/[----",
|
|||
|
"",
|
|||
|
" Normalde kapal<61> bir anahtar gibi davran<61>r. Komutun kontrol eden sinyal 0 ise",
|
|||
|
" <09><>k<EFBFBD><6B><EFBFBD> 1 olur. E<>er kontrol eden sinyal 1 olursa <20><>k<EFBFBD><6B><EFBFBD> 0 olur ve <20><>k<EFBFBD><6B>a",
|
|||
|
" ba<62>l<EFBFBD> elemanlar pasif olur. Normalde <20><>k<EFBFBD><6B>a gerilim verilir, ancak bu konta<74><61> ",
|
|||
|
" kontrol eden sinyal 1 olursa konta<74><61>n <20><>k<EFBFBD><6B><EFBFBD>nda gerilim olmaz. Bu kontak ",
|
|||
|
" i<>lemci baca<63><61>ndan al<61>nan bir giri<72>, <20><>k<EFBFBD><6B> baca<63><61> yada dahili bir r<>le olabilir",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> BOB<4F>N, NORMAL Rname Yname",
|
|||
|
" ----( )---- ----( )----",
|
|||
|
"",
|
|||
|
" Elemana giren sinyal 0 ise dahili r<>le yada <20><>k<EFBFBD><6B> baca<63><61> 0 yap<61>l<EFBFBD>r.",
|
|||
|
" Elemana giren sinyal 1 ise dahili r<>le yada <20><>k<EFBFBD><6B> baca<63><61> 1 yap<61>l<EFBFBD>r.",
|
|||
|
" Bobine giri<72> de<64>i<EFBFBD>keni atamak mant<6E>ks<6B>zd<7A>r. Bu eleman bir sat<61>rda",
|
|||
|
" sa<73>daki en son eleman olmal<61>d<EFBFBD>r.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> BOB<4F>N, TERSLENM<4E><4D> Rname Yname",
|
|||
|
" ----(/)---- ----(/)----",
|
|||
|
"",
|
|||
|
" Elemana giren sinyal 0 ise dahili r<>le yada <20><>k<EFBFBD><6B> baca<63><61> 1 yap<61>l<EFBFBD>r.",
|
|||
|
" Elemana giren sinyal 1 ise dahili r<>le yada <20><>k<EFBFBD><6B> baca<63><61> 0 yap<61>l<EFBFBD>r.",
|
|||
|
" Bobine giri<72> de<64>i<EFBFBD>keni atamak mant<6E>ks<6B>zd<7A>r. Bu eleman bir sat<61>rda",
|
|||
|
" sa<73>daki en son eleman olmal<61>d<EFBFBD>r. Normal bobinin tersi <20>al<61><6C><EFBFBD>r.",
|
|||
|
" ",
|
|||
|
"",
|
|||
|
"> BOB<4F>N, SET Rname Yname",
|
|||
|
" ----(S)---- ----(S)----",
|
|||
|
"",
|
|||
|
" Elemana giren sinyal 1 ise dahili r<>le yada <20><>k<EFBFBD><6B> baca<63><61> 1 yap<61>l<EFBFBD>r.",
|
|||
|
" Di<44>er durumlarda bu bobinin durumunda bir de<64>i<EFBFBD>iklik olmaz. Bu komut",
|
|||
|
" bobinin durumunu sadece 0'dan 1'e <20>evirir. Bu nedenle <20>o<EFBFBD>unlukla",
|
|||
|
" BOB<4F>N-RESET ile beraber <20>al<61><6C><EFBFBD>r. Bu eleman bir sat<61>rda sa<73>daki en",
|
|||
|
" son eleman olmal<61>d<EFBFBD>r.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> BOB<4F>N, RESET Rname Yname",
|
|||
|
" ----(R)---- ----(R)----",
|
|||
|
"",
|
|||
|
" Elemana giren sinyal 1 ise dahili r<>le yada <20><>k<EFBFBD><6B> baca<63><61> 0 yap<61>l<EFBFBD>r.",
|
|||
|
" Di<44>er durumlarda bu bobinin durumunda bir de<64>i<EFBFBD>iklik olmaz. Bu komut",
|
|||
|
" bobinin durumunu sadece 1'dEn 0'a <20>evirir. Bu nedenle <20>o<EFBFBD>unlukla",
|
|||
|
" BOB<4F>N-SET ile beraber <20>al<61><6C><EFBFBD>r. Bu eleman bir sat<61>rda sa<73>daki en",
|
|||
|
" son eleman olmal<61>d<EFBFBD>r.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> TURN-ON GEC<45>KME Tdon ",
|
|||
|
" -[TON 1.000 s]-",
|
|||
|
"",
|
|||
|
" Bir zamanlay<61>c<EFBFBD>d<EFBFBD>r. Giri<72>indeki sinyal 0'dan 1'e ge<67>erse ayarlanan",
|
|||
|
" s<>re kadar s<>rede <20><>k<EFBFBD><6B> 0 olarak kal<61>r, s<>re bitince <20><>k<EFBFBD><6B><EFBFBD> 1 olur. ",
|
|||
|
" Giri<72>indeki sinyal 1'den 0'a ge<67>erse <20><>k<EFBFBD><6B> hemen 0 olur.",
|
|||
|
" Giri<72>i 0 oldu<64>u zaman zamanlay<61>c<EFBFBD> s<>f<EFBFBD>rlan<61>r. Ayr<79>ca; ayarlanan s<>re",
|
|||
|
" boyunca giri<72> 1 olarak kalmal<61>d<EFBFBD>r.",
|
|||
|
"",
|
|||
|
" Zamanlay<61>c<EFBFBD> 0'dan ba<62>layarak her <20>evrim s<>resinde 1 artarak sayar.",
|
|||
|
" Say<61> ayarlanan s<>reye e<>it yada b<>y<EFBFBD>kse <20><>k<EFBFBD><6B> 1 olur. Zamanlay<61>c<EFBFBD>",
|
|||
|
" de<64>i<EFBFBD>keni <20>zerinde i<>lem yapmak m<>mk<6D>nd<6E>r. (<28>rne<6E>in MOV komutu ile)",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> TURN-OFF GEC<45>KME Tdoff ",
|
|||
|
" -[TOF 1.000 s]-",
|
|||
|
"",
|
|||
|
" Bir zamanlay<61>c<EFBFBD>d<EFBFBD>r. Giri<72>indeki sinyal 1'den 0'a ge<67>erse ayarlanan",
|
|||
|
" s<>re kadar s<>rede <20><>k<EFBFBD><6B> 1 olarak kal<61>r, s<>re bitince <20><>k<EFBFBD><6B><EFBFBD> 0 olur. ",
|
|||
|
" Giri<72>indeki sinyal 0'dan 1'e ge<67>erse <20><>k<EFBFBD><6B> hemen 1 olur.",
|
|||
|
" Giri<72>i 0'dan 1'e ge<67>ti<74>inde zamanlay<61>c<EFBFBD> s<>f<EFBFBD>rlan<61>r. Ayr<79>ca; ayarlanan",
|
|||
|
" s<>re boyunca giri<72> 0 olarak kalmal<61>d<EFBFBD>r.",
|
|||
|
"",
|
|||
|
" Zamanlay<61>c<EFBFBD> 0'dan ba<62>layarak her <20>evrim s<>resinde 1 artarak sayar.",
|
|||
|
" Say<61> ayarlanan s<>reye e<>it yada b<>y<EFBFBD>kse <20><>k<EFBFBD><6B> 1 olur. Zamanlay<61>c<EFBFBD>",
|
|||
|
" de<64>i<EFBFBD>keni <20>zerinde i<>lem yapmak m<>mk<6D>nd<6E>r. (<28>rne<6E>in MOV komutu ile)",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> S<>RE SAYAN TURN-ON GEC<45>KME Trto ",
|
|||
|
" -[RTO 1.000 s]-",
|
|||
|
"",
|
|||
|
" Bu zamanlay<61>c<EFBFBD> giri<72>indeki sinyalin ne kadar s<>re ile 1 oldu<64>unu",
|
|||
|
" <09>l<EFBFBD>er. Ayaralanan s<>re boyunca giri<72> 1 ise <20><>k<EFBFBD><6B><EFBFBD> 1 olur. Aksi halde",
|
|||
|
" <09><>k<EFBFBD><6B><EFBFBD> 0 olur. Ayarlanan s<>re devaml<6D> olmas<61> gerekmez. <20>rne<6E>in; s<>re ",
|
|||
|
" 1 saniyeye ayarlanm<6E><6D>sa ve giri<72> <20>nce 0.6 sn 1 olmu<6D>sa, sonra 2.0 sn",
|
|||
|
" boyunca 0 olmu<6D>sa daha sonra 0.4 sn boyunca giri<72> tekrar 1 olursa",
|
|||
|
" 0.6 + 0.4 = 1sn oldu<64>undan <20><>k<EFBFBD><6B> 1 olur. <20><>k<EFBFBD><6B> 1 olduktan sonra",
|
|||
|
" giri<72> 0 olsa dahi <20><>k<EFBFBD><6B> 0'a d<>nmez. Bu nedenle zamanlay<61>c<EFBFBD> RES reset",
|
|||
|
" komutu ile resetlenmelidir.",
|
|||
|
"",
|
|||
|
" Zamanlay<61>c<EFBFBD> 0'dan ba<62>layarak her <20>evrim s<>resinde 1 artarak sayar.",
|
|||
|
" Say<61> ayarlanan s<>reye e<>it yada b<>y<EFBFBD>kse <20><>k<EFBFBD><6B> 1 olur. Zamanlay<61>c<EFBFBD>",
|
|||
|
" de<64>i<EFBFBD>keni <20>zerinde i<>lem yapmak m<>mk<6D>nd<6E>r. (<28>rne<6E>in MOV komutu ile)",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> RESET (SAYICI SIFIRLAMASI) Trto Citems",
|
|||
|
" ----{RES}---- ----{RES}----",
|
|||
|
"",
|
|||
|
" Bu komut bir zamanlay<61>c<EFBFBD> veya say<61>c<EFBFBD>y<EFBFBD> s<>f<EFBFBD>rlar. TON ve TOF zamanlay<61>c<EFBFBD>",
|
|||
|
" komutlar<61> kendili<6C>inden s<>f<EFBFBD>rland<6E><64><EFBFBD>ndan bu komuta ihtiya<79> duymazlar.",
|
|||
|
" RTO zamanlay<61>c<EFBFBD>s<EFBFBD> ve CTU/CTD say<61>c<EFBFBD>lar<61> kendili<6C>inden s<>f<EFBFBD>rlanmad<61><64><EFBFBD>ndan",
|
|||
|
" s<>f<EFBFBD>rlanmalar<61> i<>in kullan<61>c<EFBFBD> taraf<61>ndan bu komutile s<>f<EFBFBD>rlanmas<61>",
|
|||
|
" gerekir. Bu komutun giri<72>i 1 oldu<64>unda say<61>c<EFBFBD>/zamanlay<61>c<EFBFBD> s<>f<EFBFBD>rlan<61>r.",
|
|||
|
" Bu komut bir sat<61>r<EFBFBD>n sa<73><61>ndaki son komut olmal<61>d<EFBFBD>r.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> Y<>KSELEN KENAR _",
|
|||
|
" --[OSR_/ ]--",
|
|||
|
"",
|
|||
|
" Bu komutun <20><>k<EFBFBD><6B><EFBFBD> normalde 0'd<>r. Bu komutun <20><>k<EFBFBD><6B><EFBFBD>n<EFBFBD>n 1 olabilmesi",
|
|||
|
" i<>in bir <20>nceki <20>evrimde giri<72>inin 0 <20>imdiki <20>evrimde giri<72>inin 1 ",
|
|||
|
" olmas<61> gerekir. Komutun <20><>k<EFBFBD><6B><EFBFBD> bir <20>evrimlik bir pals <20>retir.",
|
|||
|
" Bu komut bir sinyalin y<>kselen kenar<61>nda bir tetikleme gereken",
|
|||
|
" uygulamalarda faydal<61>d<EFBFBD>r.",
|
|||
|
" ",
|
|||
|
"",
|
|||
|
"> D<><44>EN KENAR _",
|
|||
|
" --[OSF \\_]--",
|
|||
|
"",
|
|||
|
" Bu komutun <20><>k<EFBFBD><6B><EFBFBD> normalde 0'd<>r. Bu komutun <20><>k<EFBFBD><6B><EFBFBD>n<EFBFBD>n 1 olabilmesi",
|
|||
|
" i<>in bir <20>nceki <20>evrimde giri<72>inin 1 <20>imdiki <20>evrimde giri<72>inin 0 ",
|
|||
|
" olmas<61> gerekir. Komutun <20><>k<EFBFBD><6B><EFBFBD> bir <20>evrimlik bir pals <20>retir.",
|
|||
|
" Bu komut bir sinyalin d<><64>en kenar<61>nda bir tetikleme gereken",
|
|||
|
" uygulamalarda faydal<61>d<EFBFBD>r.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> KISA DEVRE, A<>IK DEVRE",
|
|||
|
" ----+----+---- ----+ +----",
|
|||
|
"",
|
|||
|
" K<>sa devrenin <20><>k<EFBFBD><6B><EFBFBD> her zaman giri<72>inin ayn<79>s<EFBFBD>d<EFBFBD>r.",
|
|||
|
" A<><41>k devrenin <20><>k<EFBFBD><6B><EFBFBD> her zaman 0'd<>r. Bildi<64>imiz a<><61>k/k<>sa devrenin",
|
|||
|
" ayn<79>s<EFBFBD>d<EFBFBD>r. Genellikle hata aramada kullan<61>l<EFBFBD>rlar.",
|
|||
|
"",
|
|||
|
"> ANA KONTROL R<>LES<45>",
|
|||
|
" -{MASTER RLY}-",
|
|||
|
"",
|
|||
|
" Normalde her sat<61>r<EFBFBD>n ilk giri<72>i 1'dir. Birden fazla sat<61>r<EFBFBD>n tek bir <20>art ile ",
|
|||
|
" kontrol edilmesi gerekti<74>inde paralel ba<62>lant<6E> yapmak gerekir. Bu ise zordur.",
|
|||
|
" Bu i<>lemi kolayca yapabilmek i<>in ana kontrol r<>lesini kullanabiliriz.",
|
|||
|
" Ana kontrol r<>lesi eklendi<64>inde kendisinden sonraki sat<61>rlar bu r<>leye ba<62>l<EFBFBD>",
|
|||
|
" hale gelir. B<>ylece; birden fazla sat<61>r tek bir <20>art ile kontrol<6F> sa<73>lan<61>r.",
|
|||
|
" Bir ana kontrol r<>lesi kendisinden sonra gelen ikinci bir ana kontrol",
|
|||
|
" r<>lesine kadar devam eder. Di<44>er bir deyi<79>le birinci ana kontrol r<>lesi",
|
|||
|
" ba<62>lang<6E>c<EFBFBD> ikincisi ise biti<74>i temsil eder. Ana kontrol r<>lesi kulland<6E>ktan",
|
|||
|
" sonra i<>levini bitirmek i<>in ikinci bir ana kontrol r<>lesi eklemelisiniz.",
|
|||
|
"",
|
|||
|
"> MOVE {destvar := } {Tret := }",
|
|||
|
" -{ 123 MOV}- -{ srcvar MOV}-",
|
|||
|
"",
|
|||
|
" Giri<72>i 1 oldu<64>unda verilen sabit say<61>y<EFBFBD> (123 gibi) yada verilen de<64>i<EFBFBD>kenin",
|
|||
|
" i<>eri<72>ini (srcvar) belirtilen de<64>i<EFBFBD>kene (destvar) atar. Giri<72> 0 ise herhangi",
|
|||
|
" bir i<>lem olmaz. Bu komut ile zamanlay<61>c<EFBFBD> ve say<61>c<EFBFBD>lar da dahil olmak <20>zere",
|
|||
|
" t<>m de<64>i<EFBFBD>kenlere de<64>er atayabilirsiniz. <20>rne<6E>in Tsay zamanlay<61>c<EFBFBD>s<EFBFBD>na MOVE ile",
|
|||
|
" 0 atamak ile RES ile s<>f<EFBFBD>rlamak ayn<79> sonucu do<64>urur. Bu komut bir sat<61>r<EFBFBD>n",
|
|||
|
" sa<73><61>ndaki en son komut olmal<61>d<EFBFBD>r.",
|
|||
|
"",
|
|||
|
"> MATEMAT<41>K <20><>LEMLER {ADD kay :=} {SUB Ccnt :=}",
|
|||
|
" -{ 'a' + 10 }- -{ Ccnt - 10 }-",
|
|||
|
"",
|
|||
|
"> {MUL dest :=} {DIV dv := }",
|
|||
|
" -{ var * -990 }- -{ dv / -10000}-",
|
|||
|
"",
|
|||
|
" Bu komutun giri<72>i do<64>ru ise belirtilen hedef de<64>i<EFBFBD>kenine verilen matematik",
|
|||
|
" i<>lemin sonucunu kaydeder. <20><>lenen bilgi zamanlay<61>c<EFBFBD> ve say<61>c<EFBFBD>lar dahil",
|
|||
|
" olmak <20>zere de<64>i<EFBFBD>kenler yada sabit say<61>lar olabilir. <20><>lenen bilgi 16 bit",
|
|||
|
" i<>aretli say<61>d<EFBFBD>r. Her <20>evrimde i<>lemin yeniden yap<61>ld<6C><64><EFBFBD> unutulmamal<61>d<EFBFBD>r.",
|
|||
|
" <09>rne<6E>in art<72>rma yada eksiltme yap<61>yorsan<61>z y<>kselen yada d<><64>en kenar",
|
|||
|
" kullanman<61>z gerekebilir. B<>lme (DIV) virg<72>lden sonras<61>n<EFBFBD> keser. <20>rne<6E>in;",
|
|||
|
" 8 / 3 = 2 olur. Bu komut bir sat<61>r<EFBFBD>n sa<73><61>ndaki en son komut olmal<61>d<EFBFBD>r.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> KAR<41>ILA<4C>TIRMA [var ==] [var >] [1 >=]",
|
|||
|
" -[ var2 ]- -[ 1 ]- -[ Ton]-",
|
|||
|
"",
|
|||
|
"> [var /=] [-4 < ] [1 <=]",
|
|||
|
" -[ var2 ]- -[ vartwo]- -[ Cup]-",
|
|||
|
"",
|
|||
|
" De<44>i<EFBFBD>ik kar<61><72>la<6C>t<EFBFBD>rma komutlar<61> vard<72>r. Bu komutlar<61>n giri<72>i do<64>ru (1)",
|
|||
|
" ve verilen <20>art da do<64>ru ise <20><>k<EFBFBD><6B>lar<61> 1 olur.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> SAYICI Cname Cname",
|
|||
|
" --[CTU >=5]-- --[CTD >=5]--",
|
|||
|
"",
|
|||
|
" Say<61>c<EFBFBD>lar giri<72>lerinin 0'dan 1'e her ge<67>i<EFBFBD>inde yani y<>kselen kenar<61>nda",
|
|||
|
" de<64>erlerini 1 art<72>r<EFBFBD>r (CTU) yada eksiltirler (CTD). Verilen <20>art do<64>ru ise",
|
|||
|
" <09><>k<EFBFBD><6B>lar<61> aktif (1) olur. CTU ve CTD say<61>c<EFBFBD>lar<61>na ayn<79> ismi erebilirsiniz.",
|
|||
|
" B<>ylece ayn<79> say<61>c<EFBFBD>y<EFBFBD> art<72>rm<72><6D> yada eksiltmi<6D> olursunuz. RES komutu say<61>c<EFBFBD>lar<61>",
|
|||
|
" s<>f<EFBFBD>rlar. Say<61>c<EFBFBD>lar ile genel de<64>i<EFBFBD>kenlerle kulland<6E><64><EFBFBD>n<EFBFBD>z komutlar<61> kullanabilirsiniz.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> DA<44>RESEL SAYICI Cname",
|
|||
|
" --{CTC 0:7}--",
|
|||
|
"",
|
|||
|
" Normal yukar<61> say<61>c<EFBFBD>dan fark<72> belirtilen limite ula<6C><61>nca say<61>c<EFBFBD> tekrar 0'dan ba<62>lar",
|
|||
|
" <20>rne<6E>in say<61>c<EFBFBD> 0, 1, 2, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 2,.... <20>eklinde",
|
|||
|
" sayabilir. Yani bir dizi say<61>c<EFBFBD> olarak d<><64><EFBFBD>n<EFBFBD>lebilir. CTC say<61>c<EFBFBD>lar giri<72>lerinin",
|
|||
|
" y<>kselen kenar<61>nda de<64>er de<64>i<EFBFBD>tirirler. Bu komut bir sat<61>r<EFBFBD>n sa<73><61>ndaki",
|
|||
|
" en son komut olmal<61>d<EFBFBD>r.",
|
|||
|
" ",
|
|||
|
"",
|
|||
|
"> SHIFT REGISTER {SHIFT REG }",
|
|||
|
" -{ reg0..3 }-",
|
|||
|
"",
|
|||
|
" Bir dizi de<64>i<EFBFBD>ken ile beraber <20>al<61><6C><EFBFBD>r. <20>sim olarak reg verdi<64>inizi ve a<>ama ",
|
|||
|
" say<61>s<EFBFBD>n<EFBFBD> 3 olarak tan<61>mlad<61>ysan<61>z reg0, reg1, reg2 de<64>ikenleri ile <20>al<61><6C><EFBFBD>rs<72>n<EFBFBD>z.",
|
|||
|
" Kaydedicinin giri<72>i reg0 olur. Giri<72>in her y<>kselen kenar<61>nda de<64>erler kaydedicide",
|
|||
|
" bir sa<73>a kayar. Mesela; `reg2 := reg1'. and `reg1 := reg0'. `reg0' de<64>i<EFBFBD>mez.",
|
|||
|
" Geni<6E> bir kaydedici haf<61>zada <20>ok yer kaplar.",
|
|||
|
" Bu komut bir sat<61>r<EFBFBD>n sa<73><61>ndaki en son komut olmal<61>d<EFBFBD>r.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> DE<44>ER TABLOSU {dest := }",
|
|||
|
" -{ LUT[i] }-",
|
|||
|
"",
|
|||
|
" De<44>er tablosu s<>ralanm<6E><6D> n adet de<64>er i<>eren bir tablodur. Giri<72>i do<64>ru oldu<64>unda",
|
|||
|
" `dest' tamsay<61> de<64>i<EFBFBD>keni `i' tamsay<61> de<64>i<EFBFBD>kenine kar<61><72>l<EFBFBD>k gelen de<64>eri al<61>r. S<>ra",
|
|||
|
" 0'dan ba<62>lar. bu nedenle `i' 0 ile (n-1) aras<61>nda olabilir. `i' bu de<64>erler ",
|
|||
|
" aras<61>nda de<64>ilse komutun ne yapaca<63><61> tan<61>ml<6D> de<64>ildir.",
|
|||
|
" Bu komut bir sat<61>r<EFBFBD>n sa<73><61>ndaki en son komut olmal<61>d<EFBFBD>r.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> PIECEWISE LINEAR TABLE {yvar := }",
|
|||
|
" -{ PWL[xvar] }-",
|
|||
|
"",
|
|||
|
" Bir matris tablo olarak d<><64><EFBFBD>n<EFBFBD>lebilir. Bir de<64>ere ba<62>l<EFBFBD> olarak de<64>erin <20>nceden",
|
|||
|
" belirlenen bir ba<62>ka de<64>er ile de<64>i<EFBFBD>tirilmesi i<>i olu<6C>turulan bir tablodur.",
|
|||
|
" Bu bir e<>ri olu<6C>turmak, sens<6E>rden al<61>nan de<64>ere g<>re <20><>k<EFBFBD><6B>ta ba<62>ka bir e<>ri",
|
|||
|
" olu<6C>turmak gibi ama<6D>lar i<>in kullan<61>labilir.",
|
|||
|
"",
|
|||
|
" Farzedelimki x tamsay<61> giri<72> de<64>erini y tamsay<61> <20><>k<EFBFBD><6B> de<64>erine yakla<6C>t<EFBFBD>rmak ",
|
|||
|
" istiyoruz. De<44>erlerin belirli noktalarda oldu<64>unu biliyoruz. <20>rne<6E>in;",
|
|||
|
"",
|
|||
|
" f(0) = 2",
|
|||
|
" f(5) = 10",
|
|||
|
" f(10) = 50",
|
|||
|
" f(100) = 100",
|
|||
|
"",
|
|||
|
" Bu <20>u noktalar<61>n e<>ride oldu<64>unu g<>sterir:",
|
|||
|
"",
|
|||
|
" (x0, y0) = ( 0, 2)",
|
|||
|
" (x1, y1) = ( 5, 10)",
|
|||
|
" (x2, y2) = ( 10, 50)",
|
|||
|
" (x3, y3) = (100, 100)",
|
|||
|
"",
|
|||
|
" D<>rt de<64>eri par<61>al<61> lineer tabloya gireriz. Komut, xvar'<27>n de<64>erine bakarak",
|
|||
|
" yvar'a de<64>er verir. <20>rne<6E>in, yukar<61>daki <20>rne<6E>e bakarak, xvar = 10 ise",
|
|||
|
" yvar = 50 olur.",
|
|||
|
" ",
|
|||
|
" Tabloya kay<61>tl<74> iki de<64>erin aras<61>nda bir de<64>er verirseniz verilen de<64>er de",
|
|||
|
" al<61>nmas<61> gereken iki de<64>erin aras<61>nda uygun gelen yerde bir de<64>er olur.",
|
|||
|
" Mesela; xvar=55 yazarsan<61>z yvar=75 olur. (Tablodaki de<64>erler (10,50) ve",
|
|||
|
" (100,100) oldu<64>una g<>re). 55, 10 ve 100 de<64>erlerinin ortas<61>ndad<61>r. Bu",
|
|||
|
" nedenle 55 ve 75 de<64>erlerinin ortas<61> olan 75 de<64>eri al<61>n<EFBFBD>r.",
|
|||
|
" ",
|
|||
|
" De<44>erler x koordinat<61>nda artan de<64>erler olarak yaz<61>lmal<61>d<EFBFBD>r. 16 bit tamsay<61>",
|
|||
|
" kullanan baz<61> de<64>erler i<>in arama tablosu <20>zerinde matematik i<>lemler",
|
|||
|
" ger<65>ekle<6C>meyebilir. Bu durumda LDMicro sizi uyaracakt<6B>r. <20>rne<6E>in a<>a<EFBFBD><61>daki",
|
|||
|
" tablo bir hata olu<6C>turacakt<6B>r:",
|
|||
|
"",
|
|||
|
" (x0, y0) = ( 0, 0)",
|
|||
|
" (x1, y1) = (300, 300)",
|
|||
|
"",
|
|||
|
" Bu tip hatalar<61> noktalar ars<72>nda ara de<64>erler olu<6C>turarak giderebilirsiniz.",
|
|||
|
" <09>rne<6E>in a<>a<EFBFBD><61>daki tablo yukar<61>dakinin ayn<79>s<EFBFBD> olmas<61>na ra<72>men hata ",
|
|||
|
" olu<6C>turmayacakt<6B>r.",
|
|||
|
" ",
|
|||
|
" (x0, y0) = ( 0, 0)",
|
|||
|
" (x1, y1) = (150, 150)",
|
|||
|
" (x2, y2) = (300, 300)",
|
|||
|
"",
|
|||
|
" Genelde 5 yada 6 noktadan daha fazla de<64>er kullanmak gerekmeyecektir.",
|
|||
|
" Daha fazla nokta demek daha fazla kod ve daha yava<76> <20>al<61><6C>ma demektir.",
|
|||
|
" En fazla 10 nokta olu<6C>turabilirsiniz. xvar de<64>i<EFBFBD>kenine x koordinat<61>nda",
|
|||
|
" tablonun en y<>ksek de<64>erinden daha b<>y<EFBFBD>k bir de<64>er girmenin ve en d<><64><EFBFBD>k",
|
|||
|
" de<64>erinden daha k<><6B><EFBFBD>k bir de<64>er girmenin sonucu tan<61>ml<6D> de<64>ildir.",
|
|||
|
" Bu komut bir sat<61>r<EFBFBD>n sa<73><61>ndaki en son komut olmal<61>d<EFBFBD>r.",
|
|||
|
"",
|
|||
|
"> A/D <20>EV<45>R<EFBFBD>C<EFBFBD>DEN OKUMA Aname",
|
|||
|
" --{READ ADC}--",
|
|||
|
"",
|
|||
|
" LDmicro A/D <20>eviriciden de<64>er okumak i<>in gerekli kodlar<61> destekledi<64>i",
|
|||
|
" i<>lemciler i<>in olu<6C>turabilir. Komutun giri<72>i 1 oldu<64>unda A/D <20>eviriciden ",
|
|||
|
" de<64>er okunur ve okunan de<64>er `Aname' de<64>i<EFBFBD>kenine aktar<61>l<EFBFBD>r. Bu de<64>i<EFBFBD>ken",
|
|||
|
" <09>zerinde genel de<64>i<EFBFBD>kenlerle kullan<61>labilen i<>lemler kullan<61>labilir.",
|
|||
|
" (b<>y<EFBFBD>k, k<><6B><EFBFBD>k, b<>y<EFBFBD>k yada e<>it gibi). Bu de<64>i<EFBFBD>kene i<>lemcinin bacaklar<61>ndan",
|
|||
|
" uygun biri tan<61>mlanmal<61>d<EFBFBD>r. Komutun giri<72>i 0 ise `Aname'de<64>i<EFBFBD>keninde bir",
|
|||
|
" de<64>i<EFBFBD>iklik olmaz.",
|
|||
|
" ",
|
|||
|
" <20>u an desteklenen i<>lemciler i<>in; 0 Volt i<>in ADC'den okunan de<64>er 0, ",
|
|||
|
" Vdd (besleme gerilimi) de<64>erine e<>it gerilim de<64>eri i<>in ADC'den okunan de<64>er",
|
|||
|
" 1023 olmaktad<61>r. AVR kullan<61>yorsan<61>z AREF ucunu Vdd besleme gerilimine ",
|
|||
|
" ba<62>lay<61>n<EFBFBD>z.",
|
|||
|
" ",
|
|||
|
" Aritmetik i<>lemler ADC de<64>i<EFBFBD>keni i<>in kullan<61>labilir. Ayr<79>ca bacak tan<61>mlarken",
|
|||
|
" ADC olmayan bacaklar<61>n tan<61>mlanmas<61>n<EFBFBD> LDMicro engelleyecektir.",
|
|||
|
" Bu komut bir sat<61>r<EFBFBD>n sa<73><61>ndaki en son komut olmal<61>d<EFBFBD>r.",
|
|||
|
"",
|
|||
|
" > PWM PALS GEN<45><4E>L<EFBFBD><4C><EFBFBD> AYARI duty_cycle",
|
|||
|
" -{PWM 32.8 kHz}-",
|
|||
|
"",
|
|||
|
" LDmicro destekledi<64>i mikrokontrol<6F>rler i<>in gerekli PWM kodlar<61>n<EFBFBD> <20>retebilir.",
|
|||
|
" Bu komutun giri<72>i do<64>ru (1) oldu<64>unda PWM sinyalinin pals geni<6E>li<6C>i duty_cycle",
|
|||
|
" de<64>i<EFBFBD>keninin de<64>erine ayarlan<61>r. Bu de<64>er 0 ile 100 aras<61>nda de<64>i<EFBFBD>ir. Pals",
|
|||
|
" geni<6E>li<6C>i y<>zde olarak ayarlan<61>r. Bir periyot 100 birim kabul edilirse bu",
|
|||
|
" geni<6E>li<6C>in y<>zde ka<6B><61>n<EFBFBD>n palsi olu<6C>turaca<63><61> ayarlan<61>r. 0 periyodun t<>m<EFBFBD> s<>f<EFBFBD>r",
|
|||
|
" 100 ise periyodun tamam<61> 1 olsun anlam<61>na gelir. 10 de<64>eri palsin %10'u 1 geri",
|
|||
|
" kalan %90'<27> s<>f<EFBFBD>r olsun anlam<61>na gelir.",
|
|||
|
"",
|
|||
|
" PWM frekans<6E>n<EFBFBD> ayarlayabilirsiniz. Verilen de<64>er Hz olarak verilir.",
|
|||
|
" Verdi<64>iniz frekans kesinlikle ayarlanabilir olmal<61>d<EFBFBD>r. LDMicro verdi<64>iniz de<64>eri",
|
|||
|
" olabilecek en yak<61>n de<64>erle de<64>i<EFBFBD>tirir. Y<>ksek h<>zlarda do<64>ruluk azal<61>r.",
|
|||
|
" ",
|
|||
|
" Bu komut bir sat<61>r<EFBFBD>n sa<73><61>ndaki en son komut olmal<61>d<EFBFBD>r.",
|
|||
|
" Periyodun s<>resinin <20>l<EFBFBD><6C>lebilmesi i<>in i<>lemcinin zamanlay<61>c<EFBFBD>lar<61>n<EFBFBD>n bir tanesi",
|
|||
|
" kullan<61>l<EFBFBD>r. Bu nedenle PWM en az iki tane zamanlay<61>c<EFBFBD>s<EFBFBD> olan i<>lemcilerde kullan<61>l<EFBFBD>r.",
|
|||
|
" PWM PIC16 i<>lemcilerde CCP2'yi, AVR'lerde ise OC2'yi kullan<61>r.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> EEPROMDA SAKLA saved_var",
|
|||
|
" --{PERSIST}--",
|
|||
|
"",
|
|||
|
" Bu komut ile belirtilen de<64>i<EFBFBD>kenin EEPROM'da saklanmas<61> gereken bir de<64>i<EFBFBD>ken oldu<64>unu",
|
|||
|
" belirmi<6D> olursunuz. Komutun giri<72>i do<64>ru ise belirtilen de<64>i<EFBFBD>kenin i<>eri<72>i EEPROM'a",
|
|||
|
" kaydedilir. Enerji kesildi<64>inde kaybolmamas<61> istenen de<64>erler i<>in bu komut kullan<61>l<EFBFBD>r.",
|
|||
|
" De<44>i<EFBFBD>kenin i<>eri<72>i gerilim geldi<64>inde tekrar EEPROM'dan y<>klenir. Ayr<79>ca;",
|
|||
|
" de<64>i<EFBFBD>kenin i<>eri<72>i her de<64>i<EFBFBD>ti<74>inde yeni de<64>er tekrar EEPROM'a kaydedilir.",
|
|||
|
" Ayr<79>ca bir i<>lem yap<61>lmas<61> gerekmez.",
|
|||
|
" Bu komut bir sat<61>r<EFBFBD>n sa<73><61>ndaki en son komut olmal<61>d<EFBFBD>r.",
|
|||
|
"",
|
|||
|
"************************",
|
|||
|
"> UART (SER<45> B<>LG<4C>) AL var",
|
|||
|
" --{UART RECV}--",
|
|||
|
"",
|
|||
|
" LDmicro belirli i<>lemciler i<>in gerekli UART kodlar<61>n<EFBFBD> <20>retebilir. AVR i<>lemcilerde",
|
|||
|
" sadece UART1 (UART0) de<64>il) desteklenmektedir. <20>leti<74>im h<>z<EFBFBD> (baudrate) ayarlar<61>n<EFBFBD> ",
|
|||
|
" Ayarlar-><3E><>lemci Ayarlar<61> men<65>s<EFBFBD>nden yapmal<61>s<EFBFBD>n<EFBFBD>z. H<>z kristal frekans<6E>na ba<62>l<EFBFBD> olup,",
|
|||
|
" baz<61> h<>zlar desteklenmeyebilir. Bu durumda LDMicro sizi uyaracakt<6B>r. ",
|
|||
|
" ",
|
|||
|
" Bu komutun giri<72>i yanl<6E><6C>sa herhangi bir i<>lem yap<61>lmaz. Do<44>ru ise UART'dan 1 karakter",
|
|||
|
" al<61>nmaya <20>al<61><6C><EFBFBD>l<EFBFBD>r. Okuma yap<61>lamaz ise komutun <20><>k<EFBFBD><6B><EFBFBD> yanl<6E><6C> (0) olur. Karakter",
|
|||
|
" okunursa okunan karakter `var' de<64>i<EFBFBD>keninde saklan<61>r ve komutun <20><>k<EFBFBD><6B><EFBFBD> do<64>ru (1) olur.",
|
|||
|
" <09><>k<EFBFBD><6B><EFBFBD>n do<64>ru olmas<61> sadece bir PLC <20>evrimi s<>rer.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> UART (SER<45> B<>LG<4C>) G<>NDER var",
|
|||
|
" --{UART SEND}--",
|
|||
|
"",
|
|||
|
" LDmicro belirli i<>lemciler i<>in gerekli UART kodlar<61>n<EFBFBD> <20>retebilir. AVR i<>lemcilerde",
|
|||
|
" sadece UART1 (UART0) de<64>il) desteklenmektedir. <20>leti<74>im h<>z<EFBFBD> (baudrate) ayarlar<61>n<EFBFBD> ",
|
|||
|
" Ayarlar-><3E><>lemci Ayarlar<61> men<65>s<EFBFBD>nden yapmal<61>s<EFBFBD>n<EFBFBD>z. H<>z kristal frekans<6E>na ba<62>l<EFBFBD> olup,",
|
|||
|
" baz<61> h<>zlar desteklenmeyebilir. Bu durumda LDMicro sizi uyaracakt<6B>r.",
|
|||
|
" ",
|
|||
|
" Bu komutun giri<72>i yanl<6E><6C>sa herhangi bir i<>lem yap<61>lmaz. Do<44>ru ise UART'dan 1 karakter",
|
|||
|
" g<>nderilir. G<>nderilecek karakter g<>nderme i<>leminden <20>nce `var' de<64>i<EFBFBD>keninde sakl<6B>",
|
|||
|
" olmal<61>d<EFBFBD>r. Komutun <20><>k<EFBFBD><6B><EFBFBD> UART me<6D>gulse (bir karakterin g<>nderildi<64>i s<>rece)",
|
|||
|
" do<64>ru (1) olur. Aksi halde yanl<6E><6C> olur.",
|
|||
|
" <09><>k<EFBFBD><6B><EFBFBD>n do<64>ru olmas<61> sadece bir PLC <20>evrimi s<>rer.",
|
|||
|
" ",
|
|||
|
" Karakterin g<>nderilmesi belirli bir zaman al<61>r. Bu nedenle ba<62>ka bir karakter",
|
|||
|
" g<>ndermeden <20>nce <20>nceki karakterin g<>nderildi<64>ini kontrol ediniz veya g<>nderme",
|
|||
|
" i<>lemlerinin aras<61>na geikme ekleyiniz. Komutun giri<72>ini sadece <20><>k<EFBFBD><6B> yanl<6E><6C>",
|
|||
|
" (UART me<6D>gul de<64>ilse)ise do<64>ru yap<61>n<EFBFBD>z.",
|
|||
|
"",
|
|||
|
" Bu komut yerine bi<62>imlendirilmi<6D> kelime komutunu (bir sonraki komut) inceleyiniz.",
|
|||
|
" Bi<42>imlendirilmi<6D> kelime komutunun kullan<61>m<EFBFBD> daha kolayd<79>r. <20>stedi<64>iniz i<>lemleri",
|
|||
|
" daha rahat ger<65>ekle<6C>tirebilirsiniz.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> UART <20>ZER<45>NDEN B<><42><EFBFBD>MLEND<4E>R<EFBFBD>LM<4C><4D> KEL<45>ME var",
|
|||
|
" -{\"Pressure: \\3\\r\\n\"}-",
|
|||
|
"",
|
|||
|
" LDmicro belirli i<>lemciler i<>in gerekli UART kodlar<61>n<EFBFBD> <20>retebilir. AVR i<>lemcilerde",
|
|||
|
" sadece UART1 (UART0) de<64>il) desteklenmektedir. <20>leti<74>im h<>z<EFBFBD> (baudrate) ayarlar<61>n<EFBFBD> ",
|
|||
|
" Ayarlar-><3E><>lemci Ayarlar<61> men<65>s<EFBFBD>nden yapmal<61>s<EFBFBD>n<EFBFBD>z. H<>z kristal frekans<6E>na ba<62>l<EFBFBD> olup,",
|
|||
|
" baz<61> h<>zlar desteklenmeyebilir. Bu durumda LDMicro sizi uyaracakt<6B>r.",
|
|||
|
"",
|
|||
|
" Bu komutun giri<72>i yanl<6E><6C>tan do<64>ruya ge<67>erse (y<>kselen kenar) ise seri port <20>zerinden",
|
|||
|
" t<>m kelimeyi g<>nderir. E<>er kelime `\\3' <20>zel kodunu i<>eriyorsa dizi i<>eri<72>i ",
|
|||
|
" `var' de<64>i<EFBFBD>kenin i<>eri<72>i otomatik olarak kelimeye (string) <20>evrilerek`var'",
|
|||
|
" de<64>i<EFBFBD>keninin i<>eri<72>i ile de<64>i<EFBFBD>tirilir. De<44>i<EFBFBD>kenin uzunlu<6C>u 3 karakter olacak <20>ekilde",
|
|||
|
" de<64>i<EFBFBD>tirilir. Mesela; `var' de<64>i<EFBFBD>keninin i<>eri<72>i 35 ise kelime 35 rakam<61>n<EFBFBD>n ba<62><61>na bir",
|
|||
|
" adet bo<62>ul eklenerek `Pressure: 35\\r\\n' haline getirilir. Veya `var'de<64>i<EFBFBD>keninin",
|
|||
|
" i<>eri<72>i 1453 ise yap<61>lacak i<>lem belli olmaz. Bu durumda `\\4' kullanmak gerekebilir.",
|
|||
|
"",
|
|||
|
" De<44>i<EFBFBD>ken negatif bir say<61> olabilecekse `\\-3d' (veya `\\-4d') gibi uygun bir de<64>er",
|
|||
|
" kullanmal<61>s<EFBFBD>n<EFBFBD>z. Bu durumda LDMicro negatif say<61>lar<61>n <20>n<EFBFBD>ne eksi i<>areti, pozitif say<61>lar<61>n",
|
|||
|
" <09>n<EFBFBD>ne ise bir bo<62>luk karakteri yerle<6C>tirecektir.",
|
|||
|
"",
|
|||
|
" Ayn<79> anda birka<6B> i<>lem tan<61>mlan<61>rsa, yada UART ile ilgili i<>lemler birbirine",
|
|||
|
" kar<61><72><EFBFBD>k hale getirilirse program<61>n davran<61><6E><EFBFBD> belirli olmayacakt<6B>r. Bu nedenle",
|
|||
|
" dikkatli olmal<61>s<EFBFBD>n<EFBFBD>z.",
|
|||
|
"",
|
|||
|
" Kullan<61>labilecek <20>zel karakterler (escape kodlar<61>) <20>unlard<72>r:",
|
|||
|
" * \\r -- sat<61>r ba<62><61>na ge<67>",
|
|||
|
" * \\n -- yeni sat<61>r",
|
|||
|
" * \\f -- ka<6B><61>d<EFBFBD> ilerlet (formfeed)",
|
|||
|
" * \\b -- bir karakter geri gel (backspace)",
|
|||
|
" * \\xAB -- ASCII karakter kodu 0xAB (hex)",
|
|||
|
"",
|
|||
|
" Bu komutun <20><>k<EFBFBD><6B><EFBFBD> bilgi g<>nderiyorken do<64>ru di<64>er durumlarda yanl<6E><6C> olur.",
|
|||
|
" Bu komut program haf<61>zas<61>nda <20>ok yer kaplar.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"MATEMAT<EFBFBD>KSEL <20><>LEMLER <20>LE <20>LG<4C>L<EFBFBD> B<>LG<4C>",
|
|||
|
"======================================",
|
|||
|
"",
|
|||
|
"Unutmay<EFBFBD>n ki, LDMicro 16-bit tamsay<61> matematik komutlar<61>na sahiptir.",
|
|||
|
"Bu i<>lemlerde kullan<61>lan de<64>erler ve hesaplaman<61>n sonucu -32768 ile",
|
|||
|
"32767 aras<61>nda bir tamsay<61> olabilir.",
|
|||
|
"",
|
|||
|
"Mesela y = (1/x)*1200 form<72>l<EFBFBD>n<EFBFBD> hesaplamaya <20>al<61><6C>al<61>m. x 1 ile 20",
|
|||
|
"aras<EFBFBD>nda bir say<61>d<EFBFBD>r. Bu durumda y 1200 ile 60 aras<61>nda olur. Bu say<61>",
|
|||
|
"16-bit bir tamsay<61> s<>n<EFBFBD>rlar<61> i<>indedir. Ladder diyagram<61>m<EFBFBD>z<EFBFBD> yazal<61>m.",
|
|||
|
"<EFBFBD>nce b<>lelim, sonra <20>arpma i<>lemini yapal<61>m:",
|
|||
|
"",
|
|||
|
" || {DIV temp :=} ||",
|
|||
|
" ||---------{ 1 / x }----------||",
|
|||
|
" || ||",
|
|||
|
" || {MUL y := } ||",
|
|||
|
" ||----------{ temp * 1200}----------||",
|
|||
|
" || ||",
|
|||
|
"",
|
|||
|
"Yada b<>lmeyi do<64>rudan yapal<61>m:",
|
|||
|
"",
|
|||
|
" || {DIV y :=} ||",
|
|||
|
" ||-----------{ 1200 / x }-----------||",
|
|||
|
"",
|
|||
|
"Matematiksel olarak iki i<>lem ayn<79>d sonucu vermelidir. Ama birinci i<>lem",
|
|||
|
"yanl<EFBFBD><EFBFBD> sonu<6E> verecektir. (y=0 olur). Bu hata `temp' de<64>i<EFBFBD>keninin 1'den",
|
|||
|
"k<EFBFBD><EFBFBD><EFBFBD>k sonu<6E> vermesindendir.Mesela x = 3 iken (1 / x) = 0.333 olur. Ama",
|
|||
|
"0.333 bir tamsay<61> de<64>ildir. Bu nedenle sonu<6E> 0 olur. <20>kinci ad<61>mda ise",
|
|||
|
"y = temp * 1200 = 0 olur. <20>kinci <20>ekilde ise b<>len bir tamsay<61> oldu<64>undan",
|
|||
|
"sonu<EFBFBD> do<64>ru <20><>kacakt<6B>r.",
|
|||
|
"",
|
|||
|
"<EFBFBD><EFBFBD>lemlerinizde bir sorun varsa dikkatle kontrol ediniz. Ayr<79>ca sonucun",
|
|||
|
"ba<EFBFBD>a d<>nmemesine de dikkat ediniz. Mesela 32767 + 1 = -32768 olur.",
|
|||
|
"32767 s<>n<EFBFBD>r<EFBFBD> a<><61>lm<6C><6D> olacakt<6B>r. ",
|
|||
|
"",
|
|||
|
"Hesaplamalar<EFBFBD>n<EFBFBD>zda mant<6E>ksal de<64>i<EFBFBD>imler yaparak do<64>ru sonu<6E>lar elde edebilirsiniz.",
|
|||
|
"<EFBFBD>rne<EFBFBD>in; y = 1.8*x ise form<72>l<EFBFBD>n<EFBFBD>z<EFBFBD> y = (9/5)*x <20>eklinde yaz<61>n<EFBFBD>z.(1.8 = 9/5)",
|
|||
|
"y = (9*x)/5 <20>eklindeki bir kod sonucu daha tutarl<72> hale getirecektir.",
|
|||
|
"performing the multiplication first:",
|
|||
|
"",
|
|||
|
" || {MUL temp :=} ||",
|
|||
|
" ||---------{ x * 9 }----------||",
|
|||
|
" || ||",
|
|||
|
" || {DIV y :=} ||",
|
|||
|
" ||-----------{ temp / 5 }-----------||",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"KODALAMA <20>EKL<4B>",
|
|||
|
"==============",
|
|||
|
"",
|
|||
|
"Program<EFBFBD>n sa<73>lad<61><64><EFBFBD> kolayl<79>klardan faydalan<61>n. Mesela:",
|
|||
|
"",
|
|||
|
" || Xa Ya ||",
|
|||
|
" 1 ||-------] [--------------( )-------||",
|
|||
|
" || ||",
|
|||
|
" || Xb Yb ||",
|
|||
|
" ||-------] [------+-------( )-------||",
|
|||
|
" || | ||",
|
|||
|
" || | Yc ||",
|
|||
|
" || +-------( )-------||",
|
|||
|
" || ||",
|
|||
|
"",
|
|||
|
"yazmak a<>a<EFBFBD><61>dakinden daha kolay olacakt<6B>r.",
|
|||
|
"",
|
|||
|
" || Xa Ya ||",
|
|||
|
" 1 ||-------] [--------------( )-------||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || Xb Yb ||",
|
|||
|
" 2 ||-------] [--------------( )-------||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || Xb Yc ||",
|
|||
|
" 3 ||-------] [--------------( )-------||",
|
|||
|
" || ||",
|
|||
|
"",
|
|||
|
" * * *",
|
|||
|
"",
|
|||
|
"Yazd<EFBFBD><EFBFBD><EFBFBD>n<EFBFBD>z kodlar<61>n sonu<6E>lar<61>na dikkat ediniz. A<>a<EFBFBD><61>daki sat<61>rlarda",
|
|||
|
"mant<EFBFBD>ks<EFBFBD>z bir programlama yap<61>lm<6C><6D>t<EFBFBD>r. <20><>nk<6E> hem Xa hemde Xb ayn<79>",
|
|||
|
"anda do<64>ru olabilir.",
|
|||
|
"",
|
|||
|
" || Xa {v := } ||",
|
|||
|
" 1 ||-------] [--------{ 12 MOV}--||",
|
|||
|
" || ||",
|
|||
|
" || Xb {v := } ||",
|
|||
|
" ||-------] [--------{ 23 MOV}--||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || [v >] Yc ||",
|
|||
|
" 2 ||------[ 15]-------------( )-------||",
|
|||
|
" || ||",
|
|||
|
"",
|
|||
|
"A<EFBFBD>a<EFBFBD><EFBFBD>daki sat<61>rlar yukarda bahsi ge<67>en tarzdad<61>r. Ancak yap<61>lan",
|
|||
|
"i<EFBFBD>lem 4-bit binary say<61> tamsay<61>ya <20>evrilmektedir.",
|
|||
|
"",
|
|||
|
" || {v := } ||",
|
|||
|
" 3 ||-----------------------------------{ 0 MOV}--||",
|
|||
|
" || ||",
|
|||
|
" || Xb0 {ADD v :=} ||",
|
|||
|
" ||-------] [------------------{ v + 1 }-----------||",
|
|||
|
" || ||",
|
|||
|
" || Xb1 {ADD v :=} ||",
|
|||
|
" ||-------] [------------------{ v + 2 }-----------||",
|
|||
|
" || ||",
|
|||
|
" || Xb2 {ADD v :=} ||",
|
|||
|
" ||-------] [------------------{ v + 4 }-----------||",
|
|||
|
" || ||",
|
|||
|
" || Xb3 {ADD v :=} ||",
|
|||
|
" ||-------] [------------------{ v + 8 }-----------||",
|
|||
|
" || ||",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"HATALAR (BUG)",
|
|||
|
"=============",
|
|||
|
"",
|
|||
|
"LDmicro taraf<61>ndan <20>retilen kodlar <20>ok verimli kodlar de<64>ildir. Yava<76> <20>al<61><6C>an",
|
|||
|
"ve haf<61>zada fazla yer kaplayan kodlar olabilirler. Buna ra<72>men orta b<>y<EFBFBD>kl<6B>kte",
|
|||
|
"bir PIC veya AVR k<><6B><EFBFBD>k bir PLC'nin yapt<70><74><EFBFBD> i<>i yapar. Bu nedenle di<64>er sorunlar",
|
|||
|
"yer yer g<>zard<72> edlebilir.",
|
|||
|
"",
|
|||
|
"De<EFBFBD>i<EFBFBD>ken isimleri <20>ok uzun olmamal<61>d<EFBFBD>r. ",
|
|||
|
"",
|
|||
|
"Program<EFBFBD>n<EFBFBD>z yada kulland<6E><64><EFBFBD>n<EFBFBD>z haf<61>za se<73>ti<74>iniz i<>lemcinin sahip oldu<64>undan",
|
|||
|
"b<EFBFBD>y<EFBFBD>kse LDMicro hata vermeyebilir. Dikkat etmezseniz program<61>n<EFBFBD>z hatal<61> <20>al<61><6C>acakt<6B>r.",
|
|||
|
"",
|
|||
|
"Buldu<EFBFBD>unuz hatalar<61> yazara bildiriniz.",
|
|||
|
"",
|
|||
|
"Te<EFBFBD>ekk<EFBFBD>rler:",
|
|||
|
" * Marcelo Solano, Windows 98'deki UI problemini bildirdi<64>i i<>in,",
|
|||
|
" * Serge V. Polubarjev, PIC16F628 i<>lemcisi se<73>ildi<64>inde RA3:0'<27>n <20>al<61><6C>mad<61><64><EFBFBD>",
|
|||
|
" ve nas<61>l d<>zeltece<63>imi bildirdi<64>i i<>in,",
|
|||
|
" * Maxim Ibragimov, ATmega16 ve ATmega162 i<>lemcileri test ettikleri, problemleri",
|
|||
|
" bulduklar<61> ve bildirdikleri i<>in,",
|
|||
|
" * Bill Kishonti, s<>f<EFBFBD>ra b<>l<EFBFBD>m hatas<61> oldu<64>unda sim<69>lasyonun <20><>kt<6B><74><EFBFBD>n<EFBFBD> bildirdikleri",
|
|||
|
" i<>in,",
|
|||
|
" * Mohamed Tayae, PIC16F628 i<>lemcisinde EEPROM'da saklanmas<61> gereken de<64>i<EFBFBD>kenlerin",
|
|||
|
" asl<73>nda saklanmad<61><64><EFBFBD>n<EFBFBD> bildirdi<64>i i<>in,",
|
|||
|
" * David Rothwell, kullan<61>c<EFBFBD> aray<61>z<EFBFBD>ndeki birka<6B> problemi ve \"Metin Dosyas<61> Olarak Kaydet\"",
|
|||
|
" fonksiyonundaki problemi bildirdi<64>i i<>in.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"KOPYALAMA VE KULLANIM <20>ARTLARI",
|
|||
|
"==============================",
|
|||
|
"",
|
|||
|
"LDMICRO TARAFINDAN <20>RET<45>LEN KODU <20>NSAN HAYATI VE <20>NSAN HAYATINI ETK<54>LEYEB<45>LECEK",
|
|||
|
"PROJELERDE KULLANMAYINIZ. LDMICRO PROGRAMCISI LDMICRO'NUN KEND<4E>NDEN VE LDMICRO",
|
|||
|
"<EFBFBD>LE <20>RET<45>LEN KODDAN KAYNAKLANAN H<><48>B<EFBFBD>R PROBLEM <20><><EFBFBD>N SORUMLULUK KABUL ETMEMEKTED<45>R.",
|
|||
|
"",
|
|||
|
"Bu program <20>cretsiz bir program olup, diledi<64>iniz gibi da<64><61>tabilirsiniz,",
|
|||
|
"kaynak kodda de<64>i<EFBFBD>iklik yapabilirsiniz. Program<61>n kullan<61>m<EFBFBD> Free Software Foundation",
|
|||
|
"taraf<EFBFBD>ndan yaz<61>lan GNU General Public License (version 3 ve sonras<61>)<29>artlar<61>na ba<62>l<EFBFBD>d<EFBFBD>r.",
|
|||
|
"",
|
|||
|
"Program faydal<61> olmas<61> <20>midiyle da<64><61>t<EFBFBD>lm<6C><6D>t<EFBFBD>r. Ancak hi<68>bir garanti verilmemektedir.",
|
|||
|
"Detaylar i<>in GNU General Public License i<>eri<72>ine bak<61>n<EFBFBD>z.",
|
|||
|
"",
|
|||
|
"S<EFBFBD>z konusu s<>zle<6C>menin bir kopyas<61> bu programla beraber gelmi<6D> olmas<61> gerekmektedir.",
|
|||
|
"Gelmediyse <http://www.gnu.org/licenses/> adresinde bulabilirsiniz.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"Jonathan Westhues",
|
|||
|
"",
|
|||
|
"Rijswijk -- Dec 2004",
|
|||
|
"Waterloo ON -- Jun, Jul 2005",
|
|||
|
"Cambridge MA -- Sep, Dec 2005",
|
|||
|
" Feb, Mar 2006",
|
|||
|
" Feb 2007",
|
|||
|
"",
|
|||
|
"Email: user jwesthues, at host cq.cx",
|
|||
|
"",
|
|||
|
"T<EFBFBD>rk<EFBFBD>e Versiyon : <http://tekelektirik.com/public/ldmicro.rar>",
|
|||
|
NULL
|
|||
|
};
|
|||
|
#endif
|
|||
|
|
|||
|
#if defined(LDLANG_EN) || defined(LDLANG_ES) || defined(LDLANG_IT) || defined(LDLANG_PT)
|
|||
|
char *HelpText[] = {
|
|||
|
"",
|
|||
|
"INTRODUCTION",
|
|||
|
"============",
|
|||
|
"",
|
|||
|
"LDmicro generates native code for certain Microchip PIC16 and Atmel AVR",
|
|||
|
"microcontrollers. Usually software for these microcontrollers is written",
|
|||
|
"in a programming language like assembler, C, or BASIC. A program in one",
|
|||
|
"of these languages comprises a list of statements. These languages are",
|
|||
|
"powerful and well-suited to the architecture of the processor, which",
|
|||
|
"internally executes a list of instructions.",
|
|||
|
"",
|
|||
|
"PLCs, on the other hand, are often programmed in `ladder logic.' A simple",
|
|||
|
"program might look like this:",
|
|||
|
"",
|
|||
|
" || ||",
|
|||
|
" || Xbutton1 Tdon Rchatter Yred ||",
|
|||
|
" 1 ||-------]/[---------[TON 1.000 s]-+-------]/[--------------( )-------||",
|
|||
|
" || | ||",
|
|||
|
" || Xbutton2 Tdof | ||",
|
|||
|
" ||-------]/[---------[TOF 2.000 s]-+ ||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || Rchatter Ton Tnew Rchatter ||",
|
|||
|
" 2 ||-------]/[---------[TON 1.000 s]----[TOF 1.000 s]---------( )-------||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" ||------[END]---------------------------------------------------------||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
"",
|
|||
|
"(TON is a turn-on delay; TOF is a turn-off delay. The --] [-- statements",
|
|||
|
"are inputs, which behave sort of like the contacts on a relay. The",
|
|||
|
"--( )-- statements are outputs, which behave sort of like the coil of a",
|
|||
|
"relay. Many good references for ladder logic are available on the Internet",
|
|||
|
"and elsewhere; details specific to this implementation are given below.)",
|
|||
|
"",
|
|||
|
"A number of differences are apparent:",
|
|||
|
"",
|
|||
|
" * The program is presented in graphical format, not as a textual list",
|
|||
|
" of statements. Many people will initially find this easier to",
|
|||
|
" understand.",
|
|||
|
"",
|
|||
|
" * At the most basic level, programs look like circuit diagrams, with",
|
|||
|
" relay contacts (inputs) and coils (outputs). This is intuitive to",
|
|||
|
" programmers with knowledge of electric circuit theory.",
|
|||
|
"",
|
|||
|
" * The ladder logic compiler takes care of what gets calculated",
|
|||
|
" where. You do not have to write code to determine when the outputs",
|
|||
|
" have to get recalculated based on a change in the inputs or a",
|
|||
|
" timer event, and you do not have to specify the order in which",
|
|||
|
" these calculations must take place; the PLC tools do that for you.",
|
|||
|
"",
|
|||
|
"LDmicro compiles ladder logic to PIC16 or AVR code. The following",
|
|||
|
"processors are supported:",
|
|||
|
" * PIC16F877",
|
|||
|
" * PIC16F628",
|
|||
|
" * PIC16F876 (untested)",
|
|||
|
" * PIC16F88 (untested)",
|
|||
|
" * PIC16F819 (untested)",
|
|||
|
" * PIC16F887 (untested)",
|
|||
|
" * PIC16F886 (untested)",
|
|||
|
" * ATmega128",
|
|||
|
" * ATmega64",
|
|||
|
" * ATmega162 (untested)",
|
|||
|
" * ATmega32 (untested)",
|
|||
|
" * ATmega16 (untested)",
|
|||
|
" * ATmega8 (untested)",
|
|||
|
"",
|
|||
|
"It would be easy to support more AVR or PIC16 chips, but I do not have",
|
|||
|
"any way to test them. If you need one in particular then contact me and",
|
|||
|
"I will see what I can do.",
|
|||
|
"",
|
|||
|
"Using LDmicro, you can draw a ladder diagram for your program. You can",
|
|||
|
"simulate the logic in real time on your PC. Then when you are convinced",
|
|||
|
"that it is correct you can assign pins on the microcontroller to the",
|
|||
|
"program inputs and outputs. Once you have assigned the pins, you can",
|
|||
|
"compile PIC or AVR code for your program. The compiler output is a .hex",
|
|||
|
"file that you can program into your microcontroller using any PIC/AVR",
|
|||
|
"programmer.",
|
|||
|
"",
|
|||
|
"LDmicro is designed to be somewhat similar to most commercial PLC",
|
|||
|
"programming systems. There are some exceptions, and a lot of things",
|
|||
|
"aren't standard in industry anyways. Carefully read the description",
|
|||
|
"of each instruction, even if it looks familiar. This document assumes",
|
|||
|
"basic knowledge of ladder logic and of the structure of PLC software",
|
|||
|
"(the execution cycle: read inputs, compute, write outputs).",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"ADDITIONAL TARGETS",
|
|||
|
"==================",
|
|||
|
"",
|
|||
|
"It is also possible to generate ANSI C code. You could use this with any",
|
|||
|
"processor for which you have a C compiler, but you are responsible for",
|
|||
|
"supplying the runtime. That means that LDmicro just generates source",
|
|||
|
"for a function PlcCycle(). You are responsible for calling PlcCycle",
|
|||
|
"every cycle time, and you are responsible for implementing all the I/O",
|
|||
|
"(read/write digital input, etc.) functions that the PlcCycle() calls. See",
|
|||
|
"the comments in the generated source for more details.",
|
|||
|
"",
|
|||
|
"Finally, LDmicro can generate processor-independent bytecode for a",
|
|||
|
"virtual machine designed to run ladder logic code. I have provided a",
|
|||
|
"sample implementation of the interpreter/VM, written in fairly portable",
|
|||
|
"C. This target will work for just about any platform, as long as you",
|
|||
|
"can supply your own VM. This might be useful for applications where you",
|
|||
|
"wish to use ladder logic as a `scripting language' to customize a larger",
|
|||
|
"program. See the comments in the sample interpreter for details.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"COMMAND LINE OPTIONS",
|
|||
|
"====================",
|
|||
|
"",
|
|||
|
"ldmicro.exe is typically run with no command line options. That means",
|
|||
|
"that you can just make a shortcut to the program, or save it to your",
|
|||
|
"desktop and double-click the icon when you want to run it, and then you",
|
|||
|
"can do everything from within the GUI.",
|
|||
|
"",
|
|||
|
"If LDmicro is passed a single filename on the command line",
|
|||
|
"(e.g. `ldmicro.exe asd.ld'), then LDmicro will try to open `asd.ld',",
|
|||
|
"if it exists. An error is produced if `asd.ld' does not exist. This",
|
|||
|
"means that you can associate ldmicro.exe with .ld files, so that it runs",
|
|||
|
"automatically when you double-click a .ld file.",
|
|||
|
"",
|
|||
|
"If LDmicro is passed command line arguments in the form",
|
|||
|
"`ldmicro.exe /c src.ld dest.hex', then it tries to compile `src.ld',",
|
|||
|
"and save the output as `dest.hex'. LDmicro exits after compiling,",
|
|||
|
"whether the compile was successful or not. Any messages are printed",
|
|||
|
"to the console. This mode is useful only when running LDmicro from the",
|
|||
|
"command line.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"BASICS",
|
|||
|
"======",
|
|||
|
"",
|
|||
|
"If you run LDmicro with no arguments then it starts with an empty",
|
|||
|
"program. If you run LDmicro with the name of a ladder program (xxx.ld)",
|
|||
|
"on the command line then it will try to load that program at startup.",
|
|||
|
"LDmicro uses its own internal format for the program; it cannot import",
|
|||
|
"logic from any other tool.",
|
|||
|
"",
|
|||
|
"If you did not load an existing program then you will be given a program",
|
|||
|
"with one empty rung. You could add an instruction to it; for example",
|
|||
|
"you could add a set of contacts (Instruction -> Insert Contacts) named",
|
|||
|
"`Xnew'. `X' means that the contacts will be tied to an input pin on the",
|
|||
|
"microcontroller. You could assign a pin to it later, after choosing a",
|
|||
|
"microcontroller and renaming the contacts. The first letter of a name",
|
|||
|
"indicates what kind of object it is. For example:",
|
|||
|
"",
|
|||
|
" * Xname -- tied to an input pin on the microcontroller",
|
|||
|
" * Yname -- tied to an output pin on the microcontroller",
|
|||
|
" * Rname -- `internal relay': a bit in memory",
|
|||
|
" * Tname -- a timer; turn-on delay, turn-off delay, or retentive",
|
|||
|
" * Cname -- a counter, either count-up or count-down",
|
|||
|
" * Aname -- an integer read from an A/D converter",
|
|||
|
" * name -- a general-purpose (integer) variable",
|
|||
|
"",
|
|||
|
"Choose the rest of the name so that it describes what the object does,",
|
|||
|
"and so that it is unique within the program. The same name always refers",
|
|||
|
"to the same object within the program. For example, it would be an error",
|
|||
|
"to have a turn-on delay (TON) called `Tdelay' and a turn-off delay (TOF)",
|
|||
|
"called `Tdelay' in the same program, since each counter needs its own",
|
|||
|
"memory. On the other hand, it would be correct to have a retentive timer",
|
|||
|
"(RTO) called `Tdelay' and a reset instruction (RES) associated with",
|
|||
|
"`Tdelay', since it that case you want both instructions to work with",
|
|||
|
"the same timer.",
|
|||
|
"",
|
|||
|
"Variable names can consist of letters, numbers, and underscores",
|
|||
|
"(_). A variable name must not start with a number. Variable names are",
|
|||
|
"case-sensitive.",
|
|||
|
"",
|
|||
|
"The general variable instructions (MOV, ADD, EQU, etc.) can work on",
|
|||
|
"variables with any name. This means that they can access timer and",
|
|||
|
"counter accumulators. This may sometimes be useful; for example, you",
|
|||
|
"could check if the count of a timer is in a particular range.",
|
|||
|
"",
|
|||
|
"Variables are always 16 bit integers. This means that they can go",
|
|||
|
"from -32768 to 32767. Variables are always treated as signed. You can",
|
|||
|
"specify literals as normal decimal numbers (0, 1234, -56). You can also",
|
|||
|
"specify ASCII character values ('A', 'z') by putting the character in",
|
|||
|
"single-quotes. You can use an ASCII character code in most places that",
|
|||
|
"you could use a decimal number.",
|
|||
|
"",
|
|||
|
"At the bottom of the screen you will see a list of all the objects in",
|
|||
|
"the program. This list is automatically generated from the program;",
|
|||
|
"there is no need to keep it up to date by hand. Most objects do not",
|
|||
|
"need any configuration. `Xname', `Yname', and `Aname' objects must be",
|
|||
|
"assigned to a pin on the microcontroller, however. First choose which",
|
|||
|
"microcontroller you are using (Settings -> Microcontroller). Then assign",
|
|||
|
"your I/O pins by double-clicking them on the list.",
|
|||
|
"",
|
|||
|
"You can modify the program by inserting or deleting instructions. The",
|
|||
|
"cursor in the program display blinks to indicate the currently selected",
|
|||
|
"instruction and the current insertion point. If it is not blinking then",
|
|||
|
"press <Tab> or click on an instruction. Now you can delete the current",
|
|||
|
"instruction, or you can insert a new instruction to the right or left",
|
|||
|
"(in series with) or above or below (in parallel with) the selected",
|
|||
|
"instruction. Some operations are not allowed. For example, no instructions",
|
|||
|
"are allowed to the right of a coil.",
|
|||
|
"",
|
|||
|
"The program starts with just one rung. You can add more rungs by selecting",
|
|||
|
"Insert Rung Before/After in the Logic menu. You could get the same effect",
|
|||
|
"by placing many complicated subcircuits in parallel within one rung,",
|
|||
|
"but it is more clear to use multiple rungs.",
|
|||
|
"",
|
|||
|
"Once you have written a program, you can test it in simulation, and then",
|
|||
|
"you can compile it to a HEX file for the target microcontroller.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"SIMULATION",
|
|||
|
"==========",
|
|||
|
"",
|
|||
|
"To enter simulation mode, choose Simulate -> Simulation Mode or press",
|
|||
|
"<Ctrl+M>. The program is shown differently in simulation mode. There is",
|
|||
|
"no longer a cursor. The instructions that are energized show up bright",
|
|||
|
"red; the instructions that are not appear greyed. Press the space bar to",
|
|||
|
"run the PLC one cycle. To cycle continuously in real time, choose",
|
|||
|
"Simulate -> Start Real-Time Simulation, or press <Ctrl+R>. The display of",
|
|||
|
"the program will be updated in real time as the program state changes.",
|
|||
|
"",
|
|||
|
"You can set the state of the inputs to the program by double-clicking",
|
|||
|
"them in the list at the bottom of the screen, or by double-clicking an",
|
|||
|
"`Xname' contacts instruction in the program. If you change the state of",
|
|||
|
"an input pin then that change will not be reflected in how the program",
|
|||
|
"is displayed until the PLC cycles; this will happen automatically if",
|
|||
|
"you are running a real time simulation, or when you press the space bar.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"COMPILING TO NATIVE CODE",
|
|||
|
"========================",
|
|||
|
"",
|
|||
|
"Ultimately the point is to generate a .hex file that you can program",
|
|||
|
"into your microcontroller. First you must select the part number of the",
|
|||
|
"microcontroller, under the Settings -> Microcontroller menu. Then you",
|
|||
|
"must assign an I/O pin to each `Xname' or `Yname' object. Do this by",
|
|||
|
"double-clicking the object name in the list at the bottom of the screen.",
|
|||
|
"A dialog will pop up where you can choose an unallocated pin from a list.",
|
|||
|
"",
|
|||
|
"Then you must choose the cycle time that you will run with, and you must",
|
|||
|
"tell the compiler what clock speed the micro will be running at. These",
|
|||
|
"are set under the Settings -> MCU Parameters... menu. In general you",
|
|||
|
"should not need to change the cycle time; 10 ms is a good value for most",
|
|||
|
"applications. Type in the frequency of the crystal that you will use",
|
|||
|
"with the microcontroller (or the ceramic resonator, etc.) and click okay.",
|
|||
|
"",
|
|||
|
"Now you can generate code from your program. Choose Compile -> Compile,",
|
|||
|
"or Compile -> Compile As... if you have previously compiled this program",
|
|||
|
"and you want to specify a different output file name. If there are no",
|
|||
|
"errors then LDmicro will generate an Intel IHEX file ready for",
|
|||
|
"programming into your chip.",
|
|||
|
"",
|
|||
|
"Use whatever programming software and hardware you have to load the hex",
|
|||
|
"file into the microcontroller. Remember to set the configuration bits",
|
|||
|
"(fuses)! For PIC16 processors, the configuration bits are included in the",
|
|||
|
"hex file, and most programming software will look there automatically.",
|
|||
|
"For AVR processors you must set the configuration bits by hand.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"INSTRUCTIONS REFERENCE",
|
|||
|
"======================",
|
|||
|
"",
|
|||
|
"> CONTACT, NORMALLY OPEN Xname Rname Yname",
|
|||
|
" ----] [---- ----] [---- ----] [----",
|
|||
|
"",
|
|||
|
" If the signal going into the instruction is false, then the output",
|
|||
|
" signal is false. If the signal going into the instruction is true,",
|
|||
|
" then the output signal is true if and only if the given input pin,",
|
|||
|
" output pin, or internal relay is true, else it is false. This",
|
|||
|
" instruction can examine the state of an input pin, an output pin,",
|
|||
|
" or an internal relay.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> CONTACT, NORMALLY CLOSED Xname Rname Yname",
|
|||
|
" ----]/[---- ----]/[---- ----]/[----",
|
|||
|
"",
|
|||
|
" If the signal going into the instruction is false, then the output",
|
|||
|
" signal is false. If the signal going into the instruction is true,",
|
|||
|
" then the output signal is true if and only if the given input pin,",
|
|||
|
" output pin, or internal relay is false, else it is false. This",
|
|||
|
" instruction can examine the state of an input pin, an output pin,",
|
|||
|
" or an internal relay. This is the opposite of a normally open contact.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> COIL, NORMAL Rname Yname",
|
|||
|
" ----( )---- ----( )----",
|
|||
|
"",
|
|||
|
" If the signal going into the instruction is false, then the given",
|
|||
|
" internal relay or output pin is cleared false. If the signal going",
|
|||
|
" into this instruction is true, then the given internal relay or output",
|
|||
|
" pin is set true. It is not meaningful to assign an input variable to a",
|
|||
|
" coil. This instruction must be the rightmost instruction in its rung.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> COIL, NEGATED Rname Yname",
|
|||
|
" ----(/)---- ----(/)----",
|
|||
|
"",
|
|||
|
" If the signal going into the instruction is true, then the given",
|
|||
|
" internal relay or output pin is cleared false. If the signal going",
|
|||
|
" into this instruction is false, then the given internal relay or",
|
|||
|
" output pin is set true. It is not meaningful to assign an input",
|
|||
|
" variable to a coil. This is the opposite of a normal coil. This",
|
|||
|
" instruction must be the rightmost instruction in its rung.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> COIL, SET-ONLY Rname Yname",
|
|||
|
" ----(S)---- ----(S)----",
|
|||
|
"",
|
|||
|
" If the signal going into the instruction is true, then the given",
|
|||
|
" internal relay or output pin is set true. Otherwise the internal",
|
|||
|
" relay or output pin state is not changed. This instruction can only",
|
|||
|
" change the state of a coil from false to true, so it is typically",
|
|||
|
" used in combination with a reset-only coil. This instruction must",
|
|||
|
" be the rightmost instruction in its rung.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> COIL, RESET-ONLY Rname Yname",
|
|||
|
" ----(R)---- ----(R)----",
|
|||
|
"",
|
|||
|
" If the signal going into the instruction is true, then the given",
|
|||
|
" internal relay or output pin is cleared false. Otherwise the",
|
|||
|
" internal relay or output pin state is not changed. This instruction",
|
|||
|
" instruction can only change the state of a coil from true to false,",
|
|||
|
" so it is typically used in combination with a set-only coil. This",
|
|||
|
" instruction must be the rightmost instruction in its rung.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> TURN-ON DELAY Tdon ",
|
|||
|
" -[TON 1.000 s]-",
|
|||
|
"",
|
|||
|
" When the signal going into the instruction goes from false to true,",
|
|||
|
" the output signal stays false for 1.000 s before going true. When the",
|
|||
|
" signal going into the instruction goes from true to false, the output",
|
|||
|
" signal goes false immediately. The timer is reset every time the input",
|
|||
|
" goes false; the input must stay true for 1000 consecutive milliseconds",
|
|||
|
" before the output will go true. The delay is configurable.",
|
|||
|
"",
|
|||
|
" The `Tname' variable counts up from zero in units of scan times. The",
|
|||
|
" TON instruction outputs true when the counter variable is greater",
|
|||
|
" than or equal to the given delay. It is possible to manipulate the",
|
|||
|
" counter variable elsewhere, for example with a MOV instruction.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> TURN-OFF DELAY Tdoff ",
|
|||
|
" -[TOF 1.000 s]-",
|
|||
|
"",
|
|||
|
" When the signal going into the instruction goes from true to false,",
|
|||
|
" the output signal stays true for 1.000 s before going false. When",
|
|||
|
" the signal going into the instruction goes from false to true,",
|
|||
|
" the output signal goes true immediately. The timer is reset every",
|
|||
|
" time the input goes false; the input must stay false for 1000",
|
|||
|
" consecutive milliseconds before the output will go false. The delay",
|
|||
|
" is configurable.",
|
|||
|
"",
|
|||
|
" The `Tname' variable counts up from zero in units of scan times. The",
|
|||
|
" TON instruction outputs true when the counter variable is greater",
|
|||
|
" than or equal to the given delay. It is possible to manipulate the",
|
|||
|
" counter variable elsewhere, for example with a MOV instruction.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> RETENTIVE TIMER Trto ",
|
|||
|
" -[RTO 1.000 s]-",
|
|||
|
"",
|
|||
|
" This instruction keeps track of how long its input has been true. If",
|
|||
|
" its input has been true for at least 1.000 s, then the output is",
|
|||
|
" true. Otherwise the output is false. The input need not have been",
|
|||
|
" true for 1000 consecutive milliseconds; if the input goes true",
|
|||
|
" for 0.6 s, then false for 2.0 s, and then true for 0.4 s, then the",
|
|||
|
" output will go true. After the output goes true it will stay true",
|
|||
|
" even after the input goes false, as long as the input has been true",
|
|||
|
" for longer than 1.000 s. This timer must therefore be reset manually,",
|
|||
|
" using the reset instruction.",
|
|||
|
"",
|
|||
|
" The `Tname' variable counts up from zero in units of scan times. The",
|
|||
|
" TON instruction outputs true when the counter variable is greater",
|
|||
|
" than or equal to the given delay. It is possible to manipulate the",
|
|||
|
" counter variable elsewhere, for example with a MOV instruction.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> RESET Trto Citems",
|
|||
|
" ----{RES}---- ----{RES}----",
|
|||
|
"",
|
|||
|
" This instruction resets a timer or a counter. TON and TOF timers are",
|
|||
|
" automatically reset when their input goes false or true, so RES is",
|
|||
|
" not required for these timers. RTO timers and CTU/CTD counters are",
|
|||
|
" not reset automatically, so they must be reset by hand using a RES",
|
|||
|
" instruction. When the input is true, the counter or timer is reset;",
|
|||
|
" when the input is false, no action is taken. This instruction must",
|
|||
|
" be the rightmost instruction in its rung.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> ONE-SHOT RISING _",
|
|||
|
" --[OSR_/ ]--",
|
|||
|
"",
|
|||
|
" This instruction normally outputs false. If the instruction's input",
|
|||
|
" is true during this scan and it was false during the previous scan",
|
|||
|
" then the output is true. It therefore generates a pulse one scan",
|
|||
|
" wide on each rising edge of its input signal. This instruction is",
|
|||
|
" useful if you want to trigger events off the rising edge of a signal.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> ONE-SHOT FALLING _",
|
|||
|
" --[OSF \\_]--",
|
|||
|
"",
|
|||
|
" This instruction normally outputs false. If the instruction's input",
|
|||
|
" is false during this scan and it was true during the previous scan",
|
|||
|
" then the output is true. It therefore generates a pulse one scan",
|
|||
|
" wide on each falling edge of its input signal. This instruction is",
|
|||
|
" useful if you want to trigger events off the falling edge of a signal.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> SHORT CIRCUIT, OPEN CIRCUIT",
|
|||
|
" ----+----+---- ----+ +----",
|
|||
|
"",
|
|||
|
" The output condition of a short-circuit is always equal to its",
|
|||
|
" input condition. The output condition of an open-circuit is always",
|
|||
|
" false. These are mostly useful for debugging.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> MASTER CONTROL RELAY",
|
|||
|
" -{MASTER RLY}-",
|
|||
|
"",
|
|||
|
" By default, the rung-in condition of every rung is true. If a master",
|
|||
|
" control relay instruction is executed with a rung-in condition of",
|
|||
|
" false, then the rung-in condition for all following rungs becomes",
|
|||
|
" false. This will continue until the next master control relay",
|
|||
|
" instruction is reached (regardless of the rung-in condition of that",
|
|||
|
" instruction). These instructions must therefore be used in pairs:",
|
|||
|
" one to (maybe conditionally) start the possibly-disabled section,",
|
|||
|
" and one to end it.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> MOVE {destvar := } {Tret := }",
|
|||
|
" -{ 123 MOV}- -{ srcvar MOV}-",
|
|||
|
"",
|
|||
|
" When the input to this instruction is true, it sets the given",
|
|||
|
" destination variable equal to the given source variable or",
|
|||
|
" constant. When the input to this instruction is false nothing",
|
|||
|
" happens. You can assign to any variable with the move instruction;",
|
|||
|
" this includes timer and counter state variables, which can be",
|
|||
|
" distinguished by the leading `T' or `C'. For example, an instruction",
|
|||
|
" moving 0 into `Tretentive' is equivalent to a reset (RES) instruction",
|
|||
|
" for that timer. This instruction must be the rightmost instruction",
|
|||
|
" in its rung.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> ARITHMETIC OPERATION {ADD kay :=} {SUB Ccnt :=}",
|
|||
|
" -{ 'a' + 10 }- -{ Ccnt - 10 }-",
|
|||
|
"",
|
|||
|
"> {MUL dest :=} {DIV dv := }",
|
|||
|
" -{ var * -990 }- -{ dv / -10000}-",
|
|||
|
"",
|
|||
|
" When the input to this instruction is true, it sets the given",
|
|||
|
" destination variable equal to the given expression. The operands",
|
|||
|
" can be either variables (including timer and counter variables)",
|
|||
|
" or constants. These instructions use 16 bit signed math. Remember",
|
|||
|
" that the result is evaluated every cycle when the input condition",
|
|||
|
" true. If you are incrementing or decrementing a variable (i.e. if",
|
|||
|
" the destination variable is also one of the operands) then you",
|
|||
|
" probably don't want that; typically you would use a one-shot so that",
|
|||
|
" it is evaluated only on the rising or falling edge of the input",
|
|||
|
" condition. Divide truncates; 8 / 3 = 2. This instruction must be",
|
|||
|
" the rightmost instruction in its rung.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> COMPARE [var ==] [var >] [1 >=]",
|
|||
|
" -[ var2 ]- -[ 1 ]- -[ Ton]-",
|
|||
|
"",
|
|||
|
"> [var /=] [-4 < ] [1 <=]",
|
|||
|
" -[ var2 ]- -[ vartwo]- -[ Cup]-",
|
|||
|
"",
|
|||
|
" If the input to this instruction is false then the output is false. If",
|
|||
|
" the input is true then the output is true if and only if the given",
|
|||
|
" condition is true. This instruction can be used to compare (equals,",
|
|||
|
" is greater than, is greater than or equal to, does not equal,",
|
|||
|
" is less than, is less than or equal to) a variable to a variable,",
|
|||
|
" or to compare a variable to a 16-bit signed constant.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> COUNTER Cname Cname",
|
|||
|
" --[CTU >=5]-- --[CTD >=5]--",
|
|||
|
"",
|
|||
|
" A counter increments (CTU, count up) or decrements (CTD, count",
|
|||
|
" down) the associated count on every rising edge of the rung input",
|
|||
|
" condition (i.e. what the rung input condition goes from false to",
|
|||
|
" true). The output condition from the counter is true if the counter",
|
|||
|
" variable is greater than or equal to 5, and false otherwise. The",
|
|||
|
" rung output condition may be true even if the input condition is",
|
|||
|
" false; it only depends on the counter variable. You can have CTU",
|
|||
|
" and CTD instructions with the same name, in order to increment and",
|
|||
|
" decrement the same counter. The RES instruction can reset a counter,",
|
|||
|
" or you can perform general variable operations on the count variable.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> CIRCULAR COUNTER Cname",
|
|||
|
" --{CTC 0:7}--",
|
|||
|
"",
|
|||
|
" A circular counter works like a normal CTU counter, except that",
|
|||
|
" after reaching its upper limit, it resets its counter variable",
|
|||
|
" back to 0. For example, the counter shown above would count 0, 1,",
|
|||
|
" 2, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 2,.... This is useful in",
|
|||
|
" combination with conditional statements on the variable `Cname';",
|
|||
|
" you can use this like a sequencer. CTC counters clock on the rising",
|
|||
|
" edge of the rung input condition condition. This instruction must",
|
|||
|
" be the rightmost instruction in its rung.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> SHIFT REGISTER {SHIFT REG }",
|
|||
|
" -{ reg0..3 }-",
|
|||
|
"",
|
|||
|
" A shift register is associated with a set of variables. For example,",
|
|||
|
" this shift register is associated with the variables `reg0', `reg1',",
|
|||
|
" `reg2', and `reg3'. The input to the shift register is `reg0'. On",
|
|||
|
" every rising edge of the rung-in condition, the shift register will",
|
|||
|
" shift right. That means that it assigns `reg3 := reg2', `reg2 :=",
|
|||
|
" reg1'. and `reg1 := reg0'. `reg0' is left unchanged. A large shift",
|
|||
|
" register can easily consume a lot of memory. This instruction must",
|
|||
|
" be the rightmost instruction in its rung.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> LOOK-UP TABLE {dest := }",
|
|||
|
" -{ LUT[i] }-",
|
|||
|
"",
|
|||
|
" A look-up table is an ordered set of n values. When the rung-in",
|
|||
|
" condition is true, the integer variable `dest' is set equal to the",
|
|||
|
" entry in the lookup table corresponding to the integer variable",
|
|||
|
" `i'. The index starts from zero, so `i' must be between 0 and",
|
|||
|
" (n-1). The behaviour of this instruction is not defined if the",
|
|||
|
" index is outside this range. This instruction must be the rightmost",
|
|||
|
" instruction in its rung.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> PIECEWISE LINEAR TABLE {yvar := }",
|
|||
|
" -{ PWL[xvar] }-",
|
|||
|
"",
|
|||
|
" This is a good way to approximate a complicated function or",
|
|||
|
" curve. It might, for example, be useful if you are trying to apply",
|
|||
|
" a calibration curve to convert a raw output voltage from a sensor",
|
|||
|
" into more convenient units.",
|
|||
|
"",
|
|||
|
" Assume that you are trying to approximate a function that converts",
|
|||
|
" an integer input variable, x, to an integer output variable, y. You",
|
|||
|
" know the function at several points; for example, you might know that",
|
|||
|
"",
|
|||
|
" f(0) = 2",
|
|||
|
" f(5) = 10",
|
|||
|
" f(10) = 50",
|
|||
|
" f(100) = 100",
|
|||
|
"",
|
|||
|
" This means that the points",
|
|||
|
"",
|
|||
|
" (x0, y0) = ( 0, 2)",
|
|||
|
" (x1, y1) = ( 5, 10)",
|
|||
|
" (x2, y2) = ( 10, 50)",
|
|||
|
" (x3, y3) = (100, 100)",
|
|||
|
"",
|
|||
|
" lie on that curve. You can enter those 4 points into a table",
|
|||
|
" associated with the piecewise linear instruction. The piecewise linear",
|
|||
|
" instruction will look at the value of xvar, and set the value of",
|
|||
|
" yvar. It will set yvar in such a way that the piecewise linear curve",
|
|||
|
" will pass through all of the points that you give it; for example,",
|
|||
|
" if you set xvar = 10, then the instruction will set yvar = 50.",
|
|||
|
"",
|
|||
|
" If you give the instruction a value of xvar that lies between two",
|
|||
|
" of the values of x for which you have given it points, then the",
|
|||
|
" instruction will set yvar so that (xvar, yvar) lies on the straight",
|
|||
|
" line connecting those two points in the table. For example, xvar =",
|
|||
|
" 55 gives an output of yvar = 75. (The two points in the table are",
|
|||
|
" (10, 50) and (100, 100). 55 is half-way between 10 and 100, and 75",
|
|||
|
" is half-way between 50 and 100, so (55, 75) lies on the line that",
|
|||
|
" connects those two points.)",
|
|||
|
"",
|
|||
|
" The points must be specified in ascending order by x coordinate. It",
|
|||
|
" may not be possible to perform mathematical operations required for",
|
|||
|
" certain look-up tables using 16-bit integer math; if this is the",
|
|||
|
" case, then LDmicro will warn you. For example, this look up table",
|
|||
|
" will produce an error:",
|
|||
|
"",
|
|||
|
" (x0, y0) = ( 0, 0)",
|
|||
|
" (x1, y1) = (300, 300)",
|
|||
|
"",
|
|||
|
" You can fix these errors by making the distance between points in",
|
|||
|
" the table smaller. For example, this table is equivalent to the one",
|
|||
|
" given above, and it does not produce an error:",
|
|||
|
"",
|
|||
|
" (x0, y0) = ( 0, 0)",
|
|||
|
" (x1, y1) = (150, 150)",
|
|||
|
" (x2, y2) = (300, 300)",
|
|||
|
"",
|
|||
|
" It should hardly ever be necessary to use more than five or six",
|
|||
|
" points. Adding more points makes your code larger and slower to",
|
|||
|
" execute. The behaviour if you pass a value of `xvar' greater than",
|
|||
|
" the greatest x coordinate in the table or less than the smallest x",
|
|||
|
" coordinate in the table is undefined. This instruction must be the",
|
|||
|
" rightmost instruction in its rung.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> A/D CONVERTER READ Aname",
|
|||
|
" --{READ ADC}--",
|
|||
|
"",
|
|||
|
" LDmicro can generate code to use the A/D converters built in to",
|
|||
|
" certain microcontrollers. If the input condition to this instruction",
|
|||
|
" is true, then a single sample from the A/D converter is acquired and",
|
|||
|
" stored in the variable `Aname'. This variable can subsequently be",
|
|||
|
" manipulated with general variable operations (less than, greater than,",
|
|||
|
" arithmetic, and so on). Assign a pin to the `Axxx' variable in the",
|
|||
|
" same way that you would assign a pin to a digital input or output,",
|
|||
|
" by double-clicking it in the list at the bottom of the screen. If",
|
|||
|
" the input condition to this rung is false then the variable `Aname'",
|
|||
|
" is left unchanged.",
|
|||
|
"",
|
|||
|
" For all currently-supported devices, 0 volts input corresponds to",
|
|||
|
" an ADC reading of 0, and an input equal to Vdd (the supply voltage)",
|
|||
|
" corresponds to an ADC reading of 1023. If you are using an AVR, then",
|
|||
|
" connect AREF to Vdd. You can use arithmetic operations to scale the",
|
|||
|
" reading to more convenient units afterwards, but remember that you",
|
|||
|
" are using integer math. In general not all pins will be available",
|
|||
|
" for use with the A/D converter. The software will not allow you to",
|
|||
|
" assign non-A/D pins to an analog input. This instruction must be",
|
|||
|
" the rightmost instruction in its rung.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> SET PWM DUTY CYCLE duty_cycle",
|
|||
|
" -{PWM 32.8 kHz}-",
|
|||
|
"",
|
|||
|
" LDmicro can generate code to use the PWM peripheral built in to",
|
|||
|
" certain microcontrollers. If the input condition to this instruction",
|
|||
|
" is true, then the duty cycle of the PWM peripheral is set to the",
|
|||
|
" value of the variable duty_cycle. The duty cycle must be a number",
|
|||
|
" between 0 and 100; 0 corresponds to always low, and 100 corresponds to",
|
|||
|
" always high. (If you are familiar with how the PWM peripheral works,",
|
|||
|
" then notice that that means that LDmicro automatically scales the",
|
|||
|
" duty cycle variable from percent to PWM clock periods.)",
|
|||
|
"",
|
|||
|
" You can specify the target PWM frequency, in Hz. The frequency that",
|
|||
|
" you specify might not be exactly achievable, depending on how it",
|
|||
|
" divides into the microcontroller's clock frequency. LDmicro will",
|
|||
|
" choose the closest achievable frequency; if the error is large then",
|
|||
|
" it will warn you. Faster speeds may sacrifice resolution.",
|
|||
|
"",
|
|||
|
" This instruction must be the rightmost instruction in its rung.",
|
|||
|
" The ladder logic runtime consumes one timer to measure the cycle",
|
|||
|
" time. That means that PWM is only available on microcontrollers",
|
|||
|
" with at least two suitable timers. PWM uses pin CCP2 (not CCP1)",
|
|||
|
" on PIC16 chips and OC2 (not OC1A) on AVRs.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> MAKE PERSISTENT saved_var",
|
|||
|
" --{PERSIST}--",
|
|||
|
"",
|
|||
|
" When the rung-in condition of this instruction is true, it causes the",
|
|||
|
" specified integer variable to be automatically saved to EEPROM. That",
|
|||
|
" means that its value will persist, even when the micro loses",
|
|||
|
" power. There is no need to explicitly save the variable to EEPROM;",
|
|||
|
" that will happen automatically, whenever the variable changes. The",
|
|||
|
" variable is automatically loaded from EEPROM after power-on reset. If",
|
|||
|
" a variable that changes frequently is made persistent, then the",
|
|||
|
" EEPROM in your micro may wear out very quickly, because it is only",
|
|||
|
" good for a limited (~100 000) number of writes. When the rung-in",
|
|||
|
" condition is false, nothing happens. This instruction must be the",
|
|||
|
" rightmost instruction in its rung.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> UART (SERIAL) RECEIVE var",
|
|||
|
" --{UART RECV}--",
|
|||
|
"",
|
|||
|
" LDmicro can generate code to use the UART built in to certain",
|
|||
|
" microcontrollers. On AVRs with multiple UARTs only UART1 (not",
|
|||
|
" UART0) is supported. Configure the baud rate using Settings -> MCU",
|
|||
|
" Parameters. Certain baud rates may not be achievable with certain",
|
|||
|
" crystal frequencies; LDmicro will warn you if this is the case.",
|
|||
|
"",
|
|||
|
" If the input condition to this instruction is false, then nothing",
|
|||
|
" happens. If the input condition is true then this instruction tries",
|
|||
|
" to receive a single character from the UART. If no character is read",
|
|||
|
" then the output condition is false. If a character is read then its",
|
|||
|
" ASCII value is stored in `var', and the output condition is true",
|
|||
|
" for a single PLC cycle.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> UART (SERIAL) SEND var",
|
|||
|
" --{UART SEND}--",
|
|||
|
"",
|
|||
|
" LDmicro can generate code to use the UARTs built in to certain",
|
|||
|
" microcontrollers. On AVRS with multiple UARTs only UART1 (not",
|
|||
|
" UART0) is supported. Configure the baud rate using Settings -> MCU",
|
|||
|
" Parameters. Certain baud rates may not be achievable with certain",
|
|||
|
" crystal frequencies; LDmicro will warn you if this is the case.",
|
|||
|
"",
|
|||
|
" If the input condition to this instruction is false, then nothing",
|
|||
|
" happens. If the input condition is true then this instruction writes",
|
|||
|
" a single character to the UART. The ASCII value of the character to",
|
|||
|
" send must previously have been stored in `var'. The output condition",
|
|||
|
" of the rung is true if the UART is busy (currently transmitting a",
|
|||
|
" character), and false otherwise.",
|
|||
|
"",
|
|||
|
" Remember that characters take some time to transmit. Check the output",
|
|||
|
" condition of this instruction to ensure that the first character has",
|
|||
|
" been transmitted before trying to send a second character, or use",
|
|||
|
" a timer to insert a delay between characters. You must only bring",
|
|||
|
" the input condition true (try to send a character) when the output",
|
|||
|
" condition is false (UART is not busy).",
|
|||
|
"",
|
|||
|
" Investigate the formatted string instruction (next) before using this",
|
|||
|
" instruction. The formatted string instruction is much easier to use,",
|
|||
|
" and it is almost certainly capable of doing what you want.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"> FORMATTED STRING OVER UART var",
|
|||
|
" -{\"Pressure: \\3\\r\\n\"}-",
|
|||
|
"",
|
|||
|
" LDmicro can generate code to use the UARTs built in to certain",
|
|||
|
" microcontrollers. On AVRS with multiple UARTs only UART1 (not",
|
|||
|
" UART0) is supported. Configure the baud rate using Settings -> MCU",
|
|||
|
" Parameters. Certain baud rates may not be achievable with certain",
|
|||
|
" crystal frequencies; LDmicro will warn you if this is the case.",
|
|||
|
"",
|
|||
|
" When the rung-in condition for this instruction goes from false to",
|
|||
|
" true, it starts to send an entire string over the serial port. If",
|
|||
|
" the string contains the special sequence `\\3', then that sequence",
|
|||
|
" will be replaced with the value of `var', which is automatically",
|
|||
|
" converted into a string. The variable will be formatted to take",
|
|||
|
" exactly 3 characters; for example, if `var' is equal to 35, then",
|
|||
|
" the exact string printed will be `Pressure: 35\\r\\n' (note the extra",
|
|||
|
" space). If instead `var' were equal to 1432, then the behaviour would",
|
|||
|
" be undefined, because 1432 has more than three digits. In that case",
|
|||
|
" it would be necessary to use `\\4' instead.",
|
|||
|
"",
|
|||
|
" If the variable might be negative, then use `\\-3d' (or `\\-4d'",
|
|||
|
" etc.) instead. That will cause LDmicro to print a leading space for",
|
|||
|
" positive numbers, and a leading minus sign for negative numbers.",
|
|||
|
"",
|
|||
|
" If multiple formatted string instructions are energized at once",
|
|||
|
" (or if one is energized before another completes), or if these",
|
|||
|
" instructions are intermixed with the UART TX instructions, then the",
|
|||
|
" behaviour is undefined.",
|
|||
|
"",
|
|||
|
" It is also possible to use this instruction to output a fixed string,",
|
|||
|
" without interpolating an integer variable's value into the text that",
|
|||
|
" is sent over serial. In that case simply do not include the special",
|
|||
|
" escape sequence.",
|
|||
|
"",
|
|||
|
" Use `\\\\' for a literal backslash. In addition to the escape sequence",
|
|||
|
" for interpolating an integer variable, the following control",
|
|||
|
" characters are available:",
|
|||
|
" * \\r -- carriage return",
|
|||
|
" * \\n -- newline",
|
|||
|
" * \\f -- formfeed",
|
|||
|
" * \\b -- backspace",
|
|||
|
" * \\xAB -- character with ASCII value 0xAB (hex)",
|
|||
|
"",
|
|||
|
" The rung-out condition of this instruction is true while it is",
|
|||
|
" transmitting data, else false. This instruction consumes a very",
|
|||
|
" large amount of program memory, so it should be used sparingly. The",
|
|||
|
" present implementation is not efficient, but a better one will",
|
|||
|
" require modifications to all the back-ends.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"A NOTE ON USING MATH",
|
|||
|
"====================",
|
|||
|
"",
|
|||
|
"Remember that LDmicro performs only 16-bit integer math. That means",
|
|||
|
"that the final result of any calculation that you perform must be an",
|
|||
|
"integer between -32768 and 32767. It also mean that the intermediate",
|
|||
|
"results of your calculation must all be within that range.",
|
|||
|
"",
|
|||
|
"For example, let us say that you wanted to calculate y = (1/x)*1200,",
|
|||
|
"where x is between 1 and 20. Then y goes between 1200 and 60, which",
|
|||
|
"fits into a 16-bit integer, so it is at least in theory possible to",
|
|||
|
"perform the calculation. There are two ways that you might code this:",
|
|||
|
"you can perform the reciprocal, and then multiply:",
|
|||
|
"",
|
|||
|
" || {DIV temp :=} ||",
|
|||
|
" ||---------{ 1 / x }----------||",
|
|||
|
" || ||",
|
|||
|
" || {MUL y := } ||",
|
|||
|
" ||----------{ temp * 1200}----------||",
|
|||
|
" || ||",
|
|||
|
"",
|
|||
|
"Or you could just do the division directly, in a single step:",
|
|||
|
"",
|
|||
|
" || {DIV y :=} ||",
|
|||
|
" ||-----------{ 1200 / x }-----------||",
|
|||
|
"",
|
|||
|
"Mathematically, these two are equivalent; but if you try them, then you",
|
|||
|
"will find that the first one gives an incorrect result of y = 0. That",
|
|||
|
"is because the variable `temp' underflows. For example, when x = 3,",
|
|||
|
"(1 / x) = 0.333, but that is not an integer; the division operation",
|
|||
|
"approximates this as temp = 0. Then y = temp * 1200 = 0. In the second",
|
|||
|
"case there is no intermediate result to underflow, so everything works.",
|
|||
|
"",
|
|||
|
"If you are seeing problems with your math, then check intermediate",
|
|||
|
"results for underflow (or overflow, which `wraps around'; for example,",
|
|||
|
"32767 + 1 = -32768). When possible, choose units that put values in",
|
|||
|
"a range of -100 to 100.",
|
|||
|
"",
|
|||
|
"When you need to scale a variable by some factor, do it using a multiply",
|
|||
|
"and a divide. For example, to scale y = 1.8*x, calculate y = (9/5)*x",
|
|||
|
"(which is the same, since 1.8 = 9/5), and code this as y = (9*x)/5,",
|
|||
|
"performing the multiplication first:",
|
|||
|
"",
|
|||
|
" || {MUL temp :=} ||",
|
|||
|
" ||---------{ x * 9 }----------||",
|
|||
|
" || ||",
|
|||
|
" || {DIV y :=} ||",
|
|||
|
" ||-----------{ temp / 5 }-----------||",
|
|||
|
"",
|
|||
|
"This works for all x < (32767 / 9), or x < 3640. For larger values of x,",
|
|||
|
"the variable `temp' would overflow. There is a similar lower limit on x.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"CODING STYLE",
|
|||
|
"============",
|
|||
|
"",
|
|||
|
"I allow multiple coils in parallel in a single rung. This means that",
|
|||
|
"you can do things like this:",
|
|||
|
"",
|
|||
|
" || Xa Ya ||",
|
|||
|
" 1 ||-------] [--------------( )-------||",
|
|||
|
" || ||",
|
|||
|
" || Xb Yb ||",
|
|||
|
" ||-------] [------+-------( )-------||",
|
|||
|
" || | ||",
|
|||
|
" || | Yc ||",
|
|||
|
" || +-------( )-------||",
|
|||
|
" || ||",
|
|||
|
"",
|
|||
|
"Instead of this:",
|
|||
|
"",
|
|||
|
" || Xa Ya ||",
|
|||
|
" 1 ||-------] [--------------( )-------||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || Xb Yb ||",
|
|||
|
" 2 ||-------] [--------------( )-------||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || Xb Yc ||",
|
|||
|
" 3 ||-------] [--------------( )-------||",
|
|||
|
" || ||",
|
|||
|
"",
|
|||
|
"This means that in theory you could write any program as one giant rung,",
|
|||
|
"and there is no need to use multiple rungs at all. In practice that",
|
|||
|
"would be a bad idea, because as rungs become more complex they become",
|
|||
|
"more difficult to edit without deleting and redrawing a lot of logic.",
|
|||
|
"",
|
|||
|
"Still, it is often a good idea to group related logic together as a single",
|
|||
|
"rung. This generates nearly identical code to if you made separate rungs,",
|
|||
|
"but it shows that they are related when you look at them on the ladder",
|
|||
|
"diagram.",
|
|||
|
"",
|
|||
|
" * * *",
|
|||
|
"",
|
|||
|
"In general, it is considered poor form to write code in such a way that",
|
|||
|
"its output depends on the order of the rungs. For example, this code",
|
|||
|
"isn't very good if both Xa and Xb might ever be true:",
|
|||
|
"",
|
|||
|
" || Xa {v := } ||",
|
|||
|
" 1 ||-------] [--------{ 12 MOV}--||",
|
|||
|
" || ||",
|
|||
|
" || Xb {v := } ||",
|
|||
|
" ||-------] [--------{ 23 MOV}--||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || ||",
|
|||
|
" || [v >] Yc ||",
|
|||
|
" 2 ||------[ 15]-------------( )-------||",
|
|||
|
" || ||",
|
|||
|
"",
|
|||
|
"I will break this rule if in doing so I can make a piece of code",
|
|||
|
"significantly more compact, though. For example, here is how I would",
|
|||
|
"convert a 4-bit binary quantity on Xb3:0 into an integer:",
|
|||
|
"",
|
|||
|
" || {v := } ||",
|
|||
|
" 3 ||-----------------------------------{ 0 MOV}--||",
|
|||
|
" || ||",
|
|||
|
" || Xb0 {ADD v :=} ||",
|
|||
|
" ||-------] [------------------{ v + 1 }-----------||",
|
|||
|
" || ||",
|
|||
|
" || Xb1 {ADD v :=} ||",
|
|||
|
" ||-------] [------------------{ v + 2 }-----------||",
|
|||
|
" || ||",
|
|||
|
" || Xb2 {ADD v :=} ||",
|
|||
|
" ||-------] [------------------{ v + 4 }-----------||",
|
|||
|
" || ||",
|
|||
|
" || Xb3 {ADD v :=} ||",
|
|||
|
" ||-------] [------------------{ v + 8 }-----------||",
|
|||
|
" || ||",
|
|||
|
"",
|
|||
|
"If the MOV statement were moved to the bottom of the rung instead of the",
|
|||
|
"top, then the value of v when it is read elsewhere in the program would",
|
|||
|
"be 0. The output of this code therefore depends on the order in which",
|
|||
|
"the instructions are evaluated. Considering how cumbersome it would be",
|
|||
|
"to code this any other way, I accept that.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"BUGS",
|
|||
|
"====",
|
|||
|
"",
|
|||
|
"LDmicro does not generate very efficient code; it is slow to execute, and",
|
|||
|
"wasteful of flash and RAM. In spite of this, a mid-sized PIC or AVR can",
|
|||
|
"do everything that a small PLC can, so this does not bother me very much.",
|
|||
|
"",
|
|||
|
"The maximum length of variable names is highly limited. This is so that",
|
|||
|
"they fit nicely onto the ladder diagram, so I don't see a good solution",
|
|||
|
"to that.",
|
|||
|
"",
|
|||
|
"If your program is too big for the time, program memory, or data memory",
|
|||
|
"constraints of the device that you have chosen then you probably won't",
|
|||
|
"get an error. It will just screw up somewhere.",
|
|||
|
"",
|
|||
|
"Careless programming in the file load/save routines probably makes it",
|
|||
|
"possible to crash or execute arbitrary code given a corrupt or malicious",
|
|||
|
".ld file.",
|
|||
|
"",
|
|||
|
"Please report additional bugs or feature requests to the author.",
|
|||
|
"",
|
|||
|
"Thanks to:",
|
|||
|
" * Marcelo Solano, for reporting a UI bug under Win98",
|
|||
|
" * Serge V. Polubarjev, for not only noticing that RA3:0 on the",
|
|||
|
" PIC16F628 didn't work but also telling me how to fix it",
|
|||
|
" * Maxim Ibragimov, for reporting and diagnosing major problems",
|
|||
|
" with the till-then-untested ATmega16 and ATmega162 targets",
|
|||
|
" * Bill Kishonti, for reporting that the simulator crashed when the",
|
|||
|
" ladder logic program divided by zero",
|
|||
|
" * Mohamed Tayae, for reporting that persistent variables were broken",
|
|||
|
" on the PIC16F628",
|
|||
|
" * David Rothwell, for reporting several user interface bugs and a",
|
|||
|
" problem with the \"Export as Text\" function",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"COPYING, AND DISCLAIMER",
|
|||
|
"=======================",
|
|||
|
"",
|
|||
|
"DO NOT USE CODE GENERATED BY LDMICRO IN APPLICATIONS WHERE SOFTWARE",
|
|||
|
"FAILURE COULD RESULT IN DANGER TO HUMAN LIFE OR DAMAGE TO PROPERTY. THE",
|
|||
|
"AUTHOR ASSUMES NO LIABILITY FOR ANY DAMAGES RESULTING FROM THE OPERATION",
|
|||
|
"OF LDMICRO OR CODE GENERATED BY LDMICRO.",
|
|||
|
"",
|
|||
|
"This program is free software: you can redistribute it and/or modify it",
|
|||
|
"under the terms of the GNU General Public License as published by the",
|
|||
|
"Free Software Foundation, either version 3 of the License, or (at your",
|
|||
|
"option) any later version.",
|
|||
|
"",
|
|||
|
"This program is distributed in the hope that it will be useful, but",
|
|||
|
"WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY",
|
|||
|
"or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License",
|
|||
|
"for more details.",
|
|||
|
"",
|
|||
|
"You should have received a copy of the GNU General Public License along",
|
|||
|
"with this program. If not, see <http://www.gnu.org/licenses/>.",
|
|||
|
"",
|
|||
|
"",
|
|||
|
"Jonathan Westhues",
|
|||
|
"",
|
|||
|
"Rijswijk -- Dec 2004",
|
|||
|
"Waterloo ON -- Jun, Jul 2005",
|
|||
|
"Cambridge MA -- Sep, Dec 2005",
|
|||
|
" Feb, Mar 2006",
|
|||
|
" Feb 2007",
|
|||
|
"Seattle WA -- Feb 2009",
|
|||
|
"",
|
|||
|
"Email: user jwesthues, at host cq.cx",
|
|||
|
"",
|
|||
|
"",
|
|||
|
NULL
|
|||
|
};
|
|||
|
#endif
|
|||
|
|