...
the "read I&M indication" and the "reset to factory indication". For that, the application needs a possibility to save information remanent in a flash.
...
The next step is the use of the same data in the configuration packet like in the I&M0 informations.
For Example you can create first You can for Example first create a structure of I&M0 and than use it:
ptSetConfig→ulVendorId = IM0.usManufacturerId;
ptSetConfig->usSwRevision1 >usSwRevision1 = IM0.tSoftwareRevision.bX;
ptSetConfig->usSwRevision2 >usSwRevision2 = IM0.tSoftwareRevision.bY;
ptSetConfig->usSwRevision3 >usSwRevision3 = IM0.tSoftwareRevision.bZ;
...
In the GSDML the device developer needs to give the information , about which module has I&M data. Below you see the default configuration in our PNS V5.1.0.4 device.
I&M is , at the moment, currently just configured for the DAP:
<VirtualSubmoduleItem ID="DIM 31" IM5_Supported="false" MayIssueProcessAlarm="false" SubmoduleIdentNumber="0x00003010" Writeable_IM_Records="1 2 3">
That means, I&M0 till 3 is supported to 3. I&M4 and 5 are is not supported. Only the DAP module has I&M Data.
...
That means the DAP has now I&M0 till to 3 and the 10 Byte Input module has its own dataset for I&M0 till to 2.
In this case the I&M data handling needs to be implemented in your application, because the stack can only handle the default I&M data on the DAP.
...
The stack does not know anything about the GSDML file. The stack first needs the information about supported I&M data. For that
Therefore the stack sends , in startup, the PNS_IF_READ_IM_IND in startup, with the parameter PNS_IF_IM_TYPE_IM0FILTER.
That means the stack wants to get from the application the information of which modules do support their own I&M data, from the application.
The application can response with some flags to this stack request.
...
PNS_IF_IM0_FILTER_DATA_MODULE_REF means, that the I&M data of this Modul are the reference for all submodules which belong to this module:
(All other submodules response respond with the I&M data from the DAP)
...
PNS_IF_IM0_FILTER_DATA_DEVICE_REF this is only used only one time (on the DAP) and means, that all other modules and submodules without own I&M data will refer to this module:
(All other modules and submodules response respond with the I&M data from the DAP)
...
(Slot 2 has its own I&M data and will not response respond with the I&M data from the DAP)
(For the Modul Module which is not marked yellow, only ptReadImRes->tData.tData.atIM0FilterData[0].ulFlags = PNS_IF_IM0_FILTER_DATA_HAS_IM_DATA; is necessary, because there are no submodules)
More informations to I&M can be found on here: How to deal with I&M data? (Updated 2016-12-20)
...
I&M0 is always read only. In If a PNS_IF_WRITE_IM_IND comes for I&M0, than this can not be correct. I&M0 has the value usIMRevisionCounter. This must be updatet as soon as I&M1 till to 4 go are written.
I&M1 till 4 are read/write and need to be saved remanent on the application flash.
...