User Manual
PLUS+1® GUIDE Software
PLUS+1® Function Block Library—UART
www.danfoss.com
User Manual
PLUS+1® Function Block Library—UART
Revision history |
Table of revisions |
|
|
|
|
|
|
|
Date |
Changed |
Rev |
|
|
|
|
|
October 2020 |
First edition |
0101 |
|
|
|
|
2 | © Danfoss | October 2020 |
AQ339983296573en-000101 |
User Manual |
|
PLUS+1® Function Block Library—UART |
|
Contents |
|
Library Introduction |
|
Before You Begin |
|
Limitations.......................................................................................................................................................................................... |
5 |
Setting up UART for Transmission and Reception................................................................................................................ |
6 |
Set up Transmission................................................................................................................................................................... |
6 |
Set up Reception......................................................................................................................................................................... |
8 |
Setting up UART with Heartbeat Messages............................................................................................................................ |
9 |
Heartbeat Transmission......................................................................................................................................................... |
10 |
Heartbeat Reception............................................................................................................................................................... |
10 |
UART_Rx_Buffer |
|
Inputs.................................................................................................................................................................................................. |
12 |
Outputs.............................................................................................................................................................................................. |
12 |
IEC 61508-3 Annex D Supplemental Information.............................................................................................................. |
13 |
UART_Rx_Hrtbeat |
|
Outputs.............................................................................................................................................................................................. |
14 |
IEC 61508-3 Annex D Supplemental Information.............................................................................................................. |
15 |
UART_Rx_Msg |
|
Inputs.................................................................................................................................................................................................. |
17 |
Outputs.............................................................................................................................................................................................. |
17 |
IEC 61508-3 Annex D Supplemental Information.............................................................................................................. |
18 |
UART_Tx_Buffer |
|
Inputs.................................................................................................................................................................................................. |
19 |
Outputs.............................................................................................................................................................................................. |
19 |
IEC 61508-3 Annex D Supplemental Information.............................................................................................................. |
20 |
UART_Tx_Hrtbeat |
|
Outputs.............................................................................................................................................................................................. |
21 |
IEC 61508-3 Annex D Supplemental Information.............................................................................................................. |
22 |
UART_Tx_Msg |
|
Inputs ................................................................................................................................................................................................. |
23 |
Outputs.............................................................................................................................................................................................. |
23 |
IEC 61508-3 Annex D Supplemental Information.............................................................................................................. |
24 |
© Danfoss | October 2020 |
AQ339983296573en-000101 | 3 |
User Manual
PLUS+1® Function Block Library—UART
The UART function blocks in this library help enable communication over a universal asynchronous receiver-transmitter.
The UART library contains function blocks which ensure the exact information sent is the exact information received.
4 | © Danfoss | October 2020 |
AQ339983296573en-000101 |
User Manual
PLUS+1® Function Block Library—UART
Before you use the library, note the following:
•SC0XX-1XX devices are supported for use with the library.
•SC0XX-0XX devices are not supported for use with the library.
•MCXXX-0XX, MCXXX-1XX and Display devices are not supported by the library.
•Minimum required SC0XX-1XX HWD version is v210.
•Make dependency files available, as follows:
1.After you add the first UART function block to the application, click Yes in the dialog box that appears.
2.In the project manager, right click on UART_Include.h and select Make available to PLC C code
POUs.
Before using the function blocks in this library, note the following limitations of some blocks.
A UART_Tx_Msg block can only transmit every other loop. If a piece of data needs to be sent every loop, ensure it uses two blocks with two different IDs with alternating transmission.
The UART_Tx_Buffer block can send up to four messages per loop. Any additional messages stored in the buffer are sent in the following loop following a First In, First Out queue. The buffer can hold 18 messages from the UART_Tx_Msg block.
© Danfoss | October 2020 |
AQ339983296573en-000101 | 5 |
User Manual
PLUS+1® Function Block Library—UART
Before You Begin
Set up UART so an application can transmit messages and an application can receive messages.
To set up an application to transmit messages, complete the tasks that follow.
1.From the Library, drag in the UART_Tx_Buffer block. Place this function near the end of the application.
2.Connect the UART_In bus to the UART_App bus from the Inputs bus of the controller template. Then, connect the UART_Out bus to the UART_App_Outputs bus from the Outputs bus of the controller template.
6 | © Danfoss | October 2020 |
AQ339983296573en-000101 |
User Manual
PLUS+1® Function Block Library—UART
Before You Begin
3.Navigate to the UART page in the outputs section of the controller template, “!TOP!Outputs!UART.” Remove the logic from the following signals for proper compilation: TxMsg_Len, TxMsg_Tx, and TxMsg_Data.
•Make the changes shown in the following figure. If you are using the UART_Rx_Buffer block, also remove the signal mentioned in the next section.
4.Add a UART_Tx_Msg block. This block is used to send 8 bytes of data over UART. The messages are added to a queue that is processed by the UART_Tx_Buffer.
5.Connect inputs to the block, as shown in the following example.
•ID: 25. Values from 0 to 120 are allowed.
•Data: Safety Layer Failure signal in the lower four bytes, zero in the upper four bytes.
•Send: Sent every 100 ms via oscillator.
© Danfoss | October 2020 |
AQ339983296573en-000101 | 7 |
User Manual
PLUS+1® Function Block Library—UART
Before You Begin
In the example, the message is then sent every 100 ms. To set up the other application to receive the message, see Set up Reception.
To set up an application to receive messages, complete the tasks that follow.
1.From the Library, drag in the UART_Rx_Buffer block. Place this function near the front of the application.
2.Connect the UART_In bus to the UART_App bus from the Inputs bus of the controller template. Then, connect the UART_Out bus to the UART_App_Outputs bus from the Outputs bus of the controller template.
8 | © Danfoss | October 2020 |
AQ339983296573en-000101 |