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 » Use STRING datatype with IEC61131 F_SEL block
Use STRING datatype with IEC61131 F_SEL block [message #1733888] Wed, 01 June 2016 20:36 Go to next message
Herwig Eichler is currently offline Herwig EichlerFriend
Messages: 18
Registered: February 2016
Junior Member
Hi,

I'd like to switch between two string constants, depending on a BOOL value. That's why the F_SEL block was my first guess. Both inputs are of datatype ANY so i thought i can connect a STRING there. When I try to enter the string constants directly in the F_SEL properties, the IDE tells me, that this is not allowed. Also connecting other FB with STRING outputs to the F_SEL does not work.
Is there any easy way to achieve this, without having to create my own F_SEL_STRING block and compile it into FORTE?

Thanks
Herwig
Re: Use STRING datatype with IEC61131 F_SEL block [message #1733893 is a reply to message #1733888] Wed, 01 June 2016 21:36 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1582
Registered: January 2014
Senior Member

HI,

could you be more specific on the error message. You should be able to put string constants on F_SEL. However as it is an ANY input you have to add the type information to your constants following the IEC 61131-3 literal conventions. For strings this means that you have to add STRING# upfront (e.g, STRING#MYSTRingconstant).

Also connecting strings should work. Could you say more on what is not working there?

Alois
Re: Use STRING datatype with IEC61131 F_SEL block [message #1733912 is a reply to message #1733893] Thu, 02 June 2016 07:55 Go to previous messageGo to next message
Herwig Eichler is currently offline Herwig EichlerFriend
Messages: 18
Registered: February 2016
Junior Member
Hi Alois,
thanks for your feedback. I did not use the STRING#, so this explains why i was not able to set the string constant in the F_SEL directly. I will try this on the weekend. When trying to connect the output of a CONCAT block with the F_SEL input I see a small prohibition sign and the wire is not connected and disappears when i release the mouse button.

greetings
Herwig
Re: Use STRING datatype with IEC61131 F_SEL block [message #1733936 is a reply to message #1733912] Thu, 02 June 2016 10:39 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1582
Registered: January 2014
Senior Member

Hi Herwig,

thanks for the clarification. The problem with the CONCAT block is that it has as in and outputs ANY_STRINGS which have to be typed as well. Unfortunately we are currently not very good in propagating the type through a network. So for now you would need to insert a STRING2STRING FB between CONCAT and F_SEL. I know this is ugly and I really want to have this gone.

The CONCAT function is maybe better used in algorithms there I think it will also be more efficient as the compiler can optimize away some overhead.

Alois
Re: Use STRING datatype with IEC61131 F_SEL block [message #1734136 is a reply to message #1733936] Sat, 04 June 2016 18:23 Go to previous messageGo to next message
Herwig Eichler is currently offline Herwig EichlerFriend
Messages: 18
Registered: February 2016
Junior Member
Hi Alois,
the string constant STRING#MyString works now.
I cannot find a STRING2STRING block in the library, at least it is not part of the IEC61131-3 conversion blocks. I can find a STRING_TO_WSTRING converter

kind regards
Herwig
Re: Use STRING datatype with IEC61131 F_SEL block [message #1734185 is a reply to message #1734136] Sun, 05 June 2016 21:32 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1582
Registered: January 2014
Senior Member

STRING2STRING is in the conversion library (Edit: which is outside of the IEC 61131-3 lib).

Cheers,
Alois

[Updated on: Sun, 05 June 2016 21:32]

Report message to a moderator

Re: Use STRING datatype with IEC61131 F_SEL block [message #1734284 is a reply to message #1734185] Mon, 06 June 2016 18:18 Go to previous message
Herwig Eichler is currently offline Herwig EichlerFriend
Messages: 18
Registered: February 2016
Junior Member
Thanks, Alois

it's working now, I overlooked the "convert" folder in the type library Embarrassed and only searched within the IEC61131-3 converters.
The STRING2STRING after the F_SEL did the trick.
greetings
Herwig
Previous Topic:SubApp Error
Next Topic:BeagleBoard-X15
Goto Forum:
  


Current Time: Fri Apr 19 09:12:21 GMT 2024

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

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

Back to the top