English Svenska Driver for Generic PROFIBUS DP Manual MA00622 2002-02
Contents Contents 1 Introduction... 3 2 Install and update driver... 4 2.1 Installation of driver using Internet...4 2.2 Installation of driver from disk...4 3 Connecting the operator terminal to the controller... 5 3.1 Settings in the programming tool...5 3.2 Master program example...8 3.3 Transfer the driver to the operator terminal...9 3.4 Connecting the terminal to the PROFIBUS DP network...10 3.5 Configuration files...10 4 Addressing... 11 5 Appendix... 12 5.1 Error messages...12 6 Drawings... 13
Introduction 1 Introduction This manual describes how to install and handle the generic PROFIBUS DP-slave driver. A PROFIBUS DP expansion card must be installed in the operator terminal. See the manual for the expansion card for further information. The functions in the operator terminals and in the programming tool for the operator terminals are described in the manual for the operator terminals and the programming tool. The generic PROFIBUS DP driver can be used with PROFIBUS DP masters. 3
Install and update driver 2 Install and update driver When installing the programming tool the drivers available at the time of release are installed too. A new driver can be added into the programming tool either with the programming tool using an Internet connection or from disk. A driver can be updated to a newer version similarly. 2.1 Installation of driver using Internet To update available drivers to the latest version or to install new drivers, the function File/Update terminal drivers/from Internet in the programming tool can be used. All projects must be closed prior to using this function, and the computer must be able to connect to Internet. A browser is not required. When the connection is established all drivers that can be downloaded to the computer from Internet are listed. The list states the version number of available and installed drivers. Select which drivers to install, and then click Download. The function Mark Newer will mark all drivers available in a newer version than the ones installed, and the drivers not installed. Each driver is approximately 500 kb, and ready to use when the download is finished. 2.2 Installation of driver from disk To update available drivers to the latest version or to install new drivers, the function File/Update terminal drivers/from Disk in the programming tool can be used. All projects must be closed prior to using this function. Select the folder with the new driver and open the mpd-file. All drivers that can be installed are listed, and the version number of available drivers and the version number of installed drivers are stated. Select which drivers to install into the programming tool, and then select Install. The function Mark Newer will mark all drivers available in a newer version than the ones installed, and the drivers not installed. 4
Connecting the operator terminal to the controller 3 Connecting the operator terminal to the controller 3.1 Settings in the programming tool For communication via the PROFIBUS DP protocol the following settings must be made in the programming tool for the operator terminals. Driver selection Choosing File/New creates a new project and displays the dialog Project Settings. In an existing project, the dialog is displayed by selecting File/Project Settings. Click Change under Controller systems to display available drivers. Choose Brand name, Protocol and Model, and click OK. Click OK once more to confirm the project settings. Communication setup The settings for the communication via PROFIBUS DP are made under Setup/ Peripherals. Make sure that the PROFIBUS DP expansion card is installed in the project according to the manual for the expansion card. 5
Connecting the operator terminal to the controller PROFIBUS DP In PROFIBUS DP there are two data streams. One goes from master to slave and the other from slave to master. This means that the master can not modify the I, IB, IW and ID devices (I-values) and the terminal can not modify Q, QB, QW and QD devices (Q-values). To be able to both read and write a device in the terminal use Bidirectional communication. Bidirectional communication With Bidirectional communication a device in the terminal can be read from and written to. Select the driver name under Setup/Peripherals and click Edit. Now Settings in the Driver Configuration dialog is displayed. If Bidirectional communication is checked, the terminal will copy changed Q-values to the I-values. The same has to be done in the master, see section Master program example. The area of Q- and I-values has to be specified to be bidirectional. The area size is from Start address to and including the End address, for example: Start address: 0 End address: 15 These settings will enable Bidirectional communication for the first eight words. 6
Connecting the operator terminal to the controller Data format Select the driver name under Setup/Peripherals and click Edit. Then click on the tab Data format. Now the Driver Configuration dialog with Data format, which is the byte and word swapping the terminal performs, is displayed. Select current data format according to the PROFIBUS DP master. 7
Connecting the operator terminal to the controller 3.2 Master program example Scheme of a program that is necessary in the master when using Bidirectional communication. Note! Only valid when Bidirectional communication is checked. Note! Do not copy any values at startup because all values are set to zero at startup. Create a mirror area in the memory to compare inputs with. Program start The first second after startup No Yes Values are compared and copied as they are used in the memory. If for example byte 2 and 3 are used as a word (16-bits) use word compare and word copy. Note! This function (step 3, 4 and 5) should only be used on the bytes specified under Bidirectional communication in the terminal. Compare input value with mirror value Copy input value to mirror value and output value More values to copy? Not equal Equal Yes No After the compare and copy function (step 3, 4 and 5) is executed you can in the rest of the program modify the values in the output area as you like. Execute the rest of the program. Modify output values when appropriate Program end 8
Connecting the operator terminal to the controller 3.3 Transfer the driver to the operator terminal The selected driver is downloaded to the operator terminal when the project is transferred to the terminal. Select Transfer/Project. There are three alternatives when the driver is downloaded to the terminal. Function Never Always Automatic Description The driver is not downloaded and the existing driver in the terminal is used. The driver is downloaded every time the project is transferred. The driver is only downloaded if the driver in the terminal is not the same as the selected driver in the project. 9
Connecting the operator terminal to the controller 3.4 Connecting the terminal to the PROFIBUS DP network The operator terminal is connected to the PROFIBUS DP network via the PROFIBUS DP expansion card, i.e. a terminal with at least one expansion slot and a PROFIBUS DP expansion card is needed. Cable for PROFIBUS DP Station 1 Station 2 RxD/TxD-P (3) (3) RxD/TxD-P DGND (5) RxD/TxD-N (8) (5) DGND (8) RxD/TxD-N Ground Screen Ground Technical data I/O area size 32-200 bytes Baudrate 9600 bit/s - 12 Mbit/s Identity code 1002 Max. number of nodes without repeater 32 Max. number of nodes with repeater 96 Max. cable length (with repeater) 3000 m, 9.6 kb Max. cable length (without repeater) 200 m, 12 Mb The cable Unitronic-Bus L2/F.I.P is tested and has the following performance: Capacitance Impedance Resistance 30 nf/km 150 ohm (3-20 MHz) 115 ohm/km 3.5 Configuration files GSD-files for the PFOFIBUS DP slave (the terminal) are available on the type disc for the expansion card or on our web site. If the files are not available on the web site please contact your local dealer. 10
Addressing 4 Addressing Following devices can be addressed: Digital objects: Device Max address Comment Example Irr.bb I199.7 Bit bb in input byte rr I1.2 Qrr.bb Q199.7 Bit bb in output byte rr (Read Q1.2 only) Bbb B63 Internal bit B1 Special comments about digital objects: The I and Q-devices have byte oriented addressing. Qrr.bb are the outputs of the master, these devices are read only in the terminal. Irr.bb are the inputs of the master, this devices can be written to but doesn't show the true value in the master, only the last written value in the terminal. Bbb is internal bits of the terminal. Analog objects: Device Max address Comment Example Ibrr IB199 Input byte rr IB1 QBrr QB199 Output byte rr (Read only) QB1 Iwrr IW198 Input word rr IW2 QWrr QW198 Output word rr (Read only) QW2 Idrr ID196 Input double word rr ID4 QDrr QD196 Output double word rr (Read QD4 only) Rrr RW63 Internal word rr R1 Special comments about analog objects: I- and Q-devices have byte oriented addressing. Q-devices are the outputs of the master. These devices are read only in the terminal. I - devices are the inputs of the master. These devices can be written to, but does not show the true value in the master, only the last written value in the terminal. Rrr is internal words of the terminal. 11
Appendix 5 Appendix 5.1 Error messages Fieldbus is stopped Fieldbus is not running or disconnected. 12
Drawings 6 Drawings 4) Only for units with one serial port (RS-422) and 232-25-ADP (adapter). On all other terminals, not connected. 2) Only for units with 5VDC voltage feed 3) Only for units with one serial port (RS-422) 13
Innehåll Innehåll 1 Introduktion... 3 2 Installation och uppdatering av drivrutin... 4 2.1 Installation av drivrutin via Internet...4 2.2 Installation av drivrutin från disk...4 3 Ansluta operatörsterminalen till styrsystemet... 5 3.1 Inställningar i programmeringsverktyget...5 3.2 Exempel på master-program...8 3.3 Överföra drivrutinen till operatörsterminalen...9 3.4 Ansluta terminalen till PROFIBUS DP nätverket...10 3.5 Konfigurationsfiler...10 4 Adressering... 11 5 Appendix... 12 5.1 Felmeddelanden...12 6 Ritningar... 13
Introduktion 1 Introduktion Manualen beskriver hur drivrutinen för generell PROFIBUS DP-slav installeras och hanteras. Ett expansionskort för PROFIBUS DP måste vara installerat i operatörsterminalen. Se manualen för expansionskortet för ytterligare information. Funktionaliteten i operatörsterminalerna och programmeringsverktyget för operatörsterminalerna beskrivs i manualen för operatörsterminalerna och programmeringsverktyget. Drivrutinen för generell PROFIBUS DP kan användas för att kommunicera med PROFIBUS DP master-enheter. 3
Installation och uppdatering av drivrutin 2 Installation och uppdatering av drivrutin Tillgängliga drivrutiner installeras samtidigt som programmeringsverktyget installeras. En ny drivrutin kan läggas till i programmeringsverktyget antingen från Internet eller från disk. En drivrutin kan uppdateras till nyare version på samma sätt. 2.1 Installation av drivrutin via Internet För att uppdatera befintliga drivrutiner till senaste version eller för att installera nya drivrutiner kan funktionen Arkiv/Uppdatera drivrutiner/från Internet användas. Alla projekt måste stängas innan funktionen används och datorn måste kunna ansluta till Internet. Någon webbläsare behövs inte. När anslutningen är etablerad visas en lista med alla drivrutiner som kan laddas ner till datorn via Internet. I listan visas versionsnummer på tillgängliga och på redan installerade drivrutiner. Markera önskade drivrutiner och välj därefter Ladda ner. Funktionen Markera nyare markerar alla drivrutiner som finns tillgängliga i en senare version, samt drivrutiner som inte är installerade. Varje drivrutin är ungefär 500 kb stor, och kan användas så snart nedladdningen avslutats. 2.2 Installation av drivrutin från disk För att uppdatera tillgängliga drivrutiner till senaste version eller för att installera nya drivrutiner kan funktionen Arkiv/Uppdatera drivrutin/från Disk användas. Alla projekt måste stängas innan funktionen används. Välj den katalog som innehåller den nya drivrutinen och öppna mpd-filen. En lista visas med alla drivrutiner som kan installeras. I listan visas versionsnummer på tillgängliga drivrutiner och versionsnumret på installerade drivrutiner. Markera önskade drivrutiner och välj därefter Ladda ner. Funktionen Markera nyare markerar alla drivrutiner som finns tillgängliga i en senare version, samt drivrutiner som inte är installerade. 4
Ansluta operatörsterminalen till styrsystemet 3 Ansluta operatörsterminalen till styrsystemet 3.1 Inställningar i programmeringsverktyget För kommunikation via protokollet PROFIBUS DP måste följande inställningar göras i programmeringsverktyget för operatörsterminalerna. Val av drivrutin Välj Arkiv/Nytt för att skapa ett nytt projekt. Då visas dialogrutan Projektinställningar. I ett befintligt projekt visas dialogen genom Arkiv/Projektinställningar. Klicka på Ändra under Styrsystem och välj i listan över tillgängliga drivrutiner. Välj Fabrikat, Protokoll och Modell, och klicka OK. Klicka på OK igen för att bekräfta projektinställningarna. Kommunikationsinställningar Inställningarna för kommunikationen via PROFIBUS DP anges under Inställningar/Periferienheter. Se till att expansionskortet för PROFIBUS DP är installerat i projektet enligt manualen för expansionskortet. 5
Ansluta operatörsterminalen till styrsystemet PROFIBUS DP I PROFIBUS DP finns två dataströmmar. Den ena går från master till slav och den andra från slav till master. Detta betyder att mastern inte kan modifiera adresserna I, IB, IW och ID (I-värden) och att terminalen inte kan modifiera adresserna Q, QB, QW och QD (Q-värden). För att både kunna läsa och skriva till en adress i terminalen måste funktionen Bidirectional communication användas. Dubbelriktad kommunikation (Bidirectional communication) Med funktionen Bidirectional communication kan en signal i terminalen både läsas och skrivas till. Välj drivrutin under Inställningar/Periferienheter och klicka på Redigera. Nu visas fliken Settings i dialogen Driver configuration. Vid Bidirectional communication kommer terminalen att kopiera ändringar av Q-värden till I-värdena och samma måste göras i mastern, se avsnittet Exempel på master-program. Arean för Q- och I-värden måste definieras för dubbelriktad kommunikation. Areans storlek anges från Start address till och med End address, till exempel: Start address: 0 End address: 15 Denna inställning möjliggör dubbelriktad kommunikation för de första 8 orden. 6
Ansluta operatörsterminalen till styrsystemet Dataformat Välj drivrutinnamn under Inställningar/Periferienheter och klicka Redigera. Klicka sedan på fliken Data format i dialogen Driver configuration. Under fliken Data format bestäms byte- och ordminnesväxling för terminalen. Välj inställning enligt din PROFIBUS DP master. 7
Ansluta operatörsterminalen till styrsystemet 3.2 Exempel på master-program Schema för ett program som måste finnas i master-enheten då dubbelriktad kommunikation (Bidirectional communication) används. Notera! Gäller endast om funktionen Bidirectional communication är ikryssad. Notera! Kopiera inte några värden under uppstart eftersom alla värden sätts till noll vid uppstart. Skapa en spegel - area i minnet för att jämföra ingångar med. Programstart Första sekunden efter uppstart Nej Ja Värden jämförs och kopieras som de används i minnet. Om t ex byte 2 och 3 används som ord (16-bitars) ska ordjämförelse och ordkopiering användas. Notera! Denna funktion (steg 3, 4 och 5) ska endast användas på de bitar som definierats under Bidirectional communication i terminalen. Jämför ingångsvärde med spegel - värde Kopiera ingångsvärde till spegel -värde och till utgångsvärde Fler värden att kopiera Inte lika med Lika med Ja Nej När jämförelse- och kopieringsfunktionen (steg 3, 4 och 5) exekverats kan, under exekveringen av resten av programmet, värdena i utgångsarean modifieras. Exekvera resten av programmet. Modifiera utgångsvärden när det är lämpligt Programslut 8
Ansluta operatörsterminalen till styrsystemet 3.3 Överföra drivrutinen till operatörsterminalen Drivrutinen laddas ner till terminalen när projektet överförs till terminalen. Välj Överför/Projekt. Det finns tre alternativ för hur drivrutinen ska överföras. Funktion Aldrig Alltid Automatiskt Beskrivning Drivrutinen laddas aldrig, befintlig drivrutin i terminalen används. Drivrutinen laddas varje gång hela projektet överföres. Drivrutinen laddas endast om drivrutinen i terminalen inte är samma som i projektet. 9
Ansluta operatörsterminalen till styrsystemet 3.4 Ansluta terminalen till PROFIBUS DP nätverket Operatörsterminalen ansluts till PROFIBUS nätverket via expansionskortet PROFIBUS DP, d v s en terminal med minst en expansionskortplats och expansionskortet PROFIBUS DP behövs. Kabel för PROFIBUS DP Station 1 Station 2 RxD/TxD-P (3) (3) RxD/TxD-P DGND (5) RxD/TxD-N (8) (5) DGND (8) RxD/TxD-N Jord Skärm Jord Tekniska data I/O-areastorlek 32-200 bytes Överföringshastighet 9600 bit/s - 12 Mbit/s Identitetskod 1002 Max antal noder utan repeater 32 Max antal noder med repeater 96 Max kabellängd (med repeater) 3000 m, 9.6 kb Max kabellängd (utan repeater) 200 m, 12 Mb Kabeln Unitronic-Bus L2/F.I.P har testats och har följande prestanda: Kapacitans Impedans Resistans 30 nf/km 150 Ohm (3-20 MHz) 115 Ohm/km 3.5 Konfigurationsfiler GSD-filer för PFOFIBUS DP-slaven (terminalen) finns tillgängliga på typdisketten för expansionskortet eller på vår hemsida. Finns filerna inte på hemsidan, vänligen kontakta din lokala återförsäljare. 10
Adressering 4 Adressering Följande signaler kan adresseras: Digitala objekt: Signal Max adress Kommentar Exempel Irr.bb I199.7 Bit bb i ingångsbyte rr I1.2 Qrr.bb Q199.7 Bit bb i utgångsbyte rr (Endast läs) Q1.2 Bbb B63 Intern bit B1 Särskilda kommentarer för digitala objekt: I- och Q-signalerna har byte-orienterad adressering. Qrr.bb är utgångar från mastern och kan endast läsas i terminalen. Irr.bb är ingångar till mastern. Dessa signaler kan skrivas till men de uppdateras inte i mastern utan visar endast senast skrivna värdet i terminalen. Bbb är interna bitar i terminalen. Analoga objekt: Signal Max adress Kommentar Example Ibrr IB199 Ingångsbyte rr IB1 QBrr QB199 Utgångsbyte rr (endast läs) QB1 Iwrr IW198 Ingångsord rr IW2 QWrr QW198 Utgångsord rr (endast läs) QW2 Idrr ID196 Ingångsdubbelord rr ID4 QDrr QD196 Utgångsdubbelord rr (endast läs) QD4 Rrr RW63 Interna ord rr R1 Särskilda kommentarer för analoga objekt: I- och Q-signalerna har byte-orienterad adressering. Q-signaler är utgångar från mastern och kan bara läsas i terminalen. I -signaler är ingångar till mastern. Dessa signaler kan skrivas till men de uppdateras inte i mastern utan visar endast senast skrivna värdet i terminalen. Rrr är interna ord i terminalen. 11
Appendix 5 Appendix 5.1 Felmeddelanden Fieldbus is stopped Fältbussen har stannat eller är inte ansluten. 12
Ritningar 6 Ritningar 4) Only for units with one serial port (RS-422) and 232-25-ADP (adapter). On all other terminals, not connected. 2) Only for units with 5VDC voltage feed 3) Only for units with one serial port (RS-422) 13