MATLAB: How to receive multiple inputs from the RS232 Asynchronous Receive block in xPC Target 2.7.1 (R14SP1)

asynchronousframeoutputportsreceivers232Simulink Real-Time

I want to send more than one output from the RS232 Asynchronous Receive block. I have my "RS232_Receive(1).RecData" so that it is set to receive three variables as follows:
RS232_Receive(1).RecData = '%f,%f,%f\r';
My RS232_Receive(1).OutputPorts variable is currently set to:
RS232_Receive(1).OutputPorts = [1]
Once I receive an input frame I want to separate out the three floating point numbers received. And I want to treat them as three separate variables and view the values of these variables on the xPC target scope. However I am just able to see the last floating point value on the xPC scope. How do I view all of these values on the scope?

Best Answer

This enhancement has been incorporated in Release 14 Service Pack 3 (R14SP3). For previous product releases, read below for any possible workarounds:
Documentation on the RS232 Asynchronous Receive block in xPC Target is missing information on how to receive multiple inputs.
To receive multiple inputs from RS232 Asynchronous Receive block , set RS232_Receive(1).OutputPorts so that it reads:
RS232_Receive(1).OutputPorts = [1 2 3]
This allows for three output ports as specified by [1 2 3]. This feeds the ports as follows:
1. Feeds first %f data from the RecData to output port 1
2. Feeds second %f data from the RecData to output port 2
3. Feeds third %f data from the RecData to output port 3
At this point, you can combine the signals from the 3 output ports together to send to a scope using a Mux block.