Specifications
RS-232 Asynchronous Mode
2-23
Note Field names in the structures are case sensitive.
RS232_Send(1).SendData = ’start,%f,%f,stop;\r’;
RS232_Send(1).InputPorts = [1,2];
RS232_Send(1).Timout = 0.01;
RS232_Receive(1).RecData = ’start,%f,%f,stop;\r’;
RS232_Receive(1).OutputPorts = [2,1];
RS232_Receive(1).Timout = 0.01;
RS232_Receive(1).EOM 1;
Note If you do not manually load the message structures before opening
your Simulink model, or have the message structures automatically loaded
with the model, the port connections to the RS-232 blocks break.
3 From the File menu, click Save As. In the Save As File dialog box, enter the
name of the M-file script. For example, enter
RS232_Messages.m
4 Close the text editing window.
5 In the MATLAB command window, type the name of the M-file script you
created with the RS-232 structures. For example, type
RS232_Messages
MATLAB loads and runs the M-file script to create the message structures
in the MATLAB workspace needed by the RS-232 driver blocks.
6 Open your Simulink model, or press Ctrl+D.
Simulink updates the RS-232 driver blocks with the information from the
structures. For example, Simulink adds the inputs and outputs defined in
the structures to the blocks.