Changes for page 01 Program execution
Last modified by Leo Wei on 2024/12/24 22:42
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -676,7 +676,7 @@ 676 676 677 677 == Subroutine == 678 678 679 -During the execution of the scan program, the executed program can be called by the CALL instruction. You can create up to 100 new subprograms.679 +During the execution of the scan program, the executed program can be called by the CALL instruction. 680 680 681 681 A subroutine is to split a certain module in the main program for the main program to call, which is conducive to the modularization of the program. Such as other high-level language functions, but this function has no parameters and no return value. 682 682 ... ... @@ -683,7 +683,7 @@ 683 683 (% style="text-align:center" %) 684 684 [[image:1652250926997-587.png||class="img-thumbnail"]] 685 685 686 - **Instructions for calling subroutines**686 +1. Instructions for calling subroutines 687 687 688 688 After a new subroutine is created, the content of the program is not executed. It is executed only when the CALL(P) instruction is used to call the subroutine in the scan, event, and interrupt programs, and the call is executed once. Three new subroutines SUB0, SUB1, SUB2 are created as shown in the figure below. In the main program MAIN, the subprogram can be called by using the CALL(P) subprogram program name. 689 689 ... ... @@ -692,87 +692,87 @@ 692 692 (% style="text-align:center" %) 693 693 [[image:1-28.png||class="img-thumbnail"]] 694 694 695 -(% class="box infomessage" %) 696 -((( 697 -**✎Note:** 695 +**~ 1.✎Note:** 698 698 699 699 1. When using the timer (OUT T), note that the output will not be reset when the subroutine is not called, and a specific subroutine register must be used. 700 700 1. It is not allowed to call recursively between subprograms, that is, call SUB1 in SUB0, and then call SUB0 in SUB1. This is not allowed. 701 701 1. The subroutine can be nested up to 32 levels. If the level exceeds 32 levels, a serious error will be reported and the Circuit program operation will be forcibly stopped. 702 702 1. Unlike the LX3V series mainframe, the subroutine in the LX5V series mainframe ends with the END instruction instead of SRET. 703 -))) 704 704 705 705 == Positioning instructions == 706 706 707 -(% class="wikigeneratedid" %) 708 -**Event** 704 + ~1. Event 709 709 710 -(% class="wikigeneratedid" %) 711 -ON event 706 + 1.ON event 712 712 713 - *If the high-speed pulse instruction is turned on during the ON event, the high-speed pulse instruction will be sent as normal. If the ON contact of the trigger event in the scan period is turned OFF during the pulse sending, select whether to continue sending the pulse or stop the pulse according to the unscanned processing flag bit.708 +If the high-speed pulse instruction is turned on during the ON event, the high-speed pulse instruction will be sent as normal. If the ON contact of the trigger event in the scan period is turned OFF during the pulse sending, select whether to continue sending the pulse or stop the pulse according to the unscanned processing flag bit. 714 714 715 715 (% class="table-bordered" %) 716 -| =(% scope="row" %)**Output shaft**|Y0|Y1|Y2|Y3|Y4|Y5|Y6|Y7717 -| =**Not scanned flag bit**|SM899|SM959|SM1019|SM1079|SM1139|SM1199|SM1259|SM1319711 +|**Output shaft**|Y0|Y1|Y2|Y3|Y4|Y5|Y6|Y7 712 +|**Not scanned flag bit**|SM899|SM959|SM1019|SM1079|SM1139|SM1199|SM1259|SM1319 718 718 719 -* When the flag bit is 0 (continue to send pulse), if the instruction is not scanned in the current scan cycle, continue to send pulses until it stops. At this time, it should be noted that if the trigger event OFF contact turns ON after the pulse is sent, the pulse will be sent again. 720 -* When the flag bit is 1 (stop sending pulses), if the trigger event ON contact turns OFF in a certain scan period, it will decelerate and stop. 714 +When the flag bit is 0 (continue to send pulse), if the instruction is not scanned in the current scan cycle, continue to send pulses until it stops. At this time, it should be noted that if the trigger event OFF contact turns ON after the pulse is sent, the pulse will be sent again. 721 721 722 - TIMEevent716 +When the flag bit is 1 (stop sending pulses), if the trigger event ON contact turns OFF in a certain scan period, it will decelerate and stop. 723 723 724 - *Ifthehigh-speedpulseinstructionisturned on in theTIME event, the high-speed pulse instruction will be sent as normal. If the instruction is not scanned in a certain scan period during the pulse transmission, select whether to continue sending the pulse or stop the pulse according to the unscanned processing flag bit.718 + 2. TIME event 725 725 720 +If the high-speed pulse instruction is turned on in the TIME event, the high-speed pulse instruction will be sent as normal. If the instruction is not scanned in a certain scan period during the pulse transmission, select whether to continue sending the pulse or stop the pulse according to the unscanned processing flag bit. 721 + 726 726 (% class="table-bordered" %) 727 -| =(% scope="row" %)**Output shaft**|Y0|Y1|Y2|Y3|Y4|Y5|Y6|Y7728 -| =**Not scanned flag bit**|SM899|SM959|SM1019|SM1079|SM1139|SM1199|SM1259|SM1319723 +|**Output shaft**|Y0|Y1|Y2|Y3|Y4|Y5|Y6|Y7 724 +|**Not scanned flag bit**|SM899|SM959|SM1019|SM1079|SM1139|SM1199|SM1259|SM1319 729 729 730 -* When the flag bit is 0 (continue to send pulse), if the instruction is not scanned in the current scan cycle, the pulse will continue to be sent until it stops. In the TIME event, it is impossible to ensure that the instruction is scanned in every scan cycle, so you should avoid using high-speed pulse instructions in the TIME time, otherwise the pulse will be sent again after the pulse is sent. 731 -* When the flag bit is 1 (stop sending pulses), if the instruction is not scanned in the current scan cycle, it will decelerate and stop. In the TIME event, if the flag bit is set to 1 (stop sending pulses), there will be no pulse sending. 726 +When the flag bit is 0 (continue to send pulse), if the instruction is not scanned in the current scan cycle, the pulse will continue to be sent until it stops. In the TIME event, it is impossible to ensure that the instruction is scanned in every scan cycle, so you should avoid using high-speed pulse instructions in the TIME time, otherwise the pulse will be sent again after the pulse is sent. 732 732 733 - **Subroutine**728 +When the flag bit is 1 (stop sending pulses), if the instruction is not scanned in the current scan cycle, it will decelerate and stop. In the TIME event, if the flag bit is set to 1 (stop sending pulses), there will be no pulse sending. 734 734 730 + 2. Subroutine 731 + 735 735 If the high-speed pulse instruction is turned on in the subroutine, the high-speed pulse instruction will be sent as normal. If the scanning period is closed during pulse sending, select whether to continue sending or stop the pulse according to the unscanned processing flag. 736 736 737 737 (% class="table-bordered" %) 738 -| =(% scope="row" %)**Output shaft**|Y0|Y1|Y2|Y3|Y4|Y5|Y6|Y7739 -| =**Not scanned flag bit**|SM899|SM959|SM1019|SM1079|SM1139|SM1199|SM1259|SM1319735 +|**Output shaft**|Y0|Y1|Y2|Y3|Y4|Y5|Y6|Y7 736 +|**Not scanned flag bit**|SM899|SM959|SM1019|SM1079|SM1139|SM1199|SM1259|SM1319 740 740 741 741 When the flag bit is 0 (continue to send pulse), if the instruction is not scanned in the current scan cycle, the pulse will continue to be sent until it stops. At this time, it should be noted that if the subroutine is called again after the pulse is sent, the pulse will be sent again. 742 742 743 743 When the flag bit is 1 (stop sending pulses), if the subroutine is closed during high-speed pulse sending, the speed will decelerate and stop. If the subroutine is closed before sending the pulse, then no pulse is sent. 744 744 745 - **Interrupt**742 + 3. Interrupt 746 746 747 -External interrupt 744 +1. External interrupt 748 748 749 - *If the high-speed pulse instruction is enabled in the external interrupt, the high-speed pulse instruction selects whether the pulse continues to be sent or the pulse stops according to the unscanned processing flag bit.746 +If the high-speed pulse instruction is enabled in the external interrupt, the high-speed pulse instruction selects whether the pulse continues to be sent or the pulse stops according to the unscanned processing flag bit. 750 750 751 751 (% class="table-bordered" %) 752 -| =(% scope="row" %)**Output shaft**|Y0|Y1|Y2|Y3|Y4|Y5|Y6|Y7753 -| =**Not scanned flag bit**|SM899|SM959|SM1019|SM1079|SM1139|SM1199|SM1259|SM1319749 +|**Output shaft**|Y0|Y1|Y2|Y3|Y4|Y5|Y6|Y7 750 +|**Not scanned flag bit**|SM899|SM959|SM1019|SM1079|SM1139|SM1199|SM1259|SM1319 754 754 755 -* When the flag bit is 0 (continue to send pulse), continue to send high-speed pulses until it stops. 756 -* When the flag bit is 1 (stop sending pulse), the high-speed pulse decelerates and stops. 752 +When the flag bit is 0 (continue to send pulse), continue to send high-speed pulses until it stops. 757 757 758 - Timerinterrupt754 +When the flag bit is 1 (stop sending pulse), the high-speed pulse decelerates and stops. 759 759 760 - *Ifthehigh-speedpulseinstructionisturnedonin the timer interruption, the high-speed pulse instruction is sent as normal. If the instruction is not scanned in a certain scan period in the pulse transmission, the pulse continues to be sent or the pulse stops is selected according to the unscanned processing flag.756 + 2. Timer interrupt 761 761 758 +If the high-speed pulse instruction is turned on in the timer interruption, the high-speed pulse instruction is sent as normal. If the instruction is not scanned in a certain scan period in the pulse transmission, the pulse continues to be sent or the pulse stops is selected according to the unscanned processing flag. 759 + 762 762 (% class="table-bordered" %) 763 -| =(% scope="row" %)**Output axis**|Y0|Y1|Y2|Y3|Y4|Y5|Y6|Y7764 -| =**Not scanned flag bit**|SM899|SM959|SM1019|SM1079|SM1139|SM1199|SM1259|SM1319761 +|**Output axis**|Y0|Y1|Y2|Y3|Y4|Y5|Y6|Y7 762 +|**Not scanned flag bit**|SM899|SM959|SM1019|SM1079|SM1139|SM1199|SM1259|SM1319 765 765 766 -* When the flag bit is 0 (continue to send pulse), if the instruction is not scanned in the current scan cycle, continue to send pulses until it stops. In the timer interrupt, it is impossible to ensure that the instruction is scanned in every scan cycle, so it is necessary to avoid using high-speed pulse instructions in the T timer interrupt. Otherwise, after the pulse transmission is completed, the pulse will be sent again. 767 -* When the flag bit is 1 (stop sending pulses), if the instruction is not scanned in the current scan cycle, it will decelerate and stop. In the TIME event, if the flag bit is set to 1 (stop sending pulses), there will be no pulse sending. 764 +When the flag bit is 0 (continue to send pulse), if the instruction is not scanned in the current scan cycle, continue to send pulses until it stops. In the timer interrupt, it is impossible to ensure that the instruction is scanned in every scan cycle, so it is necessary to avoid using high-speed pulse instructions in the T timer interrupt. Otherwise, after the pulse transmission is completed, the pulse will be sent again. 768 768 769 - High-speedcomparison interrupt766 +When the flag bit is 1 (stop sending pulses), if the instruction is not scanned in the current scan cycle, it will decelerate and stop. In the TIME event, if the flag bit is set to 1 (stop sending pulses), there will be no pulse sending. 770 770 771 - *Ifthehigh-speedpulseinstructionisenabledin the high-speed comparison interrupt, the high-speed pulse instruction selects whether the pulse continues to be sent or the pulse stops according to the unscanned processing flag.768 + 3.High-speed comparison interrupt 772 772 770 +If the high-speed pulse instruction is enabled in the high-speed comparison interrupt, the high-speed pulse instruction selects whether the pulse continues to be sent or the pulse stops according to the unscanned processing flag. 771 + 773 773 (% class="table-bordered" %) 774 -| =(% scope="row" %)**Output axis**|Y0|Y1|Y2|Y3|Y4|Y5|Y6|Y7775 -| =**Not scanned flag bit**|SM899|SM959|SM1019|SM1079|SM1139|SM1199|SM1259|SM1319773 +|**Output axis**|Y0|Y1|Y2|Y3|Y4|Y5|Y6|Y7 774 +|**Not scanned flag bit**|SM899|SM959|SM1019|SM1079|SM1139|SM1199|SM1259|SM1319 776 776 777 -* When the flag bit is 0 (continue to send pulse), continue to send high-speed pulses until it stops. 778 -* When the flag bit is 1 (stop sending pulse), the high-speed pulse decelerates and stops. 776 +When the flag bit is 0 (continue to send pulse), continue to send high-speed pulses until it stops. 777 + 778 +When the flag bit is 1 (stop sending pulse), the high-speed pulse decelerates and stops.