That is not a modbus protocol. That's a custom serial protocol, by the brief looks of it.
This protocol could be implemented using a Scripting Data Source, a Point Link and a Serial Data Source, but I would not expect it to be easy.
From briefly reading the document, you'll want something like...
- Serial Data Souce:
configuration in hex: true
message regex: ().*
point identifier index: 1
- Two serial data points, I will call one 'COMMAND' and one 'RESPONSE'
COMMAND:
data type: alphanumeric
value regex: .*
value index: 0
settable: true
identifier: COMMAND
RESPONSE:
data type: alphanumeric
value regex: .*
value index: 0
settable: false
identifier:
The RESPONSE serial point will catch everything, and COMMAND will be the place we send queries of values from.
- Create a Scriping Data Source, don't worry about the script just yet. Create a point on the scripting data source, call it 'Message Queue' and give it the variable name 'mesq' or whatever you like. Make it settable.
- Create a Point Link from the RESPONSE to the Message Queue. In the script body of the Point Link,
//pseudocode
function extractMessageInformation( message ) {
//You would have to implement this based on the protocol
// "message" should appear as the full hexadecimal of the message as a string meaning
// every two characters is a byte. Part of your protocol says the actual data segment is
// ASCII encoded, so you may need to pass that substring to an hex_to_ascii( string ) function
// or the other way around. You'll want to return a string with an identifier and value
// I will presume they are identifier-value
}
message = extractMessageInformation(source.value);
return target.value + message + ";";
- Create the script on the scripting data source. Add points to the context for every point you are reading from the meter, so that you can set the parsed values out to these points.
var identifierMap = { "messageIdentifier" : contextPoint1 .... }
var processMessages = mesq.value; //Note this is imperfect, if the point link sets between these
mesq.set(""); //a message can be lost. You could use mesq.lastValues(2) to check that you get [processMessages, ""]
var index = -1;
while( (index = processMessages.indexOf(";")) != -1 ) {
messageInfo = processMessages.substr(0, index).split("-");
identifierMap[ messageInfo[0] ].set(messageInfo[1]);
processMessages = processMessages.substr(index+1);
}
And that about does it! We try not to get too involved in understanding particular protocols in free support (you are welcome to post them, though), but hopefully this is enough to give you some idea.