xPC Target    

RS-232 Send/Receive Block (Synchronous)

The Block Parameters dialog box for the Synchronous Send & Receive block contains the following fields.

Parameter
Description
Port

From the list, select COM1, COM2, COM3, or COM4. This list allows you to define which COM port is used to send and receive the data. The model must contain one Setup block for each COM port you use to send and receive data. Otherwise, an error message is displayed. Note that data is sent and received on the same COM port.

Message Structure Name
Enter the name of the MATLAB structure this block uses to send and receive messages and data to an RS-232 device. For information to create this structure, see Creating RS-232 Message Structures (Synchronous).
Sample Time

This entry allows you to define the sample time of the block. Since this block waits for data to be received from the RS-232 external device before the block is finished executing, small sample times are not suitable with synchronous mode. You must allow sufficient time for both the RS232 send and the RS232 receive operations to be completed. The smallest sample time depends on the following.

  • Amount of data being sent
  • Amount of data being received
  • Selected baud rate
  • Response time of the external device


  RS-232 Setup Block RS-232 Send Block (Asynchronous)