omron — A2W_Pushbutton_Brochure_EN_201805_A47IE01

 Using Visual Basic (Where CJ is the Connected Device) When CJ is used as the connected PLC, as is the case with NJ, you can use Visual Basic to switch screens from PLC. 1. Declare on the CJ side a Numerical-type variable to store page numbers. 2. Allocate on the NA side the variables declared in Step 1. Then, declare respectively the String-type variable to store page names and the variable to store page numbers on the NA side. “Page_Name”: Variable to indicate page names “Page_No”: Variable to indicate page numbers on the NA side 3. In the global subroutine, write the code as shown on the right. “PageNameSelect”: switches the NA’s page based on the CJ’s variable value. “PageNumberSelect”:

reports to the PLC the number corresponding to the currently displayed page. In either case, to add pages to switch to, increase the conditions of Case. 4. In the [Global Events] tab page, specify the conditions to execute the code created in Step 3 as described below: 1. Indicate the state that the CJ’s page number does not equal to the NA’s page number. 2. Specify the name of the subroutine to execute. 3. Indicate that the action is taken when the page is switched. 4. Specify the name of the subroutine to execute. 1. 2. 3. 4. 45