Chapter 6. Serial I/O, SNP & RTU ProtocolsGFK-2222AD April 2018 2216.2.13 Write Bytes Function (4401)This operation can be used to transmit one or more characters to the remote device through thespecified serial port. The character(s) to be transmitted must be in a word reference memory. Theyshould not be changed until the operation is complete.Up to 250 characters can be transmitted with a single invocation of this operation. The status of theoperation is not complete until all the characters have been transmitted or until a timeout occurs (forexample, if hardware flow control is being used and the remote device never enables the transmission).Example Command Block for the Write Bytes FunctionValue(decimal)Value(hexadecimal)MeaningAddress 0006 0006 Data block length (includes characters to send)Address +1 0000 0000 NOWAIT modeAddress +2 0008 0008 Status word memory type (%R)Address +3 0000 0000 Status word address minus 1 (%R0001)Address +4 0000 0000 Not usedAddress +5 0000 0000 Not usedAddress +6 4401 1131 Write bytes commandAddress +7 0030 001E Transmit time-out (30 seconds). See note below.Address +8 0005 0005 Number of bytes to writeAddress +9 25960 6568 ‘h’ (68h), ‘e’ (65h)Address +10 27756 6C6C ‘l’ (6Ch), ‘l’ (6Ch)Address +11 0111 006F ‘o’ (6Fh)Although printable ASCII characters are used in this example, there is no restriction on the values of thecharacters that can be transmitted.Operating NotesSpecifying zero as the Transmit time-out sets the time-out value to the amount of time actually neededto transmit the data, plus 4 seconds.CautionIf an Initialize Port (4300) COMMEQ is sent or a CancelOperation (4399) COMMREQ is sent in either Cancel All orCancel Write mode while this COMMREQ is transmitting astring from a serial port, transmission is halted. The positionwithin the string where the transmission is halted isindeterminate. In addition, the final character received by thedevice the CPU is sending to is also indeterminate.