Omron NA Series Practices Manual

Omron NA Series Practices Manual

Programmable terminal subroutine functions
Hide thumbs Also See for NA Series:

Advertisement

Quick Links

Programmable Terminal NA - series
Practice Guide
Subroutine Functions
NA5-15□101□
NA5-12□101□
NA5-9□001□
NA5-7□001□
V449-E1-01

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the NA Series and is the answer not in the manual?

Questions and answers

Summary of Contents for Omron NA Series

  • Page 1 Programmable Terminal NA - series Practice Guide Subroutine Functions NA5-15□101□ NA5-12□101□ NA5-9□001□ NA5-7□001□ V449-E1-01...
  • Page 2 (3) Copyrights and Trademarks - Sysmac and SYSMAC are trademarks or registered trademarks of OMRON Corporation in Japan and other countries for OMRON factory automation products. - Windows, Visual Basic and Excel are the trademarks or registered trademarks of Microsoft Corporation in the USA, Japan and other countries.
  • Page 3: Terms And Conditions Agreements

    - Rating and performance is tested separately. Combined conditions are not warranted. - Reference data is intended to be used just for reference. Omron does NOT guarantee that the Omron Product can work properly in the range of reference data.
  • Page 4: Warranty

    - Omron products are designed and manufactured as commodity for general industrial products. For this reason, the usages (a) to (d) are to be unintended. Omron makes no guarantees on Omron products, if you use Omron products for those purposes.
  • Page 5 The warranty described in this Terms and Conditions Agreements is a whole and sole liability for Omron products. There are no other warranties, expressed or implied. Omron and its distributors are not liable for any damages arisen from or relating to Omron products.  Export Controls...
  • Page 6: Table Of Contents

    Contents Terms and Conditions Agreements ..............3 Contents ........................6 1 Related Manuals..................... 8 2 Overview ......................9 2-1 What Is Subroutine? ....................9 2-2 Subroutine Language Specification................9 2-3 Operation Overview ....................10 3 Event and Action..................11 3-1 What Are Event and Action? ..................
  • Page 7 Revision History ....................35...
  • Page 8: Related Manuals

    1 Related Manuals The following manuals are related to this manual. Cat.No. Model Manual’s Title W504 SYSMAC-SE2□□□ Sysmac Studio Version 1 Operation Manual NA5-15W□□□□ NA5-12W□□□□ V117 Programmable Terminal User’s Manual (Hardware) NA5-9W□□□□ NA5-7W□□□□ NA5-15W□□□□ NA5-12W□□□□ V118 Programmable Terminal User’s Manual (Software) NA5-9W□□□□...
  • Page 9: Overview

    2-2 Subroutine Language Specification NA series subroutine is described in VisualBasic. You can use commands written in Visual Basic in NA series subroutine. However, not all the VisualBasic functions and commands used on Windows PC cannot be used. Operations of VisualBasic commands are limited on NA series.
  • Page 10: Operation Overview

    Logical formula, calculation Subroutine Additional Information Refer to page 31, “Supplementary Note” for details.Commands for NA series consist of operators/functions described in Subroutine Reference Manual, NA-only functions and NA-only objects. Select Help (H) - Instruction Word (I) under SysmacStudio Menu Bar. Then you can...
  • Page 11: Event And Action

    Various controls are possible if you set basic operations and subroutines to an Action and register that Action with a detected Event. 3-2 Types of Event The actions with what subroutines can be registered on NA series are to be registered with the following five types of event. Type...
  • Page 12 3-2-1 Events Settable to Global /Page Event Global Page Event Description event event ○ ○ Condition Occurs when the set condition is met. *1 *3 ○ ○ Click F1 key Occurs when F1 key is released. ○ ○ Touch F1 key Occurs when F1 key is pressed.
  • Page 13 Components and assignable events Component Click Touch Release Checked Unchecked Change Select ○ ○ ○ Button Momentary Button ○ ○ ○ ○ ○ ○ Reset Button Set Button ○ ○ ○ ○ ○ ○ Toggle Button ○ ○ Ellipse ○ ○...
  • Page 14 3-2-3 Events Assignable to User Alarm Event Event Description Acknowledged Occurs when a user alarm is checked. Cleared Occurs when a user alarm is cancelled. Raised Occurs when a user alarm is issued. 3-2-4 Events Assignable to IAG Object Event Event Description Occurred according to an event generation condition of an IAG...
  • Page 15: Configuration For Action

    3-3 Configuration for Action Prepared action items for basic operation (e.g. screen switching) make NA control easier. Standard actions for events include subroutines with NA series. Select Subroutine in Action Settings, and enter the name of the subroutine to variable. Then you can execute the subroutine that is assigned as an action for each event.
  • Page 16: Subroutine

    4 Subroutine 4-1 Types of Subroutine Three types of subroutines are used with NA series. Type Description Trigger Operation condition Global Common subroutine in a whole project. Global event All time subroutine It is created under a global subroutine of HMI Page event project.
  • Page 17: Call Out A Subroutine

    4-2 Call Out a Subroutine In NA series, you can execute an Event that contains a subroutine by setting a subroutine name as a parameter. The subroutine should be set to the Event’s Action. ■NA editor Global subroutine Global event...
  • Page 18: Operation

    4-3 Operation Regardless of the type of subroutine, every subroutine is executed as a synchronous operation after an event is driven. All other processings stop until the subroutine process ends. A global subroutine has configuration for variable asynchronous operation of an event. The subroutine processing which is set on the event’s action with this configuration is implemented as asynchronous operation.
  • Page 19: Location To Describe

    4-4 Location to Describe Basic functions for locations where to describe subroutines are explained in this section. 4-4-1 Code Explorer Code Explorer is useful to display and edit code that used in a project. Code Explorer is displayed at the left side of the same window of Multiview Explorer or Page Explorer.
  • Page 20 4-4-2 Global Subroutine Select the subroutine group name under Global Subroutines in Multiview Explorer. Right-click it and a sub menu appears. Click Edit, then the code of the subroutine group is displayed. Global subroutines are written in this screen. You can add a group name for global subroutine. Select Global Subroutines in Multiview Explorer and right-click it.
  • Page 21 〇 Change subroutine’s group name Choose the subroutine group in Global Subroutines/Multiview explorer. Right-click it, then the submenu appears. Click Change Name to change the name of the subroutine group. [Example] Change “SubroutineGroup1” to “SubroutineGroup_A” 〇 Copy a global subroutine group Choose the subroutine group in Global Subroutines/Multiview Explorer.
  • Page 22 4-4-3 Page Subroutine Choose the page name in HMI/Multiview Explorer. Right-click it, then the submenu appears. Select View Code Editor to display the code of the page. The code is also shown clicking icon in Page Editor screen. Page subroutines are described in the screen below. 4-4-4 Code View of IAG Component Creation Screen Select the IAG component and right-click to display submenu.
  • Page 23: Assistance Function

    4-5 Assistance Function 4-5-1 Color Code A code screen where subroutines are described has Color code to support users to write syntaxes. The followings are examples of Color code. Blue Reserved word for VB system. E.g. Sub, Dim, Call : Variable which registered in Global variable list Green : Comment line.
  • Page 24 4-5-2 IntelliSense When you enter an object name or a library command name to edit code, the code editor automatically shows a list of candidate. This function is called IntelliSense. Using IntelliSense, you can check a variable’s spelling or objects and methods to be used. If a context of VB program is right, IntelliSense is automatically popped-up.
  • Page 25: Subroutine Creating Procedure

    5 Subroutine Creating Procedure 5-1 NA Project The following is a procedure to set subroutines on events and actions on the component placed on the screen. Put a button and a data display component on a Page screen. Enter a variable which is to be assigned to the data display component in Global Variables table.
  • Page 26 Open the code editor of the current screen to write the code. Execute the build to test. Startup a simulator to check operation. Confirm if the data display component shows the result of subroutine after pressing the onscreen button. Additional Information - A subroutine is executed only once and ends after it is called out.
  • Page 27: Iag Project

    5-2 IAG Project Subroutines in IAG projects are described basically in the same way as those in NA projects. The following is a procedure to assign subroutines to events and actions of onscreen components. Place a button and a data display component on a screen of IAG component.
  • Page 28 Open the code editor of the current screen to write the code. Execute the build to test. Startup a simulator to check operation. Confirm if the data display component shows the result of subroutine after pressing the onscreen button. Additional Information - A subroutine is executed only once and ends after it is called out.
  • Page 29: Supplementary Note

    Supplementary Note 1. Action Table The following table shows the Actions (incl. subroutines) settable to Events. Event Action Description User Global Page Object alarm Stop-Buzzer Turn off a buzzer. ○ ○ ○ ○ ○ Start-Buzzer Turn on a buzzer. ○ ○...
  • Page 30 User Action Description Global Page Object alarm Seting-IME type Change IME language setting. ○ ○ ○ ○ ○ Setting- Input focus Set a focus to enter data. ○ ○ Setting-User Change project’s language ○ ○ ○ ○ language setting. Substitution-Variable Assign an intended variable to an ○...
  • Page 31: Data Type Table

    2. Data Type Table Both Global variables (NA) and Local variables (declared in a subroutine) are referenced. The local variables declared in a subroutine cannot be assigned to onscreen components or conditional expressions. Type Description/Value range Boolean True(other than 0) or False(0) 16-bit signed integer Short -32,768 to 32,767 (signed)
  • Page 32: Function

    3. Function You can write Functions in a program code that can be described with NA’s code editor, in addition to Subroutines. Functions are not to be registered in Action Settings as Subroutine, but can be called from a subroutine. Item Allocation to Action Configuration Call from subroutine...
  • Page 33 3-1. Function Creating Procedure The following is the function describing procedure of NA project to call from a subroutine and use. Place buttons and data display components on the NA page screen as the right illustration shows. Enter a variable which is allocated to the data display component in Global Variables table.
  • Page 34 Open Code Editor of the current screen or Global Subroutine Group and enter the code in the right illustration. [Description] Declare Local_Data, an array variable, in the subroutine Data_Calc. Substitute different values into each variable. The following process is executed repeatedly: Execute the function Add_Data for the global variable Disp_Val.
  • Page 35: Revision History

    Revision History Revision code Date Revised content October 2018 Original production...
  • Page 36 2018 V449-E1-01 1018 (1018)

Table of Contents