Re: FBDK (2.6/3.3): String guard evaluation in ECC

21 views
Skip to first unread message

James Christensen

unread,
Aug 28, 2018, 2:56:18 PM8/28/18
to Hopsu Alexander, FBDK
Alexander, thanks for pointing out this problem.
The FBDK's ECTransition condition checker doesn't recognize the STRING and WSTRING delimiters (' and " respectively).
It wouldn't help if it did, because the FBDK's Java generator does not use a full IEC 61131-3 parser, and will not generate the proper code for the STRING and WSTRING infix operators in ST expressions, except for possibly the WSTRING "+" (append) operator.

It would be possible to use "Simple FB" implementations of some of the IEC 61131-3 STRING and WSTRING functions to work this example, but the FBDK libraries of these FB types are incomplete as there has never been any demand for them.

Attached are two alternative implementations of a 5-button calculator.
The CALC5 FB type should be portable.
The CALC5TS FB type uses the proposed "Transient State" construction, which makes the ECC faster to program and more efficient at runtime in this and many other instances. 
--
Best regards,
Jim Christensen

On Mon, Aug 27, 2018 at 5:54 PM, Hopsu Alexander <alexand...@aalto.fi> wrote:

Hi,


I'm an automation engineering student from Aalto University, Espoo, Finland. I'm doing minor study on different IEC 61499 compliant tools, and would like ask you one question, what I haven't figure out from the internet:


Does the use of strings work properly in FBDK? Or how do I create a guard condition where I can evaluate the value of some inserted string text with some constant string value? (The ECC in the figure, which is imported from outside because it is not possible to create similar in FBDK. The compiling of the ECC does not also succeed) The purpose of the function block is just to calculate the result of two values with specific inserted operator.


I have tried also to use a trick where I use an internal variable, which has the same constant value as I have tried to insert directly into the ECC transition guard condition. (For example, internal variable Plus, which has '+' as the initial value, then writing OPER = Plus into the guard condition). The function block can be then compiled successfully, but the evaluation of the strings does not seem to work properly, as any of the transitions is never firing.


Is the use of strings somehow limited in FBDK, or do they have to be written in some special way to get them work in ECC?




Best Regards,


Alexander Hopsu

alexand...@aalto.fi

Aalto University

Espoo, Finland


CALC5.fbt
CALC5TS.fbt

James Christensen

unread,
Aug 28, 2018, 3:37:31 PM8/28/18
to Hopsu Alexander, FBDK
Oops, CALC5 had the wrong initial state!
Attached is the corrected version.
These FB types are now in the FBDK's self-updating src.zip archive.
Their documentation will be added to the FBNavigator (in the student folder) soon.
--
Best regards,
Jim Christensen


CALC5.fbt
Reply all
Reply to author
Forward
0 new messages