Great!
To reply to your question in previous post: "I expect that SS1_ReceiveBlock block the for loop until it receives data, is this true?" :
No, this is not true. Both ReceiveBlock and SendBlock methods do not wait for end of the operation (they are not "blocking").
You have to use the event handler, or you can call GetBlockReceivedStatus and GetBlockSendStatus to check if the reception/sending has finished (you need to enable these methods then).
So your code could optionally be:
...
err = SS1_ReceiveBlock(slaveDevData1, InpDataSlave1, 2); /* Request data block reception */
err = SS1_SendBlock(slaveDevData1, &out, 2); /* Start transmission/reception */
while (!SS1_GetBlockReceivedStatus(slaveDevData1)); /* Wait until data block is transmitted/received */
...
This way you can completely omit the event code if you just need to wait till it's send.
I have noticed one more thing in the code, that I would like to warn about:
The boolean values like check while (DataReceivedFlagSlave1 != TRUE) may not generally always work in all cases.
The problem is that true logical value is in C defined as any non-zero value, so if you test to only TRUE which is a number constant (typically 1), it won't work when the value hidden inside the bool variable will be e.g. 255 (which still fulfills the definition of "true" value).
There should be instead used while (!DataReceivedFlagSlave1) ... .
Best regards
Petr Hradsky
Processor Expert Support Team