FbSmtpSendMail_sMessage

Hello all,

Wondering if it’s possible to make this code smoother (fewer operations)? I’m not a expert on structured text.
Want to create a multi-line STRING on ‘sMessage’, and also add a value from a variable somewhere in the line.

Best regards
Rune

There are three options with WagoAppString library, where you can find functions also for strings longer than 255 characters:

  • Concat3…9.
  • Format1…9
  • StrAppend

Here is example of usage of StrAppend function:

VAR
   sBuffer : String(1024);
END_VAR

sBuffer:='';
StrAppend(sBuffer,SizeOf(sBuffer), 'Temperature:');
StrAppend(sBuffer,SizeOf(sBuffer), ' ');
StrAppend(sBuffer,SizeOf(sBuffer), TO_STRING(rTemperatureVariable));
StrAppend(sBuffer,SizeOf(sBuffer), '°C');
4 Likes

Thnx for the advice, Damian.
That’s solved the case.

/Rune