Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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] Tue, 16 July 2019 02:15 Go to next message
Felipe Adriano da Silva Gonçalves is currently offline Felipe Adriano da Silva GonçalvesFriend
Messages: 35
Registered: February 2017
Location: Brazil
Member
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: Tue, 16 July 2019 02:16]

Report message to a 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 06:52 Go to previous message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1584
Registered: January 2014
Senior Member

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: Tue Apr 23 11:37:40 GMT 2024

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

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

Back to the top