Specifications

2 RS232 I/O Support
2-14
Note Field names in the structures are case sensitive.
RS232_Send_Receive(1).SendData = ’da_1234,%d,%f,;\n’;
RS232_Send_Receive(1).InputPorts = [1 2];
RS232_Send_Receive(1).RecData = ’noerror\n’;
RS232_Send_Receive(1).OutputPorts = [1];
RS232_Send_Receive(1).Timeout = 0.01;
RS232_Send_Receive(1).EOM = 1;
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 inputs and outputs defined in the
structures to the blocks.
7 Connect the input and output ports on the RS-232 driver blocks to other
blocks in your Simulink model.
You model should look similar to the figure shown below.