![](/images/new-backgrounds/1256769/256769389x1.webp)
20 Custom Macro
Data output at PRNT=1:
7 6 5 4 3 2 1 0
1 1 0 1 1 0 0 0 | |
0 0 1 1 0 0 1 1 | |
0 0 1 1 0 1 0 1 | |
0 0 1 0 1 1 1 0 | |
1 0 1 1 1 0 0 0 | |
0 0 1 1 1 0 0 1 | |
1 0 1 1 0 1 1 1 | |
0 1 0 1 1 0 0 1 | |
0 0 1 0 1 1 0 1 | |
1 0 1 1 0 0 0 1 | |
0 0 1 1 0 1 0 1 | |
0 0 1 1 0 0 0 0 | |
0 0 1 0 1 1 1 0 | |
1 0 1 1 1 0 0 0 | |
0 0 1 1 0 0 0 0 | |
0 0 1 1 0 0 0 0 | |
1 1 0 1 0 1 0 0 | |
1 0 1 1 0 0 0 1 | |
0 0 1 1 0 1 0 1 | |
0 0 0 0 1 0 1 0 |
Closing a peripheral - PCLOSn
The peripheral opened with command POPEN has to be closed with command PCLOS. Command PCLOS has to be followed by the specification of the number of peripheral to be closed. At the time of closing, a % character is also sent to the peripheral, i.e., each data output is terminated by a % character.
LNotes:
–The sequence of data output commands is a fixed one. First the appropriate peripheral has to be opened with command POPEN, followed by the process of data outputting (with command BPRNT or DPRINT); finally, the open peripheral has to be closed with instruction PCLOS.
–The opening and closing of a peripheral can be specified in any point of the program. For example, it can be opened and closed at the beginning and end of the program, respectively, data can be output in any part of the program in between.
–A command M30 or M2 executed during the process of data output will interrupt the data transfer. To avoid this, waiting is to be performed during data transfer before the execution of command M30.
–The parameters (baud rate, number of stop bits etc.) of the peripheral have to be set correctly. They can be selected in group SERIAL of the field of parameters.
20.14 NC and Macro Instructions
NC and macro blocks can be differentiated in the programming language. The blocks written in terms of conventional codes G, M etc. are regarded as NC blocks even when the values of the addresses assume variables or formulae as well as numerical values.
The following blocks are regarded as macro instructions:
– the block containing a definition, substitution instruction (#i=#j)
195