The Setting ‘COMx - ASCII’¶
With the selection “ASCII”, the initialization of the serial interface is done for the “free protocol”, i.e., all interface parameters can be set and any protocol can be realized.
Sending and receiving data is done by means of the blocks COM_SEND COM_SEND and COM_REC (contained in library ASCII_AC500_V10.lib). A detailed description of these blocks can be found in the ASCII_AC500_V10.lib documentation Contents.
Attention
To be able to receive data using the block COM_REC, a buffer of the size 272 bytes must be available (for example abyRecData : ARRAY[0..271] OF BYTE).
This is also required if only short telegrams are received.
The operating system provides a total of 32 buffers with 272 bytes each for the transmission and reception of data. If the PLC is in STOP mode (= pause) or the input EN at the block COM_REC is set to FALSE or the block is not called, these buffers run full.
If the block COM_REC is called again (with EN:=TRUE) before all buffers are used, the data received meanwhile are made available.
If all buffers were full, the error Invalid handle with ERR=TRUE and ERNO=16#2001=8193 is reported for one cycle. After this the reception is reset.
The reception is always reset after a download or the command Online/Reset.
Selecting “ASCII” displays the following window:
The parameters define how the serial interface will be initialized. The parameters can be grouped. They are used to initialize the following functions:
Monitoring the programming login:
Enable login
Modem control and RS485:
RTS control, TLS, CDLY
Recognition of telegram ending for reception:
Character timeout, Telegram ending selection, Telegram ending value, Telegram ending character
Checksum
Transmission parameters:
Baudrate, Parity, Data bits, Stop bits
The following settings are possible:
Parameter | Default value | Value | Meaning |
---|---|---|---|
Enable login see remark 1 | Disabled | Disabled | There is no check with regard to the Control Builder login telegram. |
Enabled | Telegrams received are checked with regard to the Control Builder login sequence. If the sequence is detected, the protocol setting is changed to ‘Online access’. -> available as of firmware 1.2.0 and PS501 V1.2 |
||
RTS control see remark 2 | none | None | No RTS control (direction control, not for PM55x and PM56x CPUs) |
telegram | RTS control activated (absolutely necessary for RS 485!) |
||
TLS see remark 2 | 0 | 0…65535 | Carrier lead time in [ms] (TLS > CDLY) |
CDLY see remark 2 | 0 | 0…65535 | Carrier delay time in [ms] (CDLY <= TLS) |
Character timeout see remark 3 | 0 | 0…65535 | Character timeout in characters (must be 0 if Telegram ending selection = Character timeout) |
Telegram ending selection see remarks 3 and 4 | none | none | No telegram ending identifier |
String (check receive) | 2 characters, e.g. <CR><LF> (16#0d, 16#0a -> 16#0d0a) in parameter “Telegram ending value” | ||
Telegram length | Telegram ending identifier set by telegram length | ||
Duration | Telegram ending identifier set by time | ||
Character timeout | Telegram ending identifier set by character timeout | ||
Telegram ending character see remark 3 | 16#0d | 0…255 | Up to version V1.1.x: Telegram ending character |
0 | 0…1 | As of version V1.2.0: Number of end characters in case of telegram ending selection “String” | |
Telegram ending value see remark 3 | 0 | 0…65535 | Up to version V1.1.x: Telegram ending identifier value for settings “Duration” and “Character timeout” |
0 | 0…65535 | As of version V1.2.0: Telegram ending identifier value for settings “Duration”, “Character timeout” and “String” | |
Checksum see remark 4 | none | None | No checksum |
CRC8 | CRC8 checksum -> available as of firmware V1.2.0 |
||
CRC16 | CRC16 checksum (Motorola format) -> available as of firmware V1.2.0 |
||
LRC | Add all values to byte (ignore overflow), result multiplied by -1 -> available as of firmware V1.2.0 |
||
ADD | Add all values to byte (ignore overflow) -> available as of firmware V1.2.0 and PS501 V1.2 |
||
CS31 | CS31 bus checksum -> available as of firmware V1.2.0 and PS501 V1.2 |
||
CRC8-FBP | CRC8 FBP field bus neutral protocol -> available as of firmware V1.2.0 and PS501 V1.2 |
||
XOR | XOR all values to byte (ignore overflow) -> available as of firmware V1.2.0 and PS501 V1.2 |
||
CRC16 (Intel) | Like CRC16, result swapped -> available as of firmware V1.2.0 and PS501 V1.2 |
||
Handshake | none | None | No handshake |
RTS/CTS | Hardware handshake | ||
XON/XOFF | Not yet implemented | ||
3964R master | Not yet implemented | ||
3964R slave | Not yet implemented | ||
Baudrate | 19200 | 300 1200 4800 9600 14400 19200 38400 57600 115200 125000 187500 |
Character length in bits/s |
Parity | none | None | No parity check |
Odd | Odd parity | ||
Even | Even parity | ||
Mark | Parity bit := TRUE | ||
Space | Parity bit := FALSE | ||
Data bits | 8 | 5, 6, 7, 8 | Character length in bits/character |
Stop bits | 1 | 1, 2 | Number of stop bits |