UART parameter
This parameter is intended for use in the UART port block of the controller used in the project.
The parameter has the following settings.
"Exclusive use"
When installing this checkbox, only those UART ports that are not used in any other blocks are provided for selection.
Also, after selecting a port, this port becomes unavailable for other project blocks.
If this check box is unchecked, free ports and ports that are used by other blocks without exclusive use (for example, sending and receiving blocks from UART) will be available for selection. The selected port will also be available to these blocks.
If this check box is unchecked, free ports and ports that are used by other blocks without exclusive use (for example, sending and receiving blocks from UART) will be available for selection. The selected port will also be available to these blocks.
"Port initialization (library connection, instance creation, setup)"
При выборе режима "Project responsibility" creation initialization, and port configuration will be done by the project compiler, and there is no need to write the appropriate code in the block.
When selecting the "user block Responsibility" mode, all these actions must be specified in the block.
When configuring a block in a project, this parameter provides a standard interface for selecting and configuring the UART port.
When configuring a block in a project, this parameter provides a standard interface for selecting and configuring the UART port.
Three tags are generated for this parameter.
All three tags are available in the code, and the first two are available for conditions.
Example of using the "UART" parameter"
Let's create an abstract block that outputs the string received via the selected UART to the screen.
First, let's create a parameter.
First, let's create a parameter.
In the Loop section, the code of each instance, in the section where the block is inserted, the code element in which we will use this parameter.
As a result of compiling the project with the selected port Serial0, we get the following code.
if (Serial.available())
{
_tempVariable_byte =Serial.read();
readingString_70191879 += char(_tempVariable_byte);
}
In the following code elements, the readingstring_70191879 variable will be used for display
if (Serial.available())
{
_tempVariable_byte =Serial.read();
readingString_70191879 += char(_tempVariable_byte);
}
In the following code elements, the readingstring_70191879 variable will be used for display