The main problem I had initially was timeouts, so I increased to 5 seconds, but probably could go to 10.
Also, I have the character timeout in the gateway set at 5 now, but this seems to be a grey area according to my
research. And then there is the Xbee radio paketization timeout, which I have set at 5 also, in the co-ordinator
and the end node radios, another grey area. Have not used a router in between at this stage, but may slow things
down a bit with more hops. The Arduino is sending data via its end node at only 9600! I think by adjusting the arduino
MODBUS slave library to accommodate a higher baud rate would really help.
Definitions:
Packetization Timeout
The number of character times of inter-character delay required before transmission. If set to zero, characters are
transmitted as soon as they arrive instead of buffering them into one RF packet.
Character Timeout
Specifies how long to wait for additional message data before discarding a partially received message.
I am still learning a lot about Xbee, but it appears now to transport MODBUS very successfully, especially
seeing as it it getting translated from TCP to RTU and vica versa in the gateway. My test node is pulling
4 analog values and sending one digital output every 5 seconds, but is capable of 6AI, 2AO, 6DI and 4DO.
This is all the pins used up on a Arduino UNO. You could also change the combinations if you like.
I would be happy to pass on any knowledge I have about this subject.
Below is the Mango Data source for the Arduino/Xbee node:
{
"xid":"DS_101326",
"type":"MODBUS_IP",
"alarmLevels":{
"DATA_SOURCE_EXCEPTION":"INFORMATION",
"POINT_READ_EXCEPTION":"INFORMATION",
"POINT_WRITE_EXCEPTION":"INFORMATION"
},
"purgeType":"YEARS",
"updatePeriodType":"SECONDS",
"transportType":"TCP_KEEP_ALIVE",
"encapsulated":false,
"host":"10.1.1.12",
"port":502,
"contiguousBatches":false,
"createSlaveMonitorPoints":false,
"discardDataDelay":2500,
"logIO":false,
"maxReadBitCount":2000,
"maxReadRegisterCount":125,
"maxWriteRegisterCount":120,
"multipleWritesOnly":false,
"quantize":false,
"retries":2,
"timeout":5000,
"updatePeriods":5,
"enabled":true,
"name":"Arduino1",
"purgeOverride":true,
"purgePeriod":1
},
Cabinet Temperature data point:
{
"loggingType":"INTERVAL",
"intervalLoggingPeriodType":"MINUTES",
"intervalLoggingType":"AVERAGE",
"purgeType":"YEARS",
"pointLocator":{
"range":"INPUT_REGISTER",
"modbusDataType":"TWO_BYTE_INT_UNSIGNED",
"writeType":"NOT_SETTABLE",
"additive":0.0,
"bit":0,
"charset":"ASCII",
"multiplier":0.488,
"offset":3,
"registerCount":0,
"slaveId":1,
"slaveMonitor":false
},
"eventDetectors":[
{
"xid":"PED_959001",
"type":"HIGH_LIMIT",
"alarmLevel":"CRITICAL",
"limit":45.0,
"durationType":"MINUTES",
"duration":1,
"alias":""
}
],
"engineeringUnits":"Degrees celsius",
"plotType":"STEP",
"chartColour":"",
"chartRenderer":{
"type":"IMAGE",
"timePeriodType":"HOURS",
"numberOfPeriods":8
},
"dataSourceXid":"DS_101326",
"defaultCacheSize":1,
"deviceName":"Arduino1",
"discardExtremeValues":false,
"discardHighLimit":45.0,
"discardLowLimit":5.0,
"enabled":true,
"intervalLoggingPeriod":15,
"name":"Cabinet Temperature",
"purgeOverride":true,
"purgePeriod":1,
"textRenderer":{
"type":"ANALOG",
"format":"0.00",
"suffix":"°C in Pole Cabinet"
},
"tolerance":0.25,
"xid":"DP_144357"
},