Using MMS communication, im communicating 100 BoolIO's (approx) .
Can i use 1 MMS Connect & 4 MMS Read (Parameter Size-32)? It is working..But will it affect Controller Performance?
Is it recommended to use 1 MMS connect for every MMS Read or can i use any number of MMS Read for 1 MMS connect?
Voted best answer
"Packing of simple data types into larger composite types is also a benefit."
Sorry, but NO it is not. I have seen this done in may places and in every case it makes the code and data transmission extremely difficult to follow and debug.
Any benefit you might gain from the message transmission ( and remember this is an ethernet message where size does not matter ) is lost because you must create variables to hold the packed data, logic in one controller to pack the data, and logic in another controller to unpack the data. You are likely wasting more memory and CPU that you would save in messaging. And on top of this there is no way to automatically document what you have done. And whenever somebody wants to add or alter the data transmission, hours are spent trying to understand what the last engineer did and why the documentation is not up to date. DO NOT DO THIS
MMS Communication is actually very easy, as long as you clearly and consistently lay out your code to make it obvious what data is being transferred.
- Use 1 MMS Connect per connection. A connection is from one Application (not controller) to another.
- Use as many MMS Reads as required to transmit data per connection
- Packing data provides no real benefit in MMS ( This is not an AC450, where packing is required)
- The variables in each applicaiton and the MMS Access variables can ALL have the same name. This makes tracking data incredibly easy. So your example you can connect "MyLocalVariable" in application_1 to "MyLocalVariable" as an acess variable in controller_1 and send it to a variable called "MyLocalVariable" in application_2 and application_3 and application_4. This way you know that "MyLocalVariable" has ther same value and meaning in every application of your project. And you dont need to document anything except may making a comment in the variable declaration.
I believe fewer and larger read blocks are a benefit, readcyclic might be better than manual polling.
Packing of simple data types into larger composite types is also a benefit.
I also believe the controller will try to pack as much as possible into each MMS telegram (until media MTU is reached and another telegram becomes necessary).
Depending on configuration of read or readcyclic blocks packing of more than one read in the same MMS telegram might not be possible. The more read blocks the higher the risk of excessive MMS telegrams becomes.
Bottomline: the MMS communication will increase and takes its toll at the TotalSystemLoad which both should monitored closely while developing and tuning the application.
Total MMS/second can be read at CBM->Remote System->...->Show MMS Connections.
TotalSystemLoad is shown on the SystemDiagnostics function block in default Program3 (slow task).
To obtain high communication performance without problems appropriate task splitting and tuning (offset, cycle rate) is imperative! Having all code in one large block is not optimal.
Inter Application Communication Variables, IAC have roughly five (5) times less overhead than MMSRead/Writes. Use IAC for high performance transfers or if resource situation is strained from start.
I agree with almost everything Stefan has already told you, but you have to ask your self: Does it matter?
100 signals is close to nothing, unless you already have very high total load and executing the MMS communication with very short intervals. I would however recommend you to consider transferring only the bool data. Do you really need all the overhead data within the data type BoolIO?