Getting Started With DirectNET Communications

Transcription

Getting Started withDirectNETCommunications 12 Direct

2–2Getting StartedGetting StartedThe DirectNET BasicsIt’s an Easy-to-useData NETworkDirectNET is an easy-to-use data network for the DirectLOGIC family ofproducts. DirectNET is the perfect choice for those applications requiring data to beshared between programmable controllers (PLCs) or, between PLCs and a hostcomputer. This network operates at speeds up to 38.4Kbps and permits you toupload or download virtually any type of system data. Some examples are:S Timer / Counter DataS I/O InformationS Variable Memory Information (V memory, registers, etc.)It hasAdvantages.DirectNET is a great choice for sharing small amounts of data between networkdevices and has many advantages. You can build a data network with a minimalinvestment in equipment and training because:S The DL430, DL440, DL340, and DL240 Central Processing Units(CPUs) have built-in DirectNET ports.S In the most common applications there is no need for complexcommunications programming. Simple Relay Ladder Logic instructionscan be used to manage the communications, so you don’t have to be anetworking guru to start moving data around.It hasDisadvantages.DirectNET operates asynchronously at speeds up to 38.4K baud. Therefore, it is notthe best choice in an application requiring extremely fast update times and movinglarge amounts of data.

Getting Started2–3How Does it Work? The network is controlled by a master station that issues network commands toindividual slave stations (you cannot “broadcast” a message to all slaves). Thecommands may be used to download data to the slave stations, or upload data fromthe slave stations. The slave stations only respond to requests from the masterstation and cannot initiate communications.Issues Network Commandsto transfer dataRead V1400 from slave 1.Write X0–X15 to slave 3.MasterSlave 1Network ProtocolNetworkSpecificationsSlave 2Slave 3Slave 4DirectNET uses the DirectNET communications protocol, but you don’t have tounderstand the protocol to build the most common network configurations. Adescription of the DirectNET protocol is included in Chapter 6 – DirectNETCommunication Programs.Maximum Number of Slaves90 per master (RS422 Amplifierrequired for over 16 stations)ConfigurationsPoint-to-point, multi-dropInterface TypeSerial RS232C / RS422Half-duplex, Asynchronous operationTransmission Rate300 to 38.4K baudTransmission Distance3300 Feet (1000 meters)ProtocolDirectNETGetting StartedResponds to Network Commands

2–4Getting StartedWhat can I use as a network master station?Getting StartedDL405/DL205 PLCswith a DCM orDL340 CPUThe master stations can be any one ofthe following:S DL430 or DL440 PLCs with a DCMS DL340 CPU (using built-in port)S DL240 PLC with a DCM(A DCM is a Data CommunicationModule.)These master stations use Relay LadderLogic Instructions to initiate thecommunications requests over thenetwork. No complex programming (orknowledge of the DirectNET protocol) isrequired.DCMDL405DL305DL340CPUDL205NOTE: The DL205 DCM was notavailable for shipment at the time of thispublication.Availabilitywillbeannounced at a later date.DCMThe DCM has no internal program and only processes the data transfer requestsfrom the master station CPU. The DCM automatically converts the requests into theappropriate DirectNET commands and issues them to the network.In a master station.issues networkrequestsWriteDataReadDataPLC RequestsData TranferDataRequestResponseDCM automaticallyconverts request toDirectNET Protocol andsends it to the network

Getting StartedOperator InterfaceMany applications utilize a computer toact as a central data collection point andto manage the network requests for datatransfer. The advantage with thisapproach is you can perform manydifferent types of operations with the dataeither before or after a request.The disadvantage is you may have towrite your own communications driverand that can take a considerable amountof time for more complex applications.The communications programming isdifficult unless you have a considerableamount of network programmingexperience. The programs must utilizethe DirectNET protocol used byDirectNET.Operator InterfaceGetting StartedHost ComputerMany operator interfaces can be used asanetworkmasterstationtocommunicate with one or more slavestations. An operator interface musthave a driver that supports theDirectNET protocol.Make sure your operator interface usesone of the following protocols or has adriver for the equipment listed.S DirectNET (DL430, DL440,D4–DCM)S Hostlink (TIt or Simaticr TI425,-430, -435, U-01DM)S CCM2 (GEr Series Onet)Many companies advertise some of theiroperator interface products will operatewith the DirectLOGIC family ofproducts. Check with your operatorinterface supplier to see if they offerversions for use with the DirectLOGIC products.2–5Host Computer

2–6Getting StartedGetting StartedWhat can I use as a network slave station?CPUs with Built-inDirectNET PortOne of the benefits of DirectNET is many of the DirectLOGIC CPUs already havebuilt-in DirectNET ports that can communicate up to 19.2K baud, (38.4K for theDL340). The following CPUs have this feature.S DL430, DL440S DL340S DL240DataCommunicationsModules andDataCommunicationsUnitsEach DirectLOGIC product family has a general purpose communicationsinterface. A DCM for the DL405 and DL205 CPUs and a DCU for the DL305 CPUs.You can use any of the DirectLOGIC PLCs with their appropriate communicationsinterface as a slave station. A few reasons to use a communication interface are:S The communication interfaces (except for the DL305 DCU) allow baudrates of up to 38.4K baud.S You can leave the CPU built-in port open to attach an operator interfaceor programming device.The following communications interfaces are available.S D4–DCM (with DL405 CPUs)S D2–DCM (with DL205 CPUs)S D3–232–DCU and D3–422–DCU (with DL305 CPUs)In a slave station, the DCM responds to requests from the network master station.WriteDataReadDataDataRequestIn a slave station.responds tonetwork requestsPLC RequestsData TranferResponse(a DCU may or may not be requireddepending on the DL305 CPU model chosen.CompatibleProductsThere are also many compatible products from the following families that willcommunicate over DirectNET.S GER Series 1RS Texas Instruments TI305R and TI405RS SimaticR TI305 and TI405

Getting Started2–7The following diagram shows the various combinations of master and slave stationsavailable with a DirectNET solution.DL205 or DL405PLCs with DCMor DL340 CPUOperator InterfaceHost ComputerGetting StartedMasterSlave 1Slave 5Slave 3DL340 CPUDL405 CPUsDL205 CPUportcostTwo built-in DirectNETports yield the lowest costsolutionBuilt-in DirectNETyields the lowestsolutionMaximum baud rate 19.2KRequires an RS232/422converter if multi-dropRequires an RS232/422converter if multi-dropMaximum baud rate 38.4KMaximum baud rate 19.2KBuilt-in DirectNETyields the lowestsolutionSlave 2Slave 4portcostSlave 6DL405 & DCMDL305 & DCUDL205 & DCMExcellent choice if bottom porton DL405 is already being usedUse an RS422 DCU if multi-drop and athird port is required.Excellent choice if bottom porton DL205 is already being usedAllows higher performance withrates up to 38.4K baudMaximum baud rate 19.2K

2–8Getting StartedChoosing a ConfigurationThree BasicConfigurationsGetting StartedPLC as MasterThe network components can be used to create many different network designs.However, all networks use a mixture of three basic configurations. Any of the threeconfigurations can be grouped together or used independently. The type ofconfiguration determines the types of cables, communication parameters, andcommunications programming.This configuration is very easy to use. APLC master / slave configuration utilizesa DirectLOGICE PLC as the networkmaster. A small communicationsprogram and a communicationsinterface (DCM) is required in the masterstation. Slave stations can have built-inDirectNET ports, or, they can havecommunication interfaces.DCMMasterSlavesBuilt-in portHost as MasterDCMA host computer, operator interface, orMasterother intelligent device can be connectedto one or more slave stations. The mastermust contain a program (or driver)capable of issuing network requestsSlavesusing the DirectNET protocol.Slave stations can have built-inDirectNET ports, or, they can havecommunication interfaces (DCMs orDCUs).Built-in portPeer as MasterConfigurationLimitsTwo DL405 PLCs with DCMs as thenetwork interface can be connected soeither station can initiate a request fordata. Both stations must contain acommunications program to initiate therequests for data.This configuration can only be achievedby using DCMs. No other stations can beconnected in this manner.SSSPeer MasterDCMPeer MasterDCMUp to 90 slave stations can be connected to a single master.Only one master is allowed for each portion of the network.A single base can have multiple masters, with each mastercommunicating to its own slave stations.DCM

Getting StartedCombinationNetworks2–9The three types of networks can be combined to solve many different applications.Even though the configurations can be combined in an application, each networkremains independent. The master station from one network cannot request datadirectly from slave stations on another network. This does not mean you cannotobtain data from these networks, you can. It just requires more than one interface forthat slave station. The following diagram shows a simple application using all threetypes of networks, some with multiple interfaces for each station.CombinationNetwork2SSSMaster can initiate read or writewith any slave stationPLC with DCM as masterFull range of slave stationsavailable2 – Host as Master NetworkSSSHost computer (or otherintelligent device) as masterRequires DirectNET programin the hostFull range of slave stationsavailable3 – Peer as Master NetworkSSSTwo stations onlyOnly DL405 DCMsEither station can initiate ÇÇÇÇÇÇÇÇÇÇGetting ÉÉÉ31 – PLC as Master Network ÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉ

2–10Getting StartedWhat communications program should I use?Getting StartedTwo OptionsRLL ProgramsThere are two types of communications programs, RLL instructions or DirectNETprotocol programs. The network configuration determines the type ofcommunications program required.S PLC as Master — The PLC master requires instructions in the RLLprogram to initiate the requests for data.S Peer as Master — Both peer masters require instructions in the RLLprogram. Since both stations contain network instructions, either stationcan initiate a request for data.S Host as Master — Host computers or operator interfaces must executecommunications programs that can issue network commands with theDirectNET protocol. You’ll either have to use a DL405 driver, (thathopefully came with your host software package or operator interface),or you’ll have to create one.The RLL instructions are used to describe and initiate the operation the DCM willprocess. Here’s an example of a simple RLL communications program. Chapter 4provides a detailed description of the instructions.Read ExampleWrite ExampleSP125SetSP125SetY50Communication ErrorSP124Y50Communication ErrorLDK0201Module Not BusyLoad ConstantLDK0003SP124LDK0201Module Not BusyLoad ConstantLDK0003Load ConstantLDAO1400Load ConstantLDAO1400Load AddressRXY0Load AddressWXY0Read DataFromNetworkWrite Data ToNetwork

Getting StartedDirectNETPrograms2–11The communications program used with a hosted network is more complex than thesimple RLL instructions used with the other configurations, but the concept is thesame. The host is the DirectNET master and must use a DirectNET protocolcommunications program to initiate all network requests to read or write data. Thesecommunication programs can be written in many different languages, such asBASIC, C, etc. and must include the appropriate DirectNET protocol commands.Here’s an example of a simple DirectNET program. Chapter 5 provides a detaileddescription of the DirectNET protocol.DirectNET Program in BASICREM Program to read X0–X7 from a DL405 PLC20REM30REM Define all variables40REM50REM Change the slave address in HEX at line 60 if required.60SLAVEADDRESS &H170DATATYPE CHR (&H32)80DATAADDR CHR (&H30) CHR (&H31) CHR (&H30) CHR (&H31)90COMPLETEBLK CHR (&H30) CHR (&H30)100PARTBLK CHR (&H30) CHR (&H32)110MASTERADDR CHR (&H30) CHR (&H30)120NORMAL CHR (&H4E)130SLAVEADDR HEX (SLAVEADDRESS)140IF LEN(SLAVEADDR ) 2 THEN SLAVEADDR ”0” SLAVEADDR 150OFFSETADDR CHR (&H20 SLAVEADDRESS)Getting Started10

2–12Getting StartedHow can I create a network?Getting StartedFollow Four Simple You can easily create a DirectNET network by following four simple steps. Theremainder of this manual provides explanations and examples of these steps.Steps1. Design the network by:S Selecting the configuration(s)S Building the communicationcables.Don’t ignore the importance of this stepbecause it determines the type ofswitch settings and communicationsprogram you should use. Chapter 3provides the details.2. Select the communication settings by:S Setting the master switchesS Setting the slave switchesChapter 4 provides switch settings.3. Write the communication controlprogram.S RLL program with PLC masterorS DirectNET program with hostmasterChapters 5 and 6 provideprogramming Write ProgramStart NetworkRequest4. Start the network operation.Chapter 7 provides a description ofnetwork operation.Configuration and CablesResponse

DL430 or DL440 PLCs with a DCM DL340 CPU (using built-in port) DL240 PLC with a DCM (A DCM is a Data Communication Module.) These master stations use Relay Ladder Logic Instructions to initiate the communications requests over the network. No complex programming (or knowledge of the DirectNET protocol) is required. NOTE: The DL205 DCM was not