|
Re: understanding when to use converter function blocks [message #1732473 is a reply to message #1732465] |
Tue, 17 May 2016 14:28 |
Martin Melik Merkumians Messages: 117 Registered: March 2016 |
Senior Member |
|
|
The rule if a converter FB is needed is as follows:
If both sides of a data connection to be connected are of an ANY type (e.g., ANY, ANY_NUM, ANY_MAGNITUDE,...) then a converter FB is needed. If one of the connection's ends has a concrete type (INT, DINT, WORD, STRING), then this type is used to typify the other side of the connection.
This is due the fact that ANY types are abstract, non-instantiable types. In order to create a valid data connection at least one end of a connection has to be a concrete type, which is then used to typify both the data connection, as well as the ANY port of an FB at runtime.
So in case of connecting an RD of a subscriber (type ANY) with an SD of a publisher (also type ANY) a converter FB has to be introduced to typify both sides of the desired connection. In case of the RD connected to the PRESS FB, the data inputs are already of a concrete type, which is used to typify the RD of the subscriber
Kind regards,
Martin
|
|
|
Powered by
FUDForum. Page generated in 0.01963 seconds