Skip to main content



      Home
Home » Eclipse Projects » 4DIAC - Framework for Distributed Industrial Automation and Control » Trailing backslash does not work when you want use special character in STRING parameters
Trailing backslash does not work when you want use special character in STRING parameters [message #1809416] Mon, 15 July 2019 22:15 Go to next message
Eclipse UserFriend
How I can use special character like ", ], [ # % in a STRING parameter in function block. I tryed to use using Trailing backslash (\", \[, \%), but STRING get corrupted in FORTE.

Thanks in advance.

[Updated on: Mon, 15 July 2019 22:16] by Moderator

Re: Trailing backslash does not work when you want use special character in STRING parameters [message #1809430 is a reply to message #1809416] Tue, 16 July 2019 02:52 Go to previous message
Eclipse UserFriend
You need to follow the IEC 61131-3 rules for STRING literals. The characters you are mentioning are in IEC 61131-3 strings no special characters you can just use them. the main reason is that the for STRINGS the ' is the delimiter. " is only used for WSTRING. However in Eclipse 4diac we allow you to omit the STRING/WSTRING delimiters when you are specifying FB parameters. We only need them if you have arrays of STRINGS, or STRINGS in a STRUCT or when you are using STRING/WSTRING literals in ST code.

If you need special characters (e.g., ' inside of a STRING literal or " inside of a WSTRING literal) you need to escape them with $ (e.g., $'). Therefore you also need to escape $ if you want a $ sign in your string.

I hope this helps.
Previous Topic:about dns
Next Topic:"External event queue is full, external event dropped!" in forte console
Goto Forum:
  


Current Time: Wed Jul 23 05:06:32 EDT 2025

Powered by FUDForum. Page generated in 0.06440 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top