Section 7. Installation
A similar concern is the reuse of the same variable in multiple tasks. Without
some sort of messaging between the two tasks placed into the CRBasic program,
unpredictable results are likely to occur. The
SemaphoreGet()
and
SemaphoreRelease()
instruction pair provide a tool to prevent unwanted access
of an object (variable, COM port, etc.) by another task while the object is in use.
Consult
CRBasic Editor Help
for information on using
SemaphoreGet()
and
SemaphoreRelease()
.
7.8.4.12 Execution Timing
Timing of program execution is regulated by timing instructions listed in the
following table.
Table 19.
Program Timing Instructions
Instructions
General Guidelines
Syntax Form
Scan()
/
NextScan
Use in most programs. Begins
/ ends the main scan.
BeginProg
Scan()
'.
'.
'.
NextScan
EndProg
SlowSequence
/
EndSequence
Use when measurements or
processing must run at slower
frequencies than that of the
main program.
BeginProg
Scan()
'.
'.
'.
NextScan
SlowSequence
Scan()
'.
'.
'.
NextScan
EndSequence
EndProg
SubScan
/
NextSubScan
Use when measurements or
processing must run at faster
frequencies than that of the
main program.
BeginProg
Scan()
'.
'.
'.
SubScan()
'.
'.
'.
NextSubScan
NextScan
EndProg
7.8.4.12.1 Scan() / NextScan
Simple CR1000 programs are often built entirely within a single
Scan()
/
NextScan
structure, with only variable and data-table declarations outside the
scan.
Scan()
/
NextScan
creates an infinite loop; each periodic pass through the
loop is synchronized to the CR1000 clock.
Scan()
parameters allow modification
154
Summary of Contents for CR1000
Page 2: ......
Page 4: ......
Page 6: ......
Page 32: ......
Page 36: ......
Page 38: ......
Page 40: ......
Page 60: ...Section 4 System Quickstart Figure 16 PC200W View Line Graph 60 ...
Page 96: ......
Page 98: ...98 ...
Page 302: ......
Page 453: ...Section 8 Operation Figure 115 Using the Keyboard Display 453 ...
Page 456: ...Section 8 Operation Figure 118 Real Time Custom 456 ...
Page 457: ...Section 8 Operation 8 8 1 3 Final Memory Tables Figure 119 Final Memory Tables 457 ...
Page 458: ...Section 8 Operation 8 8 2 Run Stop Program Figure 120 Run Stop Program 458 ...
Page 460: ...Section 8 Operation Figure 122 File Edit 460 ...
Page 461: ...Section 8 Operation 8 8 4 PCCard Memory Card Display Figure 123 PCCard CF Card Display 461 ...
Page 478: ......
Page 506: ......
Page 536: ......
Page 636: ......
Page 642: ......
Page 644: ......
Page 676: ......
Page 677: ......