Hello, I have created a flexible network interface block for Simulink, written in C (in the form of a CMEX block) that is XML-configurable. Part of my XML format is as follows, for example:
<Read name="charge" type="INT32" ip="127.0.0.1" port="2501" register="23">
<Read name="voltage" type="INT32" ip="127.0.0.1" port="2501" register="27">
<Read name="level (ft)" type="INT32" ip="127.0.0.1" port="2501" register="29">
<Read name="speed (ft/s)" type="INT32" ip="127.0.0.1" port="2501" register="24">
What my block does is work down the list, collect the four values from the network, and then populate a run-time-sized "vector" (ie an array that is passed between my C code and the simulink model) with the four values [charge, voltage,level,speed]. The simulink must be designed to extract the four engineering values in this order and do something with them. So this is a "contract" between the simulink design and the XML content. The idea is that if you make changes to the system you can modify the list of gathered values without changing the C code, you just have to update the XML and the simulink to handle the gathered data.
Make any sense?
In any case, I was very proud to have made the C code "futureproof" (ie not have to be changed again, since it was a pain to change through the CMEX editor) with this flexible interface -- and be able to do anything needed by working with just Simulink and XML. But I am getting robust push back on the fact that the order of those four nodes matter (ie if you mix up the order of two elements it will not work correctly). The client feels that this isn't standard XML if the order matters, and feels that it is a maintainability issue for the author of the XML to get the order perfect (ie if they swap two rows then the values get crossed).
They would like to build in some sort of lookup table or index attribute so that the order of the nodes can be mixed up, but some intelligence on the C or Simulink side will put them in the proper order.
I think this will add needless complexity. There is no way around the implied contract, no way to really reduce the maintenance burden, at best just move it around.
So any reactions? Is the burden of getting the order correct too onerous? And/or have I "broken a rule" by making order matter within my XML elements?