<<

ConnectingConnecting ModbusModbus andand LonWorksLonWorks NetworksNetworks

PresentedPresented by:by: GordonGordon MacLachlanMacLachlan (Mac)(Mac) PresentationPresentation HighlightsHighlights ¾Properties of a Network ƒ Data Types and formats ƒ Data Transfer methodologies ¾Properties of a LonWorks Network ƒ Data Types and formats ƒ Data Transfer methodologies ¾Matching up the networks: Dealing with the challenges ƒ Data Resolution ƒ Engineering Units ƒ Simple vs Structured variables ƒ Single vs Block Data Transfer ƒ Master/Slave vs Peer/Peer ƒ Multiple vs single node representation ƒ LonMark vs Modbus-IDA ¾Resources ¾Questions and Answers TheThe ModbusModbus StandardStandard ¾ A truly open standard. ¾ Based on Master/Slave poll and response topology. ¾ An integer protocol, i.e: floating point is not supported by the protocol ¾ Supports 4 basic data types: ¾ Analog Inputs ¾ Analog Outputs (Registers) ¾ Digital Inputs ¾ Digital Outputs (Coils/Flags) ¾ Supports 65535 addresses per data type ¾ Builds NO intelligence into what it is sending, i.e: it does not care what the data in the registers represent. ¾ Worldwide use as the most supported protocol. ModbusModbus MemoryMemory MapMap Address Address Format 1 Format 2 (Modicon style) Data Type (PDU Addressing) Offsets in each data type:0-65535 000 001 Read: Function Code 1, 065 536 Flags (Read/Write) Write Single: Use Function Code 5 Write Multiple: Use function Code 15 100 001 165 536 Digital Inputs (Read Only) Read: Function Code 2, Write Single: N/A Write Multiple: N/A

300 001 Read: Function Code 4 Analog Inputs (Read Only) 365 536 Write Single: N/A Write Multiple: N/A

400 001 Read: Function Code 3 Registers (Read/Write) 465 536 Write Single: Use Function Code 6 Write Multiple: Use function Code 16 ModbusModbus MemoryMemory MapMap Address Address Format 3 New in 2004 modbus Format 2 ADU Addressing spec. (PDU Addressing) Data Type 00001 Read: Function Code 1, Offsets 0-9998 65536 Flags (Read/Write) Write Single: Use Function Code 5 Write Multiple: Use function Code 15

00001 Read: Function Code 2, Offsets 0-9998 65536 Digital Inputs (Read Only) Write Single: N/A Write Multiple: N/A

00001 Read: Function Code 4, Offsets 0-9998 65536 Analog Inputs (Read Only) Write Single: N/A Write Multiple: N/A

00001 Read: Function Code 3, Offsets 0-9998 65536 Registers (Read/Write) Write Single: Use Function Code 6 Specify Data type Write Multiple: Use function Code 16 & address for complete address. ModbusModbus VariationsVariations Variations due to difference in connection medium: ¾ Modbus RTU: Most common Modbus variation. medium is RS-232 or RS-485. Data transferred in hexadecimal format. Only one master allowed. ¾ Modbus ASCII: Uses RS-232 or RS-485. Data is transferred in ASCII format. Only one master allowed. ¾ Modbus TCP: . Data transferred in hexadecimal format using the TCP/IP transport protocol. Allows multiple masters ¾ Modbus Plus: Uses a proprietary medium. Special hardware needed. Allows multiple masters. ¾ All of the above protocols support Modbus in its true format. ModbusModbus VariationsVariations Variations resulting from protocol restrictions:

The following FieldServer drivers are Modbus variants:

‹ Modbus Tekair ‹ Modbus Daniels ‹ Modbus OmniFlow

The manufacturer compensated for Modbus being a 16 integer protocol by providing a method for sending 32 bit values. Many other vendors do this too.

Additionally, FieldServer has a special move function that can assist in decoding these 32 bit variants for use by other protocols. ModbusModbus VariationsVariations Variations resulting from protocol restrictions (JBus):

¾ JBus is no different from extended Modbus, with legal data type addressing from 1-65535 ModbusModbus TCPTCP

¾ Modbus RTU vs Modbus TCP:

¾ Modbus RTU: ¾ Serial protocol using RS-232 or RS-485 as a medium ¾ Devices are addressed by Station Address (Node_ID)

¾ Modbus TCP: ¾ Uses Ethernet. ¾ Modbus RTU + TCP/IP Layer = Modbus TCP ¾ Devices are addressed by IP address and Station address. TCP/IP Modbus RTU string TCP/IP

Modbus TCP ModbusModbus TCPTCP Dealing with Ethernet and Modbus TCP:

¾ User needs to understand subnetting and IP addressing ¾ Using Modbus TCP across subnets requires the use of IP gateways. Gateway address setting in IP configuration becomes important ¾ Modbus TCP uses port 502 to communicate. Important if punching a hole in any firewall for communications. ¾ Modbus TCP uses TCP/IP connection management to allow multiple communications connections making multiple masters on a Modbus TCP Network possible. ModbusModbus TCPTCP ––TroubleshootingTroubleshooting onon EthernetEthernet ¾ Use a good Ethernet capture tool such as Ethereal (free at www.ethereal.com) ¾ For testing, Modscan32 or similar is recommended (www.win-tech.com). Use to emulate a Client on the network and test communications. ¾ Know the network layout, including all subnets, Modbus TCP devices, routers, and firewalls which can influence communications. A detailed network layout diagram is essential. ¾ IP Addressing – does your device ¾ Support IP addressing in conjunction with variable Unit identifier (Node_ID)? ¾ Fix the unit identifier and work with IP addressing only? ¾ Know which variant involved - FieldServer will need to fix its Node_ID to the correct address if the latter is in use. LonWorksLonWorks OverviewOverview LonWorks Addressing

¾ DSN – Domain, Subnet, Node ¾ Typically, the Network Manager assigns the domain address for a network, following which the required subnets for a domain are determined by routers needed in the system. Node addresses on each subnet are then allocated by the Network Manager. ¾ The LNS report utility prints out all DSN addresses for a Domain. LonWorksLonWorks OverviewOverview Network Managers

¾ LonMaker, LonWatcher, and others… ¾ Traditional LonWorks setup requires a network manager ¾ Network manager “binds” data points together, and can then be removed. LonWorksLonWorks OverviewOverview Network Managers

¾ Network Managers allocate addressing on the network ¾ A LonWorks network can be commissioned without a Network Manager, but this requires more advanced techniques. LonWorksLonWorks OverviewOverview Network Variable Types

¾¾ SNVTSNVT –– StandardStandard NetworkNetwork VariableVariable TypeType

¾¾ UNVTUNVT –– UserUser NetworkNetwork VariableVariable TypeType

¾¾ SCPTSCPT –– StandardStandard ConfigurationConfiguration ParameterParameter TypeType

¾¾ UCPTUCPT –– UserUser ConfigurationConfiguration ParameterParameter TypeType LonWorksLonWorks OverviewOverview Data Transfer – Update vs Polled ¾ Update variables send data to a remote device using an event driven mechanism ¾ Event driven mechanisms include: Continuous update, Update on change, and Throttling mode

¾ Polled variables wait to be queried for data, and then respond when queried. ¾ Typically, polled variables operate on a continuous update methodology LonWorksLonWorks OverviewOverview Data Transfer – Implicit vs Explicit

¾ Implicit addressing - network manager assigns addresses for communication and ensures (via address tables in the devices) that communication connections are known.

¾ Explicit addressing - device knows the address of the point in the remote device, and communicates directly without the assistance of the Network Manager. LonWorksLonWorks OverviewOverview XIF files

¾ XIF (external File generated by TAC Menta version 4.0, XIF Version 3 interface) files contain Copyright (c) 2002 by TAC AB interface) files contain All Rights Reserved.Run on 2004-06-08 15:49 information about the 80:00:13:52:00:06:04:6E variables on a device, 2 15 1 31 2 5 2 0 0 2 6 11 13 13 11 3 0 16 11 5 9 13 28 0 0 15 5 3 113 and all the necessary 1 7 1 0 4 4 4 15 200 0 Program_ID 78125 0 0 0 0 0 0 0 0 0 0 0 variable properties. 90 0 240 0 0 0 40 40 0 5 8 5 12 14 15 * "&3.0@0,5 ¾ XIF files go a long way VAR SNVT_ObjReq 0 0 0 0 0 1 63 0 0 0 0 0 0 0 0 0 0 to providing all the "@0|1 92 * 2 SNVT_ID information needed 2 0 0 0 0 1 0 0 1 0 for FieldServer VAR SNVT_ObjState 1 0 0 0 configuration, but do 0 1 63 1 0 0 0 0 0 0 0 0 0 configuration, but do "@0|2 not contain DSN 93 * 26 SNVT_Type 2 0 0 0 0 information. 3 0 1 0 0 LonWorksLonWorks OverviewOverview Neuron ID’s vs Program ID’s ¾ Neuron ID - Uniquely defines the Neuron chip on the network. No two Neuron chips in the world have the same ID. ¾ Program ID - defines an application on a hardware platform, and is possible for two hardware platforms to have the same Program ID because they are running the same application. ¾ If an application changes, then its Program ID must change too. This means when Lon variables are modified in the FieldServer configuration, the Program ID must change. ¾ If the Program ID changes for a device, then that device needs to be removed from a network, and then recommissioned. ¾ The Lesson to be learned: Plan your variable list carefully before commencing with binding. LonWorksLonWorks ConfigurationConfiguration Basic Configuration File (General Parameters):

Define Title and Data Array:

//======// FieldServer Information Bridge Title EC001 FieldServer v1.00a

//======// Data Arrays Data_Arrays Data_Array_Name Data_Format Data_Array_Length DA_Temps FLOAT 10 LonWorksLonWorks ConfigurationConfiguration Basic Configuration File (Connection Information):

Define Connection and Node:

//======// LonWorks Connection Connections Adapter Protocol Lonworks Lonworks

//======// LonWorks Node Nodes Node_Name Protocol EC001 Lonworks LonWorksLonWorks ConfigurationConfiguration Basic Configuration File (Mapping):

Define SNVT’s (Map them to the Data Array):

//======// LonWorks Map Descriptors Map_Descriptors Data_Array_ Data_Array_ Node_ Map_Descriptor_Name Name Offset Lon_Function Function Name SNVT_Type nviSpaceTmp DA_Temps 0 NVUI Server EC001 SNVT_temp_p nvoSpaceTmp DA_Temps 1 NVUOIMX wrbx EC001 SNVT_temp_p LonworksLonworks ConfigurationConfiguration XIF for Basic Configuration File : fserver.xif:

File: fserver-2.xif generated by LonDriver Revision 1.20(g), XIF Version 4.0 Copyright (c) 2000-2004 by FieldServer Technologies All Rights Reserved. Run on Tue Jul 26 07:58:26 2005

80:00:95:47:1E:02:04:36 2 15 1 2 0 14 11 3 3 12 14 11 11 11 11 3 0 16 63 0 1 11 2 0 5 7 13 28 0 0 15 5 3 109 63 1 7 1 0 4 4 4 15 200 0 78125 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 5 8 5 12 14 15 * "EC001 FieldServer v1.00a

VAR nviSpaceTmp 0 0 0 0 0 1 63 0 0 0 0 0 0 0 0 0 0 * 105 * 1 2 0 0 1 0 VAR nvoSpaceTmp 1 0 0 0 0 1 63 1 0 0 0 0 0 0 0 0 0 * 105 * 1 2 0 0 1 0 LonworksLonworks ConfigurationConfiguration Commissioning EC001 into LonMaker : Step 1: Load config into FieldServer and reboot FieldServer Step 2: Open a project in LonMaker Step 3: Drag device into Visio drawing. Step 4: Complete the device commissioning wizard. LonworksLonworks ConfigurationConfiguration Commissioning EC001 into LonMaker :

Step 5: Press the Service Pin on the FieldServer, wait for EC001 to commission. Step 6: Drag a Function Block into Visio LonworksLonworks ConfigurationConfiguration Commissioning EC001 into LonMaker :

The end result: You are now ready to bind to other devices using the “Connector” Tool.

TranslationTranslation ChallengesChallenges Data Resolution THE CHALLENGE ¾ LonWorks ¾ Supports data types from 8-bit through to 64-bit and allows for corresponding resolutions in the different SNVT’s ¾ LonWorks has two common SNVT’s to manage binary data transfer: SNVT_switch and SNVT_state. Both are 16-bit SNVT’s. SNVT_switch is more popular. ¾ Modbus ¾ Supports two basic data types: 1-bit and 16-bit. ¾ All Modbus variations that support 32-bit are application layer enhancements that combine two registers at the lower level ¾ The challenge is matching the different resolutions in the two protocols to achieve the desired resolution for the application. TranslationTranslation ChallengesChallenges DataData ResolutionResolution

THE SOLUTIONS ¾ Use FieldServer’s Scaling functions to scale values if this provides enough resolution ¾ Use FieldServer’s 16 to 32 bit move functions to create 32 bit values for perfect 32 bit resolution ¾ Use FieldServer’s SNVT_Option feature in LonWorks to match a binary modbus value with the state portion of SNVT_switch DataData ResolutionResolution SNVT_Option Feature

//======// Temperature Mapping in Deg_F Map_Descriptors Map_Descriptor_ Data_Array_ Lon_ Node_ Name Data_Array_Name Offset Function Function Name SNVT_Type SNVT_Units nviSpaceTmp DA_Temps 0 NVUI Server EC001 SNVT_temp_p Deg_F nvoSpaceTmp DA_Temps 1 NVUOIMX wrbx EC001 SNVT_temp_p Deg_F

Scale Fahrenheit to Celsius by telling the driver that the Data Array value is Deg_F

¾ All SNVT’s include required scaling in their definition. ¾ The FieldServer automatically scales the raw data according to the SNVT scaling rules. Value in Data Array is the scaled value. ¾ Note that LonWorks is inherently METRIC. Thus, non-metric applications still require extra parameters in the configuration (SNVT_Units field) DataData ResolutionResolution Typecasting Modbus and Typecasting (FieldServer does this by default) ¾ Each protocol variable type is allocated a default Data type ¾ Moves between dissimilar data types result in type-casting ¾ To avoid type-casting, use matching data array types or special functions such as Floating point moves or Packed Bit Data Arrays Example variable types Poll Change value Float Data to a floating Array point value Modbus 3xxxx Default Type = Uint16 Uint16 Data Array Change value to a Modbus 1xxxx unsigned integer Default Type = Bit value

Change value to a bit value Bit Data Array DataData ResolutionResolution Scaling Managing Floating point values with Integers - Scaling Map_Descriptors Node_Name ,Address ,Length ,Data_Array_Low_Scale ,Data_Array _High_Scale ,Node_Low_Scale ,Node_High_Scale MBP_Srv_1 ,30001 ,200 , 0 ,10 ,0 ,100

Data Array Remote Device ------ ------Offset 0: 26.4 Offset 0: 264 ------Offset 1: 32.5 Offset 1: 325 ------DataData ResolutionResolution Floating Point Moves

Supporting 32 bit values with Modbus ¾ FieldServer concept for manipulating “modbus floating point” (Concept is the same for 32 bit integers):

Moves Source_Data_Array ,Source_Offset ,Target_Data_Array ,Target_Offset ,Length ,Function Source_DA ,0 ,Target_DA ,40 ,10 ,2.i16-1.float-sw

Source Data Float Data Modbus Special Array Array Device Move ------Two 16 bit Modbus Poll integers polled: Offset 0: 40001 Offset 40: Float value e.g: 40001, ------length 2 Offset 1: 40002 Together, they ------Sensible data. combine to Map to form a 32 bit SNVT_count_f IEEE Floating Unreadable or similar point number. content DataData ResolutionResolution Bit Packing

//======// // Data Arrays // Packed_Bit is enabled merely by declaring the data array to be // of type: Packed_Bit Data_Arrays Data_Array_Name ,Data_Format ,Data_Array_Length Packer ,Packed_Bit ,200

Packed Bit Data Array

Poll Offset 0 Offset 0 30001 DI 1 Move each bit to a bit Modbus 3xxxx …. Default Type = Uint16 data type DI16 ------No typecasting Offset 1 Offset 16 No typecasting occurs. Data Array occurs. Data Array is is treated as type 30002 DI17 … treated as type Bit to Uint16 to Match match variable type variable type DI32 TranslationTranslation ChallengesChallenges EngineeringEngineering UnitsUnits

THE CHALLENGE ¾ Modbus is a simple protocol that transfers raw data and applies no significance to any of the values transferred. ¾ Significance is achieved through documentation of the Modbus registers in the vendor documentation ¾ LonWorks is obsessive about applying significance to values transferred. All SNVT Types inherently possess an Engineering unit, data resolution and data range. ¾ All Engineering units in LonWorks are SI (Metric). This is not obvious to most LonWorks users as applications such as LonMaker will automatically scale the values to Imperial format in the USA. ¾ The challenge is matching up the values’ Engineering units used in Modbus with the SI Engineering Unit specified in LonWorks TranslationTranslation ChallengesChallenges EngineeringEngineering UnitsUnits

THE SOLUTIONS ¾ Use FieldServer’s Scaling functions to scale values where data ranges differ. ¾ Use FieldServer’s SNVT_Units feature in LonWorks to tell the LonWorks driver whether the data array value is represented as Imperial or SI. TranslationTranslation ChallengesChallenges SimpleSimple vsvs StructuredStructured VariablesVariables THE CHALLENGE ¾ All Modbus variable types possess a simple structure. ¾ This essentially means that one Modbus variable represents one value. The exception is when vendors use a register to represent 16 binary states. ¾ LonWorks consists of a combination of SNVT’s that have both simple structures and “Structured variables”. ¾ Structured variable consists of a variable that represents multiple values, i.e. SNVT_Switch consists of two values, the state portion representing a binary value, and the value portion representing a percentage. Both are transferred as part of one variable. ¾ The challenge is to group data from Modbus that needs to be sent as a structured variable in LonWorks, or to split structured variables from LonWorks into simple Modbus variables. TranslationTranslation ChallengesChallenges SimpleSimple vsvs StructuredStructured VariablesVariables

THE SOLUTIONS ¾ Use FieldServer’s Packed_Bit arrays to split modbus registers representing 16 binary values into 16 separate separate variables OR ¾ Represent the Modbus registers representing 16 binary values as SNVT_state in LonWorks. It is a perfect match. ¾ Use FieldServer’s SNVT_Option feature in LonWorks to match parts of a structured variable up with individual values from Modbus ¾ Use FieldServer’s move function to group data that has to be represented as a structured SNVT. SimpleSimple vsvs StructuredStructured VariablesVariables StructuredStructured VariablesVariables

//Structured SNVT

Map_Descriptors

Map_Descriptor_ Data_Array_ Data_Array_ Name Name Offset Function Node_Name Lon_Function SNSNVVT_IT_Inndexdex SNVT_Type

nvoRhEnable DA_AO_01 1 rdrdbcbc Lon_01 NMFETCHC 9 SNVT_switch

nvoUnOccRh DA_AO_01 3 rdrdbcbc Lon_01 NMFETCHC 10 SNVT_lev_percent

Allow for 2 points in the Data Array ¾ Structured Variable Types pack more than one variable into the variable type ¾ SNVT_switch, for example, has two variables associated with it: Value (0-100) and state (0/1). ¾ The FieldServer can extract all variables from a structured type. Some are easy to work with, others are not. ¾ Note: while extracting ASCII characters out of a structured SNVT is possible, it does not make much sense in the “Gateway” model due to limitations of other protocols like Modbus. SimpleSimple vsvs StructuredStructured VariablesVariables Selective transfer of Structured Variables

//======// Temperature Mapping in Deg_F Map_Descriptors Map_Descriptor_ Data_Array_ Name Data_Array_Name Offset Lon_Function Function Node_Name SNVT_Type SNVT_Option nviAlarm_1 DA_Binary_State 0 NVUI Server EC001 SNVT_switch State nvoAck_1 DA_Binary_State 1 NVUOIMX wrbx EC001 SNVT_switch State

Load only the value needed

¾ When working with a Structured Variable, FieldServer allows you to fetch just the portion of the structured variable needed by declaring the SNVT_Option field. TranslationTranslation ChallengesChallenges SingleSingle vsvs BlockBlock DataData TransferTransfer

THE CHALLENGE ¾ LonWorks sends and receives data one variable at a time. ¾ Modbus works most efficiently when data is transferred in blocks. That is: each poll for data returns many values. ¾ The challenge is to keep both networks efficient by grouping data together for block transfer on the Modbus side. TranslationTranslation ChallengesChallenges SingleSingle vsvs BlockBlock DataData TransferTransfer

THE SOLUTIONS ¾ Use FieldServer’s move functions to group data needed for a block transfer into one data array. ¾ Plan the data blocks so that one poll contains no more than one object/device. Thus, the absence of one device does not prevent the transfer of data from a working device from going through. ¾ Don’t be scared of “empty” data array offsets if it helps to structure a block for simple Modbus mapping. ¾ Serve the block up to Modbus using one map descriptor only. SingleSingle vsvs BlockBlock DataData TransferTransfer Modbus as a slave – Keep data map “large”contiguous ¾ Why? Because you don’t know how a client will structure its poll, and if it polls for undefined points, the poll will fail.

Moves 1 Server Data Array Lon Variable 1 Server Side means 1 Remote Data Array Server map Client can descriptor is possible now poll the Lon Variable 2 FieldServer using large poll lengths Lon Variable 3 without fear of hitting undefined Lon Variable 4 registers. SingleSingle vsvs BlockBlock DataData TransferTransfer Help! I’m getting “could not create cache block” ¾ This error occurs frequently when the FieldServer is configured as a modbus slave ¾ It means that the FieldServer has received a poll for addresses that do not exist in the FieldServer under any one Server map descriptor. ¾ The content of the error message will tell what poll was received. The message can be interpreted as follows:

T02> MODBUS_TCP : Could not create cache block T02> Node:1 Addr:40001 Len:100

Server Node Modbus Length of poll being polled Address being polled SingleSingle vsvs BlockBlock DataData TransferTransfer ConfiguringConfiguring DataData MovesMoves

//======// // Data Arrays // // Declare Data Arrays for the data to be moved. In the real world example, // the Data Arrays may already be declared. //

Data_Arrays Data_Array_Name ,Data_Format ,Data_Array_Length Source_DA ,Float ,200 Target_DA ,Float ,200

//======// // Set up the moves to move the data. //

Moves Source_Data_Array ,Source_Offset ,Target_Data_Array ,Target_Offset ,Length ,Function Source_DA ,0 ,Target_DA ,40 ,20 ,Move_Only TranslationTranslation ChallengesChallenges Master/SlaveMaster/Slave vsvs Peer/PeerPeer/Peer CommunicationsCommunications THE CHALLENGE ¾ Modbus uses Master/Slave Communication model.

¾ Master on the network will request data from all the slaves, and write values to the slaves. Slaves merely respond to communications from the master and do not initiate communications at any time. ¾ LonWorks (traditional implicit update messaging) uses a peer to peer model where the outputs in one device will write to the inputs of another device.

¾ The communications is initiated by the outputs and the inputs are essentially passive. ¾ The challenge is to match the LonWorks peer to peer model with either a Master or a Slave on the Modbus side in such a way that the communications behavior is as expected. TranslationTranslation ChallengesChallenges Master/SlaveMaster/Slave vsvs Peer/PeerPeer/Peer CommunicationsCommunications

THE SOLUTIONS ¾ When the LonWorks interface behaves as a Modbus Slave on the Modbus side ¾ Then LonWorks inputs are treated as Modbus read variables, and LonWorks outputs are treated as Modbus write variables. ¾ LonWorks outputs can be set to send when a Modbus write occurs (using the NVUOIMX/wrbx combination), or they can be set to send continuously at a predefined interval (NVUOIMC/wrbc combination) TranslationTranslation ChallengesChallenges Master/SlaveMaster/Slave vsvs Peer/PeerPeer/Peer CommunicationsCommunications

THE SOLUTIONS ¾ When the LonWorks interface behaves as a Modbus Master on the Modbus side, ¾ Then LonWorks inputs are treated as Modbus write variables, and LonWorks outputs are treated as Modbus read variables. ¾ LonWorks outputs can be set to send when a Modbus read occurs (using the NVUOIMX/wrbx combination), or they can be set to send continuously at a predefined interval (NVUOIMC/wrbc combination). ¾ To achieve the read/write functionality that Modbus provides with it’s writes, it will be necessary to provide an out put for each input on the LonWorks side so that write values can be read back. Master/SlaveMaster/Slave vsvs Peer/PeerPeer/Peer CommunicationsCommunications

Data Flow Model – FieldServer is Modbus Master Input Output LonWorks Array Array LonWorks Commands Status

Modbus Array

Modbus is Modbus Poll Master and polls the Modbus network for status Master/SlaveMaster/Slave vsvs Peer/PeerPeer/Peer CommunicationsCommunications

Data Flow Model – FieldServer is Modbus Slave Modbus is Slave and is polled by the Modbus network for Modbus Poll status

Modbus Array

Input Output

LonWorks Array Array LonWorks Status Commands TranslationTranslation ChallengesChallenges MultipleMultiple vsvs SingleSingle NodeNode RepresentationRepresentation THE CHALLENGE ¾ When bringing data from many LonWorks nodes into one FieldServer, it is possible to represent the FieldServer as a single slave, OR as multiple slaves in the Modbus network. ¾ When bringing data from many Modbus devices into one FieldServer, it is only possible to represent the FieldServer as one device in LonWorks due to only one neuron being present. ¾ Modbus can connect up to 255 devices on a network, depending on physical hardware constraints. ¾ LonWorks will only allow one device to bind to up to 15 other devices due to address table constraints ¾ The challenge is to represent the devices in one network as securely as possible in the other network, and to allow for more than 15 LonWorks devices to be connected to a FieldServer. TranslationTranslation ChallengesChallenges MultipleMultiple vsvs SingleSingle NodeNode RepresentationRepresentation THE SOLUTIONS ¾ When multiple Modbus nodes are represented as one LonWorks node, it is important that the status of these Modbus nodes is known. ¾ Use the FieldServer Node Status function for this and transfer these as a SNVT_States to the network. ¾ To bring more than 15 LonWorks nodes into Modbus with one FieldServer, use the Network Management function in the LonWorks driver (NMFETCHC). ¾ The limit for this communication method is restricted only by hardware. ¾ To bring multiple LonWorks nodes into Modbus, use one Modbus slave address per LonWorks node. ¾ A cleaner design prevents offline LonWorks devices from interfering with working LonWorks devices in the Modbus network. MultipleMultiple vsvs SingleSingle NodeNode RepresentationRepresentation Monitoring the status of Client side nodes (Servers) – Node Status

//======// // Notes : All that is needed to enable node status is the node status data array // declaration. Note, though, that Node ID's in the config need to be // unique, otherwise the FieldServer will incorrectly report the status of // duplicate Node ID's // //======

//======, // // Data Arrays // Data_Arrays Data_Array_Name ,Data_Format ,Data_Array_Length ,Data_Array_Function DA_Comm_Status ,Bit ,256 ,Node_Status

//======, // // Modbus TCP Server Map Descriptor Turns 10001 into Nde 1 Status, 10002=Node 2, etc. // Map_Descriptors Map_Descriptor_Name, Data_Array_Name, Data_Array_Offset, Function, Node_Name , Address, Length, Node_Status_Map , DA_Comm_Status , 1 , Server , MBP_Srv_11, 10001 , 200 , MultipleMultiple vsvs SingleSingle NodeNode RepresentationRepresentation Network Management Messaging

¾ A special function intended for host systems that need to monitor the status of variables on a network (e.g: Network Managers) ¾ This function uses explicit polling to obtain the needed variables. ¾ It is possible to write data using this function too. ¾ This function has some very useful applications when integrating the FieldServer into larger networks. MultipleMultiple vsvs SingleSingle NodeNode representationrepresentation Network Management Configuration example

//======Force FieldServer address // Common Information to Domain 48 (hex), Subnet Bridge 1. Node Address of Title System_Address the FieldServer “:D48:S01:NMManager” 11

//======// // Remote Nodes Nodes Node_name Subnet_ID Node_ID Adapter Protocol Lon_01 1 1 Lonworks Lonworks

Subnet on Node Address of which the the remote remote device device resides MultipleMultiple vsvs SingleSingle NodeNode RepresentationRepresentation Network Management Configuration Example

//======// NMFETCHC Mapping Map_Descriptors Map_Descriptor_ Data_Array_ Data_Array_ SNVT_ Name Name Offset Function Node_Name Lon_Function Index SNVT_Type Scan_Interval nviClgSP DA_AI_01 0 rdbc Lon_01 NMFETCHC 2 SNVT_temp_p 1.0s nviHtgSP DA_AI_01 4 rdbc Lon_01 NMFETCHC 3 SNVT_temp_p 1.0s nviRhSP_4 DA_AI_01 13 rdbc Lon_01 NMFETCHC 4 SNVT_lev_percent 1.0s

Specify SNVT Index of the Node_Name variable in the Scan Interval is refers to the remote device. specified with remote Node NMFETCHC operations TranslationTranslation ChallengesChallenges LonMarkLonMark vsvs ModbusModbus--IDAIDA

THE CHALLENGE ¾ LonMark.org is the organization responsible for maintaining LonWorks standards ¾ Modbus-IDA is the organization responsible for maintaining Modbus standards ¾ There is no challenge here really, except to understand the differences between the objectives of these organizations TranslationTranslation ChallengesChallenges LonMarkLonMark vsvs ModbusModbus--IDAIDA THE SOLUTIONS ¾ LonMark maintains the standards for LonWorks, including such tasks as declaring the official SNVT list and requirements for Device profiles. ¾ LonMark offers testing for device profiles to ensure that the profiles match the requirements ¾ Modbus-IDA maintains the modbus specification. ¾ Modbus-IDA offers testing for protocol conformance. ¾ ALL open standards organizations like LonMark, Modbus-IDA, ASHRAE etc should be fully supported by the technical community. It’s our only way to ensure that these protocols remain open. ResourcesResources

¾ FieldServer website (www.fieldserver.com)

¾ Modbus-IDA (www.modbus.org)

¾ LonMark Website (www.LonMark.org)

¾ Echelon Website (www.echelon.com)

¾ Vendor sites (Mapping for Modbus devices)

¾ Ethernet packet capture utility (www.ethereal.com)

¾ Modscan32 (www.win-tech.com) Questions?Questions?

MarketingMarketing andand Sales:Sales: SteveSteve Ferree:Ferree: [email protected]@fieldserver.com

Technical:Technical: Mac:Mac: [email protected]@sfintegration.com THANKTHANK YOU!YOU!

……..for..for takingtaking thethe timetime toto attendattend thisthis presentation.presentation.