¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

SIMPL+ help...REMOVE


etienneterblanche
 

Hi,

I need to extract the a section of the following string to get the current status of an indoor Daikin unit.

Tx$ to CoolMaster = stat3 101\x0D\x0A

Rx$ from CoolMaster = \x0D\x0A101 OFF 32C 24C Low Dry OK 1\x0D\x0AOK\x0D\x0A\x0D\x0A

I currently use the following, but for some reason it doesn't update any of the serial outputs.

Some notes:
1) UID$ = 3 digit serial I'm passing to the SIMPL+ module

2) The first 3 characters of the REMOVE string must match UID$. In this example it is "101".

3) The rest of the sections within the REMOVE string always starts at the same char position within the string.

----------------------------------------------------------------------
CHANGE Rx$
{
WHILE (FIND("\x0D",Rx$,3))
{
tempStr = REMOVE("\x0D",Rx$,3);
VAL1 = ATOI(UID$);
VAL2 = ATOI(LEFT(tempStr, 5));

IF (VAL2 = VAL1)
{
Status$ = mid(tempStr, 7, 3);
Set_Temp$ = mid(tempStr, 11, 3);
Room_Temp$ = mid(tempStr, 15, 3);
Fan_Speed$ = mid(tempStr, 19, 4);
Operation$ = mid(tempStr, 24, 4);

tempStr = "";
}

ELSE
{
tempStr = "";
VAL1 = 0;
VAL2 = 0;
}

}
}
----------------------------------------------------------------------

Thank you!!
Et

Join [email protected] to automatically receive all group messages.