12.07.2015 Views

Connecting Modbus and LonWorks Networks - FieldServer ...

Connecting Modbus and LonWorks Networks - FieldServer ...

Connecting Modbus and LonWorks Networks - FieldServer ...

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Connecting</strong> <strong>Modbus</strong> <strong>and</strong><strong>LonWorks</strong> <strong>Networks</strong>Presented by:Gordon MacLachlan (Mac)


Presentation Highlights‣Properties of a <strong>Modbus</strong> Network• Data Types <strong>and</strong> formats• Data Transfer methodologies‣Properties of a <strong>LonWorks</strong> Network• Data Types <strong>and</strong> 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 communications• Multiple vs single node representation• LonMark vs <strong>Modbus</strong>-IDA‣Resources‣Questions <strong>and</strong> Answers


The <strong>Modbus</strong> St<strong>and</strong>ard‣ A truly open st<strong>and</strong>ard.‣ Based on Master/Slave poll <strong>and</strong> responsetopology.‣ An integer protocol, i.e: : floating point is notsupported 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 registersrepresent.‣ Worldwide use as the most supported protocol.


AddressFormat 1(Modicon style)000 001065 536100 001165 536<strong>Modbus</strong> Memory MapData TypeFlags (Read/Write)Digital Inputs (Read Only)Offsets in each data type:0-65535Read: Function Code 1,AddressFormat 2(PDU Addressing)Write Single: Use Function Code 5Write Multiple: Use function Code 15Read: Function Code 2,Write Single: N/AWrite Multiple: N/A300 001365 536400 001465 536Analog Inputs (Read Only)Registers (Read/Write)Read: Function Code 4Write Single: N/AWrite Multiple: N/ARead: Function Code 3Write Single: Use Function Code 6Write Multiple: Use function Code 16


0000165536<strong>Modbus</strong> Memory MapAddressFormat 3ADU AddressingData TypeFlags (Read/Write)New in 2004 modbusspec.AddressFormat 2(PDU Addressing)Read: Function Code 1, Offsets 0-9998Write Single: Use Function Code 5Write Multiple: Use function Code 1500001655360000165536Digital Inputs (Read Only)Analog Inputs (Read Only)Read: Function Code 2, Offsets 0-9998Write Single: N/AWrite Multiple: N/ARead: Function Code 4, Offsets 0-9998Write Single: N/AWrite Multiple: N/A0000165536Specify Data type& address forcomplete address.Registers (Read/Write)Read: Function Code 3, Offsets 0-9998Write Single: Use Function Code 6Write Multiple: Use function Code 16


<strong>Modbus</strong> VariationsVariations due to difference in connectionmedium:‣ <strong>Modbus</strong> RTU: : Most common <strong>Modbus</strong> variation.Communication medium is RS-232 or RS-485. Datatransferred in hexadecimal format. Only one masterallowed.‣ <strong>Modbus</strong> ASCII: : Uses RS-232 or RS-485. Data istransferred in ASCII format. Only one masterallowed.‣ <strong>Modbus</strong> TCP: : Ethernet. Data transferred inhexadecimal format using the TCP/IP transportprotocol. Allows multiple masters‣ <strong>Modbus</strong> Plus: : Uses a proprietary medium. Specialhardware needed. Allows multiple masters.‣ All of the above protocols support <strong>Modbus</strong> in its trueformat.


<strong>Modbus</strong> VariationsVariations resulting from protocol restrictions:The following <strong>FieldServer</strong> drivers are <strong>Modbus</strong> variants:<strong>Modbus</strong> Tekair<strong>Modbus</strong> Daniels<strong>Modbus</strong> OmniFlowThe manufacturer compensated for <strong>Modbus</strong> being a16 bit integer protocol by providing a method forsending 32 bit values. Many other vendors do thistoo.Additionally, <strong>FieldServer</strong> has a special move functionthat can assist in decoding these 32 bit variants foruse by other protocols.


<strong>Modbus</strong> VariationsVariations resulting from protocol restrictions(JBus):‣ JBus is no different from extended <strong>Modbus</strong>, withlegal data type addressing from 1-655351


<strong>Modbus</strong> TCPDealing with Ethernet <strong>and</strong> <strong>Modbus</strong> TCP:‣ User needs to underst<strong>and</strong> subnetting <strong>and</strong> IPaddressing‣ Using <strong>Modbus</strong> TCP across subnets requires theuse of IP gateways. . Gateway address setting inIP configuration becomes important‣ <strong>Modbus</strong> TCP uses port 502 to communicate.Important if punching a hole in any firewall forcommunications.‣ <strong>Modbus</strong> TCP uses TCP/IP connectionmanagement to allow multiple communicationsconnections making multiple masters on a<strong>Modbus</strong> TCP Network possible.


<strong>Modbus</strong> TCP –Troubleshooting onEthernet‣ 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 thenetwork <strong>and</strong> test communications.‣ Know the network layout, , including all subnets,<strong>Modbus</strong> TCP devices, routers, <strong>and</strong> firewalls whichcan influence communications. A detailed networklayout diagram is essential.‣ IP Addressing – does your device‣ Support IP addressing in conjunction with variable Unitidentifier (Node_ID(Node_ID)?‣ Fix the unit identifier <strong>and</strong> work with IP addressing only?‣ Know which variant involved - <strong>FieldServer</strong> will need to fix itsNode_ID to the correct address if the latter is in use.


<strong>LonWorks</strong> Overview<strong>LonWorks</strong> Addressing‣ DSN – Domain, Subnet, Node‣ Typically, the Network Manager assigns the domainaddress for a network, following which the required subnetsfor a domain are determined by routers needed in thesystem. Node addresses on each subnet are then allocatedby the Network Manager.‣ The LNS report utility prints out all DSN addresses for aDomain.


<strong>LonWorks</strong> OverviewNetwork Managers‣ LonMaker, LonWatcher, , <strong>and</strong> others…‣ Traditional <strong>LonWorks</strong> setup requires a network manager‣ Network manager “binds” data points together, <strong>and</strong> canthen be removed.


<strong>LonWorks</strong> OverviewNetwork Managers‣ Network Managers allocate addressing on the network‣ A <strong>LonWorks</strong> network can be commissioned without aNetwork Manager, but this requires more advancedtechniques.


<strong>LonWorks</strong> OverviewNetwork Variable Types‣ SNVT – St<strong>and</strong>ard Network VariableType‣ UNVT – User Network Variable Type‣ SCPT – St<strong>and</strong>ard ConfigurationParameter Type‣ UCPT – User ConfigurationParameter Type


<strong>LonWorks</strong> OverviewData Transfer – Update vs Polled‣ Update variables send datato a remote device using anevent driven mechanism‣ Event driven mechanismsinclude: Continuous update,Update on change, <strong>and</strong>Throttling mode‣ Polled variables wait to bequeried for data, <strong>and</strong> thenrespond when queried.‣ Typically, polled variablesoperate on a continuousupdate methodology


<strong>LonWorks</strong> OverviewXIF filesFile generated by TAC Menta version 4.0, XIF Version 3Copyright (c) 2002 by TAC ABAll Rights Reserved.Run on 2004-06-08 15:4980:00:13:52:00:06:04:6E2 15 1 31 2 5 2 0 0 2 6 11 13 13 11 3 0 1611 5 9 13 28 0 0 15 5 3 1131 7 1 0 4 4 4 15 200 078125 0 0 0 0 0 0 0 0 0 0 090 0 240 0 0 0 40 40 0 5 8 5 12 14 15*"&3.0@0,5VAR SNVT_ObjReq 0 0 0 00 1 63 0 0 0 0 0 0 0 0 0 0"@0|192 * 22 0 0 0 01 0 0 1 0VAR SNVT_ObjState 1 0 0 00 1 63 1 0 0 0 0 0 0 0 0 0"@0|293 * 262 0 0 0 03 0 1 0 0Program_IDSNVT_IDSNVT_Type‣ XIF (externalinterface) files containinformation about thevariables on a device,<strong>and</strong> all the necessaryvariable properties.‣ XIF files go a long wayto providing all theinformation neededfor <strong>FieldServer</strong>configuration, but donot contain DSNinformation.


<strong>LonWorks</strong> OverviewNeuron ID’s vs Program ID’s‣ Neuron ID - Uniquely defines the Neuron chip onthe network. No two Neuron chips in the worldhave the same ID.‣ Program ID - defines an application on ahardware platform, <strong>and</strong> is possible for twohardware platforms to have the same Program IDbecause they are running the same application.‣ If an application changes, then its Program ID mustchange too. This means when Lon variables are modifiedin the <strong>FieldServer</strong> configuration, the Program ID mustchange.‣ If the Program ID changes for a device, then that deviceneeds to be removed from a network, <strong>and</strong> thenrecommissioned.‣ The Lesson to be learned: Plan your variable listcarefully before commencing with binding.


Sustainability 40/40 20/21SUSTAINABLE THINKINGENERGY EFFICIENCY IS BUILT INTOTHE FABRIC OF 10–4 PENTONVILLEROAD. INNOVATIVE LIGHTINGAND HEATING SYSTEMS PROMISECONTROLLED ENERGY USE, FEWERCARBON EMISSIONS AND REDUCEDRUNNING COSTS.HEAT RECOVERYThe building is equipped with a variable refrigerant flow (VRF)simultaneous heating <strong>and</strong> cooling system for a high level ofenergy efficiency. For comparison, the carbon emissions of aconventional chiller <strong>and</strong> boiler combination would typicallybe 10-20% higher.Each internal AC unit can be operated individually via a dedicatedcontroller or temperature sensor, enabling the system to recover <strong>and</strong> reuseexcess heat. For example, the AC unit in a densely-occupied meetingroom will be in cooling mode even if units elsewhere are heating, sothe system ensures the residual heat from the first unit is recovered toprovide free heat for the others. The same principle applies betweenunits on the building’s north- <strong>and</strong> south-facing façades.In a similar way, the fresh air ventilation systemuses energy efficient heat recuperators to recoverthe residual heat from extracted air to heat theincoming fresh air.INTELLIGENT LIGHTING10–4 Pentonville Road incorporates an intelligent lightingcontrol system able to adapt to changing levels of occupancy<strong>and</strong> daylight to maximise energy savings. Each floor of thebuilding has its own control unit so that tenants can modifythe lighting settings to meet their individual requirements.The whole system is PC-based for easyreconfiguration, <strong>and</strong> all lights have beencarefully chosen to ensure overall lampefficacy exceeds 45 lumens per circuit watt.ADDITIONAL SUSTAINABLE FEATURES—Targeting BREEAM Very Good—High-performance solar-control glazing to minimiseheat gains, <strong>and</strong> thus reduce cooling load—Upgraded thermal insulation to reduce heat loss—Low water-use sanitary fittings—Solar hot water heating


<strong>LonWorks</strong> ConfigurationBasic Configuration File (Connection Information):Define Connection <strong>and</strong> Node://================================================================================// <strong>LonWorks</strong> ConnectionConnectionsAdapterLonworksProtocolLonworks//================================================================================// <strong>LonWorks</strong> NodeNodesNode_NameEC001ProtocolLonworks


<strong>LonWorks</strong> ConfigurationBasic Configuration File (Mapping):Define SNVT’s s (Map them to the Data Array)://================================================================================// <strong>LonWorks</strong> Map DescriptorsMap_DescriptorsMap_Descriptor_NameData_Array_NameData_Array_Offset Lon_Function FunctionNode_NameSNVT_TypenviSpaceTmp DA_Temps 0 NVUI Server EC001 SNVT_temp_pnvoSpaceTmp DA_Temps 1 NVUOIMX wrbx EC001 SNVT_temp_p


Lonworks ConfigurationXIF for Basic Configuration File :fserver.xif:File: fserver-2.xif generated by LonDriver Revision 1.20(g), XIF Version 4.0Copyright (c) 2000-2004 by <strong>FieldServer</strong> TechnologiesAll Rights Reserved. Run on Tue Jul 26 07:58:26 200580:00:95:47:1E:02:04:362 15 1 2 0 14 11 3 3 12 14 11 11 11 11 3 0 16 63 0 1 11 20 5 7 13 28 0 0 15 5 3 109 631 7 1 0 4 4 4 15 200 078125 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 1 5 8 5 12 14 15*"EC001 <strong>FieldServer</strong> v1.00aVAR nviSpaceTmp 0 0 0 00 1 63 0 0 0 0 0 0 0 0 0 0*105 * 12 0 0 1 0VAR nvoSpaceTmp 1 0 0 00 1 63 1 0 0 0 0 0 0 0 0 0*105 * 12 0 0 1 0


Lonworks ConfigurationCommissioning EC001 into LonMaker :Step 1: Load config into <strong>FieldServer</strong> <strong>and</strong> reboot <strong>FieldServer</strong>Step 2: Open a project in LonMakerStep 3: Drag device into Visio drawing.Step 4: Complete the device commissioning wizard.


Lonworks ConfigurationCommissioning EC001 into LonMaker :Step 5: Press the Service Pin on the <strong>FieldServer</strong>, wait for EC001 tocommission.Step 6: Drag a Function Block into Visio


Lonworks ConfigurationCommissioning EC001 into LonMaker :The end result: You are now ready to bind to other devices using the“Connector” Tool.


Translation ChallengesData ResolutionTHE CHALLENGE‣ <strong>LonWorks</strong>‣ Supports data types from 8-bit 8through to 64-bit <strong>and</strong> allowsfor corresponding resolutions in the different SNVT’s‣ <strong>LonWorks</strong> has two common SNVT’s s to manage binary datatransfer: SNVT_switch <strong>and</strong> SNVT_state. . Both are 16-bitSNVT’s.SNVT_switch is more popular.‣ <strong>Modbus</strong>‣ Supports two basic data types: 1-bit 1<strong>and</strong> 16-bit.‣ All <strong>Modbus</strong> variations that support 32-bit are applicationlayer enhancements that combine two registers at the lowerlevel‣ The challenge is matching the different resolutions in thetwo protocols to achieve the desired resolution for theapplication.


Translation ChallengesData ResolutionTHE SOLUTIONS‣ Use <strong>FieldServer</strong>’s s Scaling functions to scalevalues if this provides enough resolution‣ Use <strong>FieldServer</strong>’s s 16 to 32 bit move functions tocreate 32 bit values for perfect 32 bit resolution‣ Use <strong>FieldServer</strong>’s SNVT_Option feature in<strong>LonWorks</strong> to match a binary modbus value withthe state portion of SNVT_switch


Data ResolutionSNVT_Option Feature//================================================================================// Temperature Mapping in Deg_FMap_DescriptorsMap_Descriptor_NameData_Array_NameData_Array_OffsetLon_FunctionFunctionNode_Name SNVT_Type SNVT_UnitsnviSpaceTmp DA_Temps 0 NVUI Server EC001 SNVT_temp_p Deg_FnvoSpaceTmp DA_Temps 1 NVUOIMX wrbx EC001 SNVT_temp_p Deg_FScale Fahrenheit to Celsiusby telling the driver that theData Array value is Deg_F‣ All SNVT’s s include required scaling in their definition.‣ The <strong>FieldServer</strong> automatically scales the raw data according tothe SNVT scaling rules. Value in Data Array is the scaled value.‣ Note that <strong>LonWorks</strong> is inherently METRIC. Thus, non-metricapplications still require extra parameters in the configuration(SNVT_Unitsfield)


Data ResolutionTypecasting<strong>Modbus</strong> <strong>and</strong> Typecasting (<strong>FieldServer</strong> does this bydefault)‣ 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 specialfunctions such as Floating point moves or Packed Bit Data ArraysExample variable types<strong>Modbus</strong> 3xxxxDefault Type = Uint16<strong>Modbus</strong> 1xxxxDefault Type = BitPollChange valueto a floatingpoint valueFloat DataArrayChange value to aunsigned integervalueUint16 DataArrayChange valueto a bit valueBit DataArray


Data ResolutionScalingManaging Floating point values with Integers -ScalingMap_DescriptorsNode_Name ,Address ,Length ,Data_Array_Low_Scale ,Data_Array _High_Scale ,Node_Low_Scale,Node_High_ScaleMBP_Srv_1 ,30001 ,200 , 0 ,10 ,0 ,100Data Array-------------------------Offset 0: 26.4-------------------------Offset 1: 32.5-------------------------X10Remote Device-------------------------Offset 0: 264-------------------------Offset 1: 325-------------------------


Data ResolutionFloating Point MovesSupporting 32 bit values with <strong>Modbus</strong>‣ <strong>FieldServer</strong> concept for manipulating “modbusfloating point”(Concept is the same for 32 bit integers):MovesSource_Data_Array ,Source_Offset ,Target_Data_Array ,Target_Offset ,Length ,FunctionSource_DA ,0 ,Target_DA ,40 ,10 ,2.i16-1.float-sw<strong>Modbus</strong>DeviceTwo 16 bitintegers polled:e.g: 40001,length 2Together, theycombine toform a 32 bitIEEE Floatingpoint number.<strong>Modbus</strong> PollSource DataArray-------------------------Offset 0: 40001-------------------------Offset 1: 40002-------------------------SpecialMoveUnreadablecontentFloat DataArray-------------------------Offset 40: Float value-------------------------Sensible data.Map toSNVT_count_for similar


Data ResolutionBit Packing//================================================================================//// Data Arrays// Packed_Bit is enabled merely by declaring the data array to be// of type: Packed_BitData_ArraysData_Array_Name ,Data_Format ,Data_Array_LengthPacker ,Packed_Bit ,200Packed Bit Data Array<strong>Modbus</strong> 3xxxxDefault Type = Uint16PollNo typecastingoccurs. Data Arrayis treated as typeUint16 to Matchvariable typeOffset 030001Offset 0DI 1….DI16------------------------------Offset 130002Offset 16DI17…DI32No typecastingoccurs. Data Array istreated as type Bit tomatch variable typeMove each bit to a bitdata type


Translation ChallengesEngineering UnitsTHE CHALLENGE‣ <strong>Modbus</strong> is a simple protocol that transfers raw data <strong>and</strong>applies no significance to any of the values transferred.‣ Significance is achieved through documentation of the<strong>Modbus</strong> registers in the vendor documentation‣ <strong>LonWorks</strong> is obsessive about applying significance tovalues transferred. All SNVT Types inherently possess anEngineering unit, data resolution <strong>and</strong> data range.‣ All Engineering units in <strong>LonWorks</strong> are SI (Metric). This isnot obvious to most <strong>LonWorks</strong> users as applications suchas LonMaker will automatically scale the values to Imperialformat in the USA.‣ The challenge is matching up the values’ Engineering unitsused in <strong>Modbus</strong> with the SI Engineering Unit specified in<strong>LonWorks</strong>


Translation ChallengesEngineering UnitsTHE SOLUTIONS‣ Use <strong>FieldServer</strong>’s s Scaling functions to scalevalues where data ranges differ.‣ Use <strong>FieldServer</strong>’s SNVT_Units feature in<strong>LonWorks</strong> to tell the <strong>LonWorks</strong> driver whetherthe data array value is represented as Imperialor SI.


Translation ChallengesSimple vs Structured VariablesTHE CHALLENGE‣ All <strong>Modbus</strong> variable types possess a simple structure.‣ This essentially means that one <strong>Modbus</strong> variablerepresents one value. The exception is when vendorsuse a register to represent 16 binary states.‣ <strong>LonWorks</strong> consists of a combination of SNVT’s s thathave both simple structures <strong>and</strong> “Structuredvariables”.‣ Structured variable consists of a variable thatrepresents multiple values, i.e. SNVT_Switch consistsof two values, the state portion representing a binaryvalue, <strong>and</strong> the value portion representing a percentage.Both are transferred as part of one variable.‣ The challenge is to group data from <strong>Modbus</strong> thatneeds to be sent as a structured variable in<strong>LonWorks</strong>, or to split structured variables from<strong>LonWorks</strong> into simple <strong>Modbus</strong> variables.


Translation ChallengesSimple vs Structured VariablesTHE SOLUTIONS‣ Use <strong>FieldServer</strong>’s Packed_Bit arrays to split modbusregisters representing 16 binary values into 16separate separate variables OR‣ Represent the <strong>Modbus</strong> registers representing 16binary values as SNVT_state in <strong>LonWorks</strong>. It is aperfect match.‣ Use <strong>FieldServer</strong>’s SNVT_Option feature in <strong>LonWorks</strong>to match parts of a structured variable up withindividual values from <strong>Modbus</strong>‣ Use <strong>FieldServer</strong>’s s move function to group data thathas to be represented as a structured SNVT.


Simple vs Structured VariablesStructured Variables//Structured SNVTMap_DescriptorsMap_Descriptor_NameData_Array_NameData_Array_OffsetFunctionNode_NameLon_FunctionSNVT_IndexSNVT_TypenvoRhEnableDA_AO_01 1 rdbcLon_01NMFETCHC 9 SNVT_switchnvoUnOccRhDA_AO_01 3 rdbcLon_01NMFETCHC 10 SNVT_lev_percentAllow for 2 pointsin the Data Array‣ Structured Variable Types pack more than one variableinto the variable type‣ SNVT_switch, , for example, has two variables associatedwith it: Value (0-100) <strong>and</strong> state (0/1).‣ The <strong>FieldServer</strong> can extract all variables from a structuredtype. Some are easy to work with, others are not.‣ Note: while extracting ASCII characters out of a structuredSNVT is possible, it does not make much sense in the“Gateway” model due to limitations of other protocols like<strong>Modbus</strong>.


Simple vs Structured VariablesSelective transfer of Structured Variables//================================================================================// Temperature Mapping in Deg_FMap_DescriptorsMap_Descriptor_NameData_Array_NameData_Array_Offset Lon_Function Function Node_Name SNVT_Type SNVT_OptionnviAlarm_1 DA_Binary_State 0 NVUI Server EC001 SNVT_switch StatenvoAck_1 DA_Binary_State 1 NVUOIMX wrbx EC001 SNVT_switch StateLoad only thevalue needed‣ When working with a Structured Variable, <strong>FieldServer</strong>allows you to fetch just the portion of the structuredvariable needed by declaring the SNVT_Option field.


Translation ChallengesSingle vs Block Data TransferTHE CHALLENGE‣ <strong>LonWorks</strong> sends <strong>and</strong> receives data one variable at atime.‣ <strong>Modbus</strong> works most efficiently when data istransferred in blocks. That is: each poll for datareturns many values.‣ The challenge is to keep both networks efficient bygrouping data together for block transfer on the<strong>Modbus</strong> side.


Translation ChallengesSingle vs Block Data TransferTHE SOLUTIONS‣ Use <strong>FieldServer</strong>’s s move functions to group dataneeded for a block transfer into one data array.‣ Plan the data blocks so that one poll contains nomore than one object/device. Thus, the absence ofone device does not prevent the transfer of datafrom a working device from going through.‣ Don’t t be scared of “empty” data array offsets if ithelps to structure a block for simple <strong>Modbus</strong>mapping.‣ Serve the block up to <strong>Modbus</strong> using one mapdescriptor only.


Single vs Block Data Transfer<strong>Modbus</strong> as a slave – Keep data map “large”contiguous‣ Why? Because you don’t t know how a client will structure itspoll, <strong>and</strong> if it polls for undefined points, the poll will fail.Lon Variable 1Lon Variable 2Lon Variable 3Lon Variable 4MovesServer SideData Array1 ServerData Arraymeans 1Server mapdescriptor ispossibleRemoteClient cannow poll the<strong>FieldServer</strong>using largepoll lengthswithout fearof hittingundefinedregisters.


Single vs Block Data TransferHelp! I’m I m getting “could not create cacheblock”‣ This error occurs frequently when the <strong>FieldServer</strong> is configuredas a modbus slave‣ It means that the <strong>FieldServer</strong> has received a poll for addressesthat do not exist in the <strong>FieldServer</strong> under any one Server mapdescriptor.‣ The content of the error message will tell what poll wasreceived. The message can be interpreted as follows:T02> MODBUS_TCP : Could not create cache blockT02> Node:1 Addr:40001 Len:100Server Nodebeing polled<strong>Modbus</strong>Addressbeing polledLength of poll


Single vs Block Data TransferConfiguring Data Moves//================================================================================//// Data Arrays//// Declare Data Arrays for the data to be moved. In the real world example,// the Data Arrays may already be declared.//Data_ArraysData_Array_Name ,Data_Format ,Data_Array_LengthSource_DA ,Float ,200Target_DA ,Float ,200//================================================================================//// Set up the moves to move the data.//MovesSource_Data_Array ,Source_Offset ,Target_Data_Array ,Target_Offset ,Length ,FunctionSource_DA ,0 ,Target_DA ,40 ,20 ,Move_Only


Translation ChallengesMaster/Slave vs Peer/Peer CommunicationsTHE CHALLENGE‣ <strong>Modbus</strong> uses Master/Slave Communication model.‣ Master on the network will request data from all the slaves, <strong>and</strong>write values to the slaves. Slaves merely respond tocommunications from the master <strong>and</strong> do not initiatecommunications at any time.‣ <strong>LonWorks</strong> (traditional implicit update messaging) uses a peerto peer model where the outputs in one device will write tothe inputs of another device.‣ The communications is initiated by the outputs <strong>and</strong> the inputsare essentially passive.‣ The challenge is to match the <strong>LonWorks</strong> peer to peer modelwith either a Master or a Slave on the <strong>Modbus</strong> side in such away that the communications behavior is as expected.


Translation ChallengesMaster/Slave vs Peer/Peer CommunicationsTHE SOLUTIONS‣ When the <strong>LonWorks</strong> interface behaves as a <strong>Modbus</strong> Slave onthe <strong>Modbus</strong> side‣ Then <strong>LonWorks</strong> inputs are treated as <strong>Modbus</strong> read variables,<strong>and</strong> <strong>LonWorks</strong> outputs are treated as <strong>Modbus</strong> write variables.‣ <strong>LonWorks</strong> outputs can be set to send when a <strong>Modbus</strong> writeoccurs (using the NVUOIMX/wrbxcombination), or they can beset to send continuously at a predefined interval(NVUOIMC/wrbccombination)


Translation ChallengesMaster/Slave vs Peer/Peer CommunicationsTHE SOLUTIONS‣ When the <strong>LonWorks</strong> interface behaves as a <strong>Modbus</strong> Masteron the <strong>Modbus</strong> side,‣ Then <strong>LonWorks</strong> inputs are treated as <strong>Modbus</strong> write variables,<strong>and</strong> <strong>LonWorks</strong> outputs are treated as <strong>Modbus</strong> read variables.‣ <strong>LonWorks</strong> outputs can be set to send when a <strong>Modbus</strong> readoccurs (using the NVUOIMX/wrbxcombination), or they can beset to send continuously at a predefined interval(NVUOIMC/wrbccombination).‣ To achieve the read/write functionality that <strong>Modbus</strong> provideswith it’s s writes, it will be necessary to provide an out put foreach input on the <strong>LonWorks</strong> side so that write values can beread back.


Master/Slave vs Peer/Peer CommunicationsData Flow Model – <strong>FieldServer</strong> is <strong>Modbus</strong>Master<strong>LonWorks</strong>Comm<strong>and</strong>sInputArrayOutputArray<strong>LonWorks</strong>Status<strong>Modbus</strong> Array<strong>Modbus</strong> isMaster <strong>and</strong> pollsthe <strong>Modbus</strong>network forstatus<strong>Modbus</strong> Poll


Master/Slave vs Peer/Peer CommunicationsData Flow Model – <strong>FieldServer</strong> is <strong>Modbus</strong>Slave<strong>Modbus</strong> Poll<strong>Modbus</strong> is Slave<strong>and</strong> is polled bythe <strong>Modbus</strong>network forstatus<strong>Modbus</strong> ArrayInputOutput<strong>LonWorks</strong>StatusArrayArray<strong>LonWorks</strong>Comm<strong>and</strong>s


Translation ChallengesMultiple vs Single Node RepresentationTHE CHALLENGE‣ When bringing data from many <strong>LonWorks</strong> nodes into one<strong>FieldServer</strong>, it is possible to represent the <strong>FieldServer</strong> as asingle slave, OR as multiple slaves in the <strong>Modbus</strong> network.‣ When bringing data from many <strong>Modbus</strong> devices into one<strong>FieldServer</strong>, it is only possible to represent the <strong>FieldServer</strong>as one device in <strong>LonWorks</strong> due to only one neuron beingpresent.‣ <strong>Modbus</strong> can connect up to 255 devices on a network,depending on physical hardware constraints.‣ <strong>LonWorks</strong> will only allow one device to bind to up to 15other devices due to address table constraints‣ The challenge is to represent the devices in one network assecurely as possible in the other network, <strong>and</strong> to allow formore than 15 <strong>LonWorks</strong> devices to be connected to a<strong>FieldServer</strong>.


Translation ChallengesMultiple vs Single Node RepresentationTHE SOLUTIONS‣ When multiple <strong>Modbus</strong> nodes are represented as one<strong>LonWorks</strong> node, it is important that the status of these<strong>Modbus</strong> nodes is known.‣ Use the <strong>FieldServer</strong> Node Status function for this <strong>and</strong>transfer these as a SNVT_States to the network.‣ To bring more than 15 <strong>LonWorks</strong> nodes into <strong>Modbus</strong>with one <strong>FieldServer</strong>, use the Network Managementfunction in the <strong>LonWorks</strong> driver (NMFETCHC).‣ The limit for this communication method is restricted onlyby hardware.‣ To bring multiple <strong>LonWorks</strong> nodes into <strong>Modbus</strong>, useone <strong>Modbus</strong> slave address per <strong>LonWorks</strong> node.‣ A cleaner design prevents offline <strong>LonWorks</strong> devices frominterfering with working <strong>LonWorks</strong> devices in the <strong>Modbus</strong>network.


Multiple vs Single Node RepresentationMonitoring 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 <strong>FieldServer</strong> will incorrectly report the status of// duplicate Node ID's////======================================================================================//================================================================================,//// Data Arrays//Data_ArraysData_Array_Name ,Data_Format ,Data_Array_Length ,Data_Array_FunctionDA_Comm_Status ,Bit ,256 ,Node_Status//================================================================================,//// <strong>Modbus</strong> TCP Server Map Descriptor Turns 10001 into Nde 1 Status, 10002=Node 2, etc.//Map_DescriptorsMap_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 ,


Multiple vs Single Node RepresentationNetwork Management Messaging‣ A special function intendedfor host systems thatneed to monitor the statusof variables on a network(e.g:: Network Managers)‣ This function uses explicitpolling to obtain theneeded variables.‣ It is possible to write datausing this function too.‣ This function has somevery useful applicationswhen integrating the<strong>FieldServer</strong> into largernetworks.


Multiple vs Single Node representationNetwork Management Configuration example//=============================================// Common InformationBridgeTitle“:D48:S01:NMManager” 11System_AddressForce <strong>FieldServer</strong> addressto Domain 48 (hex), Subnet1.Node Address ofthe <strong>FieldServer</strong>//================================================================================//// Remote NodesNodesNode_name Subnet_ID Node_ID Adapter ProtocolLon_01 1 1 Lonworks LonworksSubnet onwhich theremote deviceresidesNode Address ofthe remotedevice


Multiple vs Single Node RepresentationNetwork Management Configuration Example//================================================================================// NMFETCHC MappingMap_DescriptorsMap_Descriptor_NameData_Array_NameData_Array_Offset Function Node_Name Lon_FunctionSNVT_Index SNVT_Type Scan_IntervalnviClgSP DA_AI_01 0 rdbc Lon_01 NMFETCHC 2 SNVT_temp_p 1.0snviHtgSP DA_AI_01 4 rdbc Lon_01 NMFETCHC 3 SNVT_temp_p 1.0snviRhSP_4 DA_AI_01 13 rdbc Lon_01 NMFETCHC 4 SNVT_lev_percent 1.0sNode_Namerefers to theremote NodeSpecify SNVTIndex of thevariable in theremote device.Scan Interval isspecified withNMFETCHCoperations


Translation ChallengesLonMark vs <strong>Modbus</strong>-IDATHE CHALLENGE‣ LonMark.org is the organization responsible formaintaining <strong>LonWorks</strong> st<strong>and</strong>ards‣ <strong>Modbus</strong>-IDA is the organization responsible formaintaining <strong>Modbus</strong> st<strong>and</strong>ards‣ There is no challenge here really, except tounderst<strong>and</strong> the differences between theobjectives of these organizations


Translation ChallengesLonMark vs <strong>Modbus</strong>-IDATHE SOLUTIONS‣ LonMark maintains the st<strong>and</strong>ards for <strong>LonWorks</strong>,including such tasks as declaring the official SNVTlist <strong>and</strong> requirements for Device profiles.‣ LonMark offers testing for device profiles to ensurethat the profiles match the requirements‣ <strong>Modbus</strong>-IDA maintains the modbus specification.‣ <strong>Modbus</strong>-IDA offers testing for protocol conformance.‣ ALL open st<strong>and</strong>ards organizations like LonMark,<strong>Modbus</strong>-IDA, ASHRAE etc should be fully supportedby the technical community. It’s s our only way toensure that these protocols remain open.


Resources‣ <strong>FieldServer</strong> website (www.fieldserver.com(www.fieldserver.com)‣ <strong>Modbus</strong>-IDA (www.modbus.org(www.modbus.org)‣ LonMark Website (www.LonMark.org(www.LonMark.org)‣ Echelon Website (www.echelon.com(www.echelon.com)‣ Vendor sites (Mapping for <strong>Modbus</strong> devices)‣ Ethernet packet capture utility (www.ethereal.com(www.ethereal.com)‣ Modscan32 (www.win(www.win-tech.com)


Questions?Marketing <strong>and</strong> Sales:Steve Ferree: sferree@fieldserver.comTechnical:Mac: mac@sfintegration.com


THANK YOU!…..for taking the time to attendthis presentation.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!