Sending data

Sending includes generating the data for the send buffer and sending it using the instructions SendCharacters, SendCharactersAndClearString, SendData or F159_MTRN.SendCharacters and SendCharactersAndClearString implicitly use F159_MTRN. The start and end codes specified in the system registers are automatically added to the data sent. The maximum volume of data that can be sent is 16384 bytes.

Procedure for sending data to external devices:

  1. Set communication parameters

    Required settings: communication mode (program controlled), baud rate, communication format

  2. Write to send buffer
    Not necessary when using SendCharacters or SendCharactersAndClearString.
  3. Execute send command

    Use one of the following instructions:

    Instruction

    Comment

    SendCharacters

    Easy to use, fits most applications, may require more data memory

    SendCharactersAndClearString

    Like SendCharacters but works without send buffer, may require less data memory

    F159_MTRN

    Original F instruction with complete set of parameters, additional transfer instruction required to write data to send buffer

  4. Optional: Evaluate "transmission done" flag

    Use one of the following methods:

    Method

    Comment

    IsTransmissionDone

    Returns the value of the "transmission done" flag. It turns to TRUE when the specified number of bytes has been sent.

    sys_bIsComPort1TransmissionDone

    sys_bIsComPort2TransmissionDone

    sys_bIsToolPortTransmissionDone

    These system variables turn to TRUE when the specified number of bytes has been sent.

    Input (X) flags X4 and X5 (MCU only)

    These flags can be used to verify the end of transmission with a Multi-Communication Unit.

NOTE
  • When the specified number of bytes has been sent, the "transmission done" flag turns to TRUE. New data may be sent or received. Any send instruction turns the "transmission done" flag to FALSE and no data can be received. Evaluation of the "transmission done" flag may be useful in cases where no response can be expected, e.g. with broadcast messages.
  • Data cannot be sent unless the pin CS (Clear to Send) is on. When connecting to a three-wire port, short-circuit the RS and CS pins.
Related topics:

Modified on: 2022-01-14Feedback on this pagePanasonic hotline