Hello rapidM2M Community,
Within the rapidm2m-c3xx-base library it is possible to group together several commands to a command sequence. This functionality is useful to reduce traffic on the IO controller’s SPI/UART interface.
The rapidm2m-c3xx-base library now includes enhanced command sequence handling that simplifies application development.
There are two different command sequence modes, “single” and “multiple”.
The command sequence is directly sent to the IO Controller after it is built and is NOT persistent. I.e., it cannot be sent to the IO controller again later in the same form. This command sequences mode is suitable for sequences that are only required once (e.g. initialization procedure of an UI channel).
A new “single” command sequence is initiated with the IOCtrl_SeqEnterSingle() function. IO controller commands (e.g., IOCtrl_UI_Init()) can then be added. With the Function IOCtrl_SeqExitAndSendSingle(), the command sequence is completed and immediately sent to the IO Controller.
“Multiple” command sequences are persistent after being built. Therefore, it is not necessary to rebuild the sequence every time, before sending the sequence.
So “multiple” command sequences are suitable for sequences that are to be sent repeatedly in the same form to the IO Controller (e.g., reading out the UI channels in the measurement interval).
A new “multiple” command sequence is initiated with the IOCtrl_SeqEnterMultiple() function. IO controller commands (e.g., IOCtrl_UI_GetValue()) can then be added. With the Function IOCtrl_SeqExitMultiple(), the command sequence is completed. To send the command sequence to the IO Controller, the function IOCtrl_SeqSendMultiple() must be called. Since “multiple” command sequences are persistent after creation, the command sequence can be repeatedly sent to the IO Controller using the IOCtrl_SeqSendMultiple() function. This means that it is not necessary to recreate the command sequence every time. When created, a unique ID is assigned to the “multiple” command sequence that can be used to distinguish the individual sequences when sending them to the IO Controller.