Difference between revisions of "MC-Basic:WITHGLOBAL"
m |
m |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | {{Languages}} | + | {{Languages|MC-Basic:WITHGLOBAL}} |
{{MC-Basic | {{MC-Basic | ||
|SHORT FORM= | |SHORT FORM= | ||
Line 7: | Line 7: | ||
|AVAILABILITY= | |AVAILABILITY= | ||
− | 4. | + | 4.17.6 |
|DESCRIPTION= | |DESCRIPTION= | ||
− | This command sets a | + | This command sets a Default Motion Element (axis or group) that replace previous [[MC-Basic:WITH|WITH]] statement, sets on the CONFIG.PRG file, or didn't exist at all. <br> |
+ | Like the "WITH" statement, the motion element will operated without having to explicitly indicate the motion element name. <br/> | ||
+ | |||
+ | |||
+ | The default motion element exists only after a '''WithGlobal''' statement, which can be terminated in three ways: <br> | ||
+ | * New '''WithGlobal''' statement, declared in every scope. | ||
+ | * "reset all" command applied within the Terminal. | ||
+ | * [[MC-Basic:WITH|Local With]] that valid only as the local task runs. | ||
+ | |||
+ | |||
+ | {{Note|Unlike using local/Terminal [[MC-Basic:WITH|WITH]] statement - which require ''With..... → End With'' methods, when using the "WithGlobal" statement, there's '''NO''' need to declare "End WithGlobal".}} | ||
|TYPE= | |TYPE= | ||
Line 27: | Line 37: | ||
Configuration, Task or Terminal | Configuration, Task or Terminal | ||
− | * In the | + | * In the Terminal scope, the specified motion element becomes the default motion element for the system, that replace ALL previous WITH - CONFIG<big>/</big>WITHGLOBAL statement, from all scopes. |
− | * | + | * The way to "kill" a WithGlobal statement that was declared, is to use reset all command, and change the Config.prg file as you wish – or to issue another WithGlobal command..<br> |
− | |||
− | + | |LIMITATIONS= | |
− | + | * ''WithGlobal'' commands can't be nested, As there is no''End WinthGlobal'' statement. | |
− | |||
− | * ''WithGlobal'' commands can't be nested | ||
− | |||
− | |||
|EXAMPLE= | |EXAMPLE= | ||
− | <syntaxhighlight lang=" | + | |
+ | <syntaxhighlight lang="vb" line='line'> | ||
+ | |||
A1.VMax=5000 | A1.VMax=5000 | ||
Line 80: | Line 87: | ||
Move 100 | Move 100 | ||
− | Withglobal A2 | + | Withglobal A2 'replace the previous "WithGlobal" statement |
VMax=5000 | VMax=5000 | ||
Vord=5000 | Vord=5000 |
Latest revision as of 11:46, 17 August 2017
Language: | English • 中文(简体) |
---|
This command sets a Default Motion Element (axis or group) that replace previous WITH statement, sets on the CONFIG.PRG file, or didn't exist at all.
Like the "WITH" statement, the motion element will operated without having to explicitly indicate the motion element name.
The default motion element exists only after a WithGlobal statement, which can be terminated in three ways:
- New WithGlobal statement, declared in every scope.
- "reset all" command applied within the Terminal.
- Local With that valid only as the local task runs.
NOTE | |
Unlike using local/Terminal WITH statement - which require With..... → End With methods, when using the "WithGlobal" statement, there's NO need to declare "End WithGlobal". |
Syntax
WithGlobal <element name>
Availability
4.17.6
Scope
Configuration, Task or Terminal
- In the Terminal scope, the specified motion element becomes the default motion element for the system, that replace ALL previous WITH - CONFIG/WITHGLOBAL statement, from all scopes.
- The way to "kill" a WithGlobal statement that was declared, is to use reset all command, and change the Config.prg file as you wish – or to issue another WithGlobal command..
Limitations
- WithGlobal commands can't be nested, As there is noEnd WinthGlobal statement.
Examples
1 A1.VMax=5000
2
3 A1.Vord=5000
4
5 A1.VCruise=3000
6
7 A1.PEMax=10
8
9 A1.PESettle=0.01
10
11 Move A1 100
12
13 A2.VMax=5000
14
15 A2.Vord=5000
16
17 A2.VCruise=3000
18
19 A2.PEMax=10
20
21 A2.PESettle=0.01
22
23 Move A2 100
Can be simplified using:
1 WithGlobal A1
2 VMax=5000
3 Vord=5000
4 VCruise=3000
5 PEMax=10
6 PESettle=0.01
7 Move 100
8
9 Withglobal A2 'replace the previous "WithGlobal" statement
10 VMax=5000
11 Vord=5000
12 VCruise=3000
13 PEMax=10
14 PESettle=0.01
15 Move 100