Problem Statement
Provide efficient intraprocess multicasting of data without resorting to more expensive interprocess communication methods such as UDP multicast.
Framework
In contrast to the PUBLISH and SUBSCRIBE
types described in Annex E of IEC 61499-1, which use communication networks
for exchange of data, instances of PUBL_n and SUBL_n
service interface types are used for local (within the same runtime
process) multicast publishing and subscribing of data. The service
interface types and associated service sequences for n=1
are illustrated below. In addition to increased speed of data
transfer vs. PUBLISH/SUBSCRIBE , these blocks offer the
following convenience features:
-
The local multicast group is identified by the
IDinput. For convenience, the default value of this input is set to the function block's instance name. This can be overridden by connection to a non-default variable or configuration parameter. -
The number of data elements is given by the
nsuffix of the function block type. The number of data elements, say nP, transmitted by aPUBL_ninstance on a given channel need not match the number of output elements, saynS, of aSUBL_ninstance on the same channel. If nP>nS, theSUBL_ninstance will ignore the extra data elements; if nP<nSthe extra outputs of theSUBL_ninstance will remain at their initial values. -
If a
RD_ioutput of aSUBL_nblock is not connected or is connected to a variable of a different data type than that of the correspondingSD_iinput of aPUBL_nblock on the same local mulitcast channel, theSD_ivalue will not be copied to theRD_ivariable and no error condition will result.
Methodology
As noted above, the use of the local
multicast function block types PUBL_n/SUBL_n is subject
to substantially fewer restrictions than the use of the
corresponding distributed multicast types PUBLISH_n/SUBSCRIBE_n
. As a result, care must be exercised when converting from a design
which uses local multicast to a design using distributed multicast.
In particular, for distributed multicast:
-
The
IDinput must be an appropriate identifier for a distributed multicast group, such as a UDP multicast group address. -
The number of data elements given by the
nsuffix of the function block type must be identical for all publishers and subscribers in distributed multicast group. -
The
SD_i (i=0,1,...,n-1)inputs ofPUBLISH_ninstances must be connected to variables of concrete type, i.e., not the abstractANYtype, in order to permit their proper encoding for transmission. Similar restrictions apply to the correspondingRD_i (i=0,1,...,n-1)outputs ofSUBSCRIBE_ninstances, and the types of eachSD_ivariable and the correspondingRD_ivariable must match at both ends of the multicast connection for each value ofi.
For other examples of the application of this methodology see the documentation of the MVCD design pattern.
Implementation
In addition to the sharing of local multicast channels across Resources
in the same Device, the FBRT implementation of this design
pattern permits the sharing of channels among Devices in the
same Java™ runtime process, for example Devices that are
launched from the same SystemManager. This usage can be documented
through the use of a LocalBus segment in the System diagram;
for an example see the ASM_VIEWL
System configuration.