Archive for October, 2008

Multiple Clients of a Modbus slave

We are frequenty asked how you deal with a situation where you have more than one client for a slave(s). The Modbus spec does not support this but we have a solution.

The essence of the solution if to use a multi-port FieldServer. Connect each client to its own port and the slave(s) to thier own ports. Each client will see a single virtual slave(s) on its network. This not only solves the problem but is extremely efficient. Of course the FieldServer needs to be correctly configured.

In a situation like this we exploit the FieldServer technology known as ‘Port Expansion’

Figure 1: Normally it is not possible to connect two clients to the same slave. There are two primary reasons:
1) If you are using RS232 then there can only be two devices on the cable segment.
2) If you are using RS485 then the 2nd client will not know to proceess the poll from the 1st client. It will cause errors.



Click to enlarge

Figure 2: Using a FieldServer with an appropriate configuration solves this problem whether you are using RS232 otr RS485.



Click to enlarge

Figure 3: Each client is on its own port. Thus each client does not see poll messages from the other client. In this example client#1 sends a poll to the FieldServer. The is directed a specific slave address. When the poll arrives at the FieldServer, the FieldServer checks the address against its configuration. If there is no match then an exception response is sent. If there is a match the FieldServer determines the port that the matching slave is configured on. The poll message is then relayed to the slave port.



Click to enlarge

Figure 4: The slave responds. The FieldServer relays the response to client#1. The FieldServer also extracts the data from the response and stores in a temporary location (FieldServer calls that a cache block). The duration/expiry of the storage is configurable.



Click to enlarge

Figure 5: If any client requests the same data (client#1 or #2) and the data hasnt expired then the FieldServer responds with data from the temporary storage.



Click to enlarge

Figure 6: If any client requests different data or if the temporary data has expired then the match and relay process is repeated requesting the new data.



Click to enlarge

Figure 7: The slave responds, the response is relayed to the client doing the polling (Client#2 in this case) and the data is stored temporarily so that it is available to the other client.



Click to enlarge

Did you like this post?

Subscribe To The RSS Feed!
To catch many more articles like this in the future, make it easy on yourself and subscribe to me via RSS. You will not regret it!

Do you have a question?
We will do our best to try and solve any building automation, protocol, integration problem you may have

Scaling / Bit Packing

FieldServers can scale data and manipulate values using some binary logic and arithmetic functions. Scaling can be applied to each block of Modbus Data read/served.

  • Move to change type : Convert from any FIeldServer Data Type to any other.
  • Move to pack/unpack bits and bytes: Its possible to address each bit in a 8,16 or 32 bit data element by using the packed data types.
  • Move to change byte/word order: Handle the endianess of the remote system easily.
  • Convert to/from Float, MK10, IEE754, 32 bit, 16 bit, 8 bit numbers
  • Move conditionally:
  • Perform Arithmetic Operation: + - * div sqrt, sqr
  • Perform Binary Logic Operation: And, Or, Not, >, >= , <, <=

Most functions can be configured to occur on a configurable period or on update of the data source.


Click for larger view

Did you like this post?

Subscribe To The RSS Feed!
To catch many more articles like this in the future, make it easy on yourself and subscribe to me via RSS. You will not regret it!

Do you have a question?
We will do our best to try and solve any building automation, protocol, integration problem you may have

Blue hyperlink border around images in HTML

When you add a hyperlink to an image in HTML it will automatically display with a blue border around that image. We don’t want it because it makes our page look ugly and unprofessional.

There are a couple of ways to remove the blue hyperlink border:

Using CSS
Add the following line to your style sheet code:

img {   border-style: none;   }

Using HTML
Add the following attribute to your image HTML code:

border="0"

Your line of code should look like this :

<img src="/image.jpg" border="0" />
Did you like this post?

Subscribe To The RSS Feed!
To catch many more articles like this in the future, make it easy on yourself and subscribe to me via RSS. You will not regret it!

Do you have a question?
We will do our best to try and solve any building automation, protocol, integration problem you may have

Why 7 data bits is no good for Modbus RTU

Modbus RTU is a binary protocol. It requires the use of all 8 bits in each character / byte that forms the message because there are many situations where the 8th bit is used. For example, an exception response has the 8th (most significant bit set. If you wanted to read holding register 40130 then the message contains the offset. In this case the offset is 129 (The distance from 40001). The number 129 requires 8 bits of storage. In fact all numbers greater than 127 require the 8th bit.  These are just two example of why 8 data bits are required to send RTU messages. It is concievable that a device could which supports less than 128 registers which will never have a value larger than 128 stored in any register could use 7 data bits but the message contains a checksum which might require the use of the 8th bit and this is why 7 data bits is never used for Modbus RTU. In fact you cant use 7 data bits for any binary protocol.

Example: Read 40130 length 31 from device 11.

[01]               [03]              [00]             [81]               [00]             [1f]               [54]               [2a] (Hex Values)

[0000 0001] [0000 0011] [0000 0000] [1000 0001] [0000 0000] [0001 1111] [0101 1000] [0010 1010]

Modbus Ascii (JBUS) is an ASCII protocol. Every character in the message is encoded in ASCII characters and ANSI ASCII character set only require 7 data bits to be encoded since the max value of an ASCII characters is 127. These days the set has been extended and contains non-human readable characters numbered from 128-255.

The same message sent in Jbus sends this string of human readable characters.

“01030081001f542a”

Keywords for this article: 8 Data_Bits

Did you like this post?

Subscribe To The RSS Feed!
To catch many more articles like this in the future, make it easy on yourself and subscribe to me via RSS. You will not regret it!

Do you have a question?
We will do our best to try and solve any building automation, protocol, integration problem you may have

Cable Specifications for RS485 Networks - BACnet MSTP

The BACnet spec defined the media for MSTP as follows (2004) ;

“An MS/TP EIA-485 network shall use shielded, twisted-pair cable with characteristic impedance between 100 and 130 ohms. Distributed capacitance between conductors shall be less than 100 pF per meter (30 pF per foot). Distributed capacitance between conductors and shield shall be less that 200 pF per meter (60 pF per foot). Foil or braided shields are acceptable. The maximum recommended length of an MS/TP segment is 1200 meters (4000 feet) with AWG 18 (0.82 mm2 conductor area) cable. The use of greater distances and/or different wire gauges shall comply with the electrical specifications of EIA-485.”

Did you like this post?

Subscribe To The RSS Feed!
To catch many more articles like this in the future, make it easy on yourself and subscribe to me via RSS. You will not regret it!

Do you have a question?
We will do our best to try and solve any building automation, protocol, integration problem you may have

Cable Specifications for RS485 Networks - JCI Metasys N2 Open

We have cable selection, installation and trouble shooting info on this page on our web site.

Click Here

Did you like this post?

Subscribe To The RSS Feed!
To catch many more articles like this in the future, make it easy on yourself and subscribe to me via RSS. You will not regret it!

Do you have a question?
We will do our best to try and solve any building automation, protocol, integration problem you may have

Cable Specifications for RS485 Networks - Profibus

The PROFIBUS standard defines two variations of the bus cable. However it is recommended to use cable Type A in all new installations.

Type A is especially recommended for high transmission speeds (>500 kBaud) and permits doubling of the network distance in comparison to Type B.

Technical specification:

Impedance: 35 up to 165 Ohm at frequencies from 3 to 20 Mhz.

Cable capacity: < 30 pF per meter.

Core diameter: > 0,34 mm², corresponds to AWG 22.

Cable type: twisted pair cable. 1×2 or 2×2 or 1×4 lines.

Resistance: < 110 Ohm per km.

Signal attenuation: max. 9 dB over total length of line section.

Shielding: CU shielding braid or shielding braid and shielding foil

Max. Bus length: 200 m at 1500 kbit/s, up to 1,2 km at 93,75 kbit/s. Extendable by repeaters.

Did you like this post?

Subscribe To The RSS Feed!
To catch many more articles like this in the future, make it easy on yourself and subscribe to me via RSS. You will not regret it!

Do you have a question?
We will do our best to try and solve any building automation, protocol, integration problem you may have