Table of Contents
The SFP input mailbox block allows receiving float (single) signals via the SFP optic cables. To send data float (single), the SFP output mailbox block should be used.
The SFP input mailbox block reads data and applies it to the output port of the block. It also features a second output that indicates when new data has been received. The value on the output data port will remain unchanged until new data are received.
To see how to use SFP blocks in simulation and code generation please refer to the multi-master product note.
The SFP mailboxes are implemented in hardware. Therefore, they do not load the CPU and are synchronous with the control task. Given that the control tasks of the source (SFP out) and the target (SFP in) are running at the same frequency, the writing can be executed at every control task execution without losing any data.
The SFP communication is a one-to-one type of data transmission. The mailboxes therefore only work in pairs; one input and one output.
Simulink Block
Signal specification
- The data output signal “
d
” returns a vector containing the data read. The vector length can be configured with theNumber of signals
parameter. The output data type is set to single. - The second signal is the data valid output “
v
“. It is set to 1 each time new data are available. The port is hidden by default but it can be shown using theShow data valid port
checkbox.
Parameters
Name:
defines the input mailbox name. An SFP input mailbox is linked to an SFP output mailbox when they have the same name.Number of signals:
sets the vector length of the output data.Initial value(s):
set the initial value of the data output port.Show data valid port
: shows or hide the data valid signal “v”.Show simulation input port
defines if the simulation input port is displayed or not.
PLECS block
Signal specification
- The data output signal “
d
” returns a vector containing the data read. The vector length can be configured with theNumber of signals
parameter.The output data type is set to single. - The second signal is the data valid output “
v
“. It is set to 1 each time new data are available. The port is hidden by default but it can be shown using theShow data valid port
checkbox.
Parameters
Name:
defines the input mailbox name. Data coming from a SFP output mailbox with the same name is applied to the data output port of the block.Number of signals:
sets the vector length of the output data.Initial value(s):
set the initial value of the data output port.Data valid output
: shows or hide the data valid signal “v”.