Skip to main content



      Home
Home » Eclipse Projects » 4DIAC - Framework for Distributed Industrial Automation and Control » Interfacing input-->output with type ANY_MAGNITUDE(Cannot infer type based on...)
Interfacing input-->output with type ANY_MAGNITUDE [message #1873298] Wed, 11 December 2024 08:14 Go to next message
Eclipse UserFriend
I am trying to setup a project using some FBs with I/Os with type ANY_MAGNITUDE. When connecting these outputs with inputs 4Diac-IDE gives an error message "Cannot infer type based on...".
How can I fix this issue? Do I need a type-cast function block.
Re: Interfacing input-->output with type ANY_MAGNITUDE [message #1873301 is a reply to message #1873298] Wed, 11 December 2024 08:22 Go to previous messageGo to next message
Eclipse UserFriend
Per rules of IEC 61131-3 during "compile time" the type has to be defined. So one of the two sides of a connection normally need to be of a concrete type. If that is because of the blocks not possible you need to cast them. In the latest 4diac IDE preview edition you can do that with F_MOVE. In the property sheet of an F_MOVE you can specify the type you would like to cast.
Re: Interfacing input-->output with type ANY_MAGNITUDE [message #1873304 is a reply to message #1873301] Wed, 11 December 2024 09:04 Go to previous messageGo to next message
Eclipse UserFriend
Thank you, F_MOVE does the job.
Is there a possibility that the type is being "propagated" through the FB; e.g. if I have an INT on the input side, I will get an INT on the output side (if the output of the FB is defined as ANY_MAGNITUDE)?
Re: Interfacing input-->output with type ANY_MAGNITUDE [message #1873307 is a reply to message #1873304] Wed, 11 December 2024 09:17 Go to previous messageGo to next message
Eclipse UserFriend
We are considering how to do this. But it is not that easy especially when you have blocks with more inputs.
Re: Interfacing input-->output with type ANY_MAGNITUDE [message #1873310 is a reply to message #1873307] Wed, 11 December 2024 09:48 Go to previous message
Eclipse UserFriend
Maybe it can be done at least for those FBs where it is possible or easy to implement; e.g. F_ADD to be handled like in C language: if one input is INT and the other one is REAL, then the result is REAL (implicit type casting).
Onother possibility might be that each output of an FB can be configured via the properties. But I don't know if that is possible because I don't know how it is handled internally.
Previous Topic:"Internal FBs" in a Basic Function Blocks
Next Topic:Missing Export Builder on 4diac IDE project WED_Demo
Goto Forum:
  


Current Time: Mon Jul 07 03:14:44 EDT 2025

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

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

Back to the top