Below a code segment and an error message. The error message is generated when executing the statement : Add items to list Samplebuffer Item val. This was determined by disabling this instruction , resulting in no error message (or, rather, a different error generated lower down as an artifact). Samplebuffer is declared as a local array, and I wish to add values to this array. It looks like ai2 does not recognise the reference to Samlebuffer. It sees the correct index to the array (1). Is Samplebuffer out of scope? I cannot see any reason to be out of scope. Any other obvious other reason for this strange behaviour?
Second question. I wish to transfer to this procedure a pointer to the Samplebuffer array. This will greatly facilitate the efficiency of the code. I tried passing the name of an array as a parameter to a function and then accessing specific (indexed) values in the array but no success.
@TIMAI2 lst is set to an empty string only to reproduce the error.
As far as I know there is no timeout in the bluetooth ReceiveUnsignedBytes so you should check for bytes availability ( at least before calling readmeteoData ) or your app may freeze ( for example the ReceiveUnsignedBytes you call should return only after 21 bytes are received ) .
I could be wrong, but it does not seem the error is caused by the blocks you posted.