Running and Debugging single BFB [message #1729319] |
Tue, 12 April 2016 20:33  |
Eclipse User |
|
|
|
Hello!
I am new to 4DIAC. In my application, I am adding F_ADD function block and deploying it on a device. I pre-assign values of input variables. When I click "Download" button, I get the following in the deployment console:
<!-- 127.0.0.1:61499: X2Y2Executor -->
<Request Action="WRITE" ID="38">
<Connection Destination="F_ADD.IN1" Source="5"/>
</Request>
<Response ID="38" Reason="BAD_PARAMS">
I watch all the variables but nothing happens when I manually trigger the REQ event. The other question I want to ask is that whether I must connect cold and warm events to my REQ input event in resource manager like they have done in Flip flop example? Can I debug it in stand alone mode explicitly triggering my input events in debug mode?
I guess there should be simple tutorial which addresses the creation of an application with single function block, running and deploying it.
Any help would be appreciated.
|
|
|
Re: Running and Debugging single BFB [message #1729453 is a reply to message #1729319] |
Thu, 14 April 2016 05:33  |
Eclipse User |
|
|
|
Hi,
testing FBs in this way is in principle possible. However as the error message implies you have specified values that can not be used by this FB's input. The reason is that F_ADD has in and outputs of type ANY_NUM. IEC 61499 is a strongly typed language and at runtime the type has to be specified. by just giving the FB a 5 the runtime does not know which type you have intended (e.g., SINT, SUINT, LINT). In order to use a constant with a inputs that are of generic type you need to specify the intended type according to the Literal mechanism defined in IEC 61131-3. That is the type followed by a hash and than the number, for example INT#5 or SINT#235.
In addition to testing a FB in an application you can also invoke the FB tester which is a tab in the fb type editor and perform tests there. For quick tests this should be faster and simpler.
|
|
|
Powered by
FUDForum. Page generated in 0.03598 seconds