|
Re: Why "INF" value in composite fb? [message #1750666 is a reply to message #1750656] |
Sat, 24 December 2016 10:46 |
|
I think the problem is that you are specifying only 2.0 at the second input of the F_DIV block. As the inputs are of type ANY_NUM the code does not know what to do with the 2.0 wand will ignore it. Therefore the second input stays at 0.0 and you will get a division by zero.
In order to do this correctly you would need to specify the type with your parameter (e.g., REAL#2.0). With that the runtime knows your intention.
I know this is not nice and already the tool should handle this. Generally I would say that the basic FB solution is for your problem the better and more clean solution. It uses less memory and will also be much faster.
In my personal opinion I would use the generic math blocks only when there is some simple adaption between some existing FBs needed. E.g., you need to combine two values to form a new one. For applicaiton components I would not recommend them. Most of the time the resulting FB networks are very complicated, hard to understand and maintain.
P.S.: While thinking about why you have this issue I came up with a workaround for the REAL2REAL FB: If you give also a parameter value with REAL#0 for the first input of F_DIV then the input should be correctly typed and a direct connection between F_ADD and F_DIV should be possible. As I'm currently in the train I haven't tested it. But you could give it a try. This should work in applications and CFBs alike.
|
|
|
Powered by
FUDForum. Page generated in 0.24341 seconds