EasyManuals Logo
Home>Omron>Controller>NJ Series

Omron NJ Series User Manual

Omron NJ Series
668 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #162 background imageLoading...
Page #162 background image
5-35
5 Designing Tasks
NJ-series CPU Unit Software User’s Manual (W501)
5-2 Task System
5
5-2-13 Ensuring Concurrency of Variable Values between Tasks
If more than one task reads or writes the same global variable, you can use either of the following
two methods to ensure the concurrency of the value of the global variable between the tasks.
Method 1: Write the global variable from only one task and read the variable from the other tasks.
Use the settings for exclusive control of variables in tasks.
Method 2: With this method, you can write the global variable from more than one task. Use the task
exclusive control instructions.
Introduction
You can specify the task that refreshes a global variable and the tasks that access the global vari-
able. This ensures the concurrency of the value of the global variable from the point of view of the
tasks that access the variable.
A single task is set to read and write the value of a specified global variable. That task is called the
refreshing task. Tasks that only read the value of the global variable are also specified. These tasks
are called accessing tasks. This ensures the concurrency of the value of the global variable.
Application Example
The refreshing task specification is used to ensure the concurrency of the value of a global variable
within a periodic task when the variable is written in the primary periodic task.
5-2-13 Ensuring Concurrency of Variable Values between Tasks
Method 1: Settings for Exclusive Control of Variables in Tasks
Read/write
Accessing
task: Task B
Accessing
task: Task C
Read only
Read only
Refreshing task: Task A
Refreshing task is specified.
Global variable
Refreshing
task: Task A
Read/write
The most recent value of the
variable at the end of refreshing
task execution is read at the start
of accessing task execution.
External variable GVar1
Program
Accessing task
Read only
Global variable GVar1
External variable GVar1
Program
Refreshing task

Table of Contents

Other manuals for Omron NJ Series

Questions and Answers:

Question and Answer IconNeed help?

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

Omron NJ Series Specifications

General IconGeneral
BrandOmron
ModelNJ Series
CategoryController
LanguageEnglish

Related product manuals