Difference between revisions of "MC-Basic Constants"

From SoftMC-Wiki
Jump to: navigation, search
(Created)
 
(Undo revision 133881 by Hallel (talk))
 
(18 intermediate revisions by 4 users not shown)
Line 1: Line 1:
A number of keywords have been defined in the system to facilitate operation.  
+
 
These keywords, or constants, may be used in place of explicit numeric values in instances where a parameter has a discrete range of allowed values.  
+
Constants are numbers, which are written as ordinary text characters; for example, 161. Constants can be written in decimal or in hexadecimal (HEX). To write a constant in hex, precede it by a 0x; for example, 0xF is the hex representation of 15 decimal.
 +
 
 +
The softMC provides numerous '''literal constants''' (reserved words with a fixed value). You can use these constants anywhere in your program to make your code more intuitive and easier to read. For example:
 +
<pre>A1.Motion = ON
 +
</pre>
 +
 
 +
turns on the A1 property Motion. This is more intuitive to read than:
 +
<pre>A1.Motion = 1
 +
</pre>
 +
 
 +
although the effect is identical.
 +
 
 +
A number of keywords have been defined in the system to facilitate operation. These keywords, or constants, may be used in place of explicit numeric values in instances where a parameter has a discrete range of allowed values.
  
 
The following is a list of constants.
 
The following is a list of constants.
  
{| border="1" width="100%"
+
{{MC-Basic/PredefinedConstantHeader|
!Reserved Name
+
{{MC-Basic/PredefinedConstant|ON|1|MOTION property (axis and system) ENABLE property (System, axis and group)|A1.Motion ?'"`UNIQ--nowiki-00000003-QINU`"'? ON A1.Enable ?'"`UNIQ--nowiki-00000004-QINU`"'? ON}}
!Value
+
{{MC-Basic/PredefinedConstant|OFF|0|MOTION property (axis and system) ENABLE property (System, axis and group) SLAVE axis property|A1.Motion?'"`UNIQ--nowiki-00000005-QINU`"'?OFF A1.Enable?'"`UNIQ--nowiki-00000006-QINU`"'?OFF A1.Slave ?'"`UNIQ--nowiki-00000007-QINU`"'? OFF}}
!Usage
+
{{MC-Basic/PredefinedConstant|MaxDouble|1.797693134862311 e+308|Returns the maximum double precision value|}}
!Example
+
{{MC-Basic/PredefinedConstant|Maxlong|2147483647|Returns the maximum integer value|}}
|-
+
{{MC-Basic/PredefinedConstant|MinLong|-2147483648|Returns the minimum integer value|}}
|ON
+
{{MC-Basic/PredefinedConstant|Immediate/Immed|1|StartType property value (axis and group) StopType property value (axis and group)|A1.StartType ?'"`UNIQ--nowiki-00000008-QINU`"'? Immediate A1.StopType ?'"`UNIQ--nowiki-00000009-QINU`"'? Immed}}
|1
+
{{MC-Basic/PredefinedConstant|SuperImmediate/Simm|5|StartType property value (axis and group)|A1.StartType ?'"`UNIQ--nowiki-0000000A-QINU`"'? Simm}}
|MOTION property (axis and system) ENABLE property (System, axis and group)
+
{{MC-Basic/PredefinedConstant|Abort|4|StartType property value (axis and group)|A1.StartType ?'"`UNIQ--nowiki-0000000B-QINU`"'? Abort}}
|A1.Motion <nowiki>=</nowiki> ON A1.Enable <nowiki>=</nowiki> ON
+
{{MC-Basic/PredefinedConstant|Settled|2|StartType property value (axis and group)|A1.StartType ?'"`UNIQ--nowiki-0000000C-QINU`"'? Settled}}
|-
+
{{MC-Basic/PredefinedConstant|InPosition/Inpos|2|StartType property value (axis and group)|A1.StartType ?'"`UNIQ--nowiki-0000000D-QINU`"'? InPos}}
|OFF
+
{{MC-Basic/PredefinedConstant|GeneratorCompleted/Gcom|3|StartType property value (axis and group)|G1.StartType ?'"`UNIQ--nowiki-0000000E-QINU`"'? Gcom}}
|0
+
{{MC-Basic/PredefinedConstant|Sync|4|StartType property value (axis and group)|A1.StartType ?'"`UNIQ--nowiki-0000000F-QINU`"'? Sync}}
|MOTION property (axis and system) ENABLE property (System, axis and group) SLAVE axis property
+
{{MC-Basic/PredefinedConstant|OnPath|2|StopType property type (axis and group)|A1.StopType ?'"`UNIQ--nowiki-00000010-QINU`"'? OnPath}}
|A1.Motion<nowiki>=</nowiki>OFF A1.Enable<nowiki>=</nowiki>OFF A1.Slave <nowiki>=</nowiki> OFF
+
{{MC-Basic/PredefinedConstant|EndMotion/Emot|3|StopType property type (axis and group)|A1.StopType ?'"`UNIQ--nowiki-00000011-QINU`"'? EndMotion}}
|-
+
{{MC-Basic/PredefinedConstant|Continue/Cont|1|ProceedType property (axis and group)|A1.ProceedType ?'"`UNIQ--nowiki-00000012-QINU`"'? Cont}}
|MaxDouble
+
{{MC-Basic/PredefinedConstant|NextMotion/Nmot|2|ProceedType property (axis and group)|A1.ProceedType ?'"`UNIQ--nowiki-00000013-QINU`"'? NextMotion}}
|1.797693134862311 e+308
+
{{MC-Basic/PredefinedConstant|ClearMotion/Cmot|3|ProceedType property (axis and group)|A1.ProceedType ?'"`UNIQ--nowiki-00000014-QINU`"'? ClearMotion}}
|Returns the maximum double precision value
+
{{MC-Basic/PredefinedConstant|True|1|Absolute property (axis and group) Simulated property (axis)|A1.Absolute ?'"`UNIQ--nowiki-00000015-QINU`"'? True}}
|
+
{{MC-Basic/PredefinedConstant|False|0|Absolute property (axis and group) Simulated property (axis)|A1.Absolute ?'"`UNIQ--nowiki-00000016-QINU`"'? False}}
|-
+
{{MC-Basic/PredefinedConstant|PI|3.14159265359|In expressions; to convert from Radians to degrees|Deg ?'"`UNIQ--nowiki-00000017-QINU`"'? Rad *180 / PI}}
|Maxlong
+
{{MC-Basic/PredefinedConstant|Gear|1|Slave property (axis only)|A1.Slave ?'"`UNIQ--nowiki-00000018-QINU`"'? Gear}}
|2147483647
+
{{MC-Basic/PredefinedConstant|Cam|2|Slave property (axis only)|A1.Slave ?'"`UNIQ--nowiki-00000019-QINU`"'? Cam}}
|Returns the maximum integer value
+
{{MC-Basic/PredefinedConstant|External|1|Feedback type|a1.Feedback ?'"`UNIQ--nowiki-0000001A-QINU`"'? External}}
|
+
{{MC-Basic/PredefinedConstant|Rise|1|Capture Polarity|a1.CapturePolarity ?'"`UNIQ--nowiki-0000001B-QINU`"'? Rise}}
|-
+
{{MC-Basic/PredefinedConstant|Fall|2|Capture Polarity|a1.CapturePolarity ?'"`UNIQ--nowiki-0000001C-QINU`"'? Fall}}
|MinLong
+
{{MC-Basic/PredefinedConstant|Halt|0|Drive Halt/Restart control.|a1.HaltRestart ?'"`UNIQ--nowiki-0000001D-QINU`"'? Halt}}
| -2147483648
+
{{MC-Basic/PredefinedConstant|Restart|1|Drive Halt/Restart control.|a1.HaltRestart ?'"`UNIQ--nowiki-0000001E-QINU`"'? Restart}}
|Returns the minimum integer value
+
{{MC-Basic/PredefinedConstant|In1|1||}}
|
+
{{MC-Basic/PredefinedConstant|In2|2||}}
|-
+
{{MC-Basic/PredefinedConstant|In3|3||}}
|Immediate/Immed
+
{{MC-Basic/PredefinedConstant|Homing|10|Assigning home switch|In1mode ?'"`UNIQ--nowiki-0000001F-QINU`"'? homing}}
|1
+
{{MC-Basic/PredefinedConstant|Capturing|16|Assigning capture switch|In2mode ?'"`UNIQ--nowiki-00000020-QINU`"'? capturing}}
|StartType property value (axis and group) StopType property value (axis and group)
+
{{MC-Basic/PredefinedConstant|Positive|1|Axis direction|A1.Direction ?'"`UNIQ--nowiki-00000021-QINU`"'? Positive}}
|A1.StartType <nowiki>=</nowiki> Immediate A1.StopType <nowiki>=</nowiki> Immed
+
{{MC-Basic/PredefinedConstant|Negative|-1|Axis direction|A1.Direction ?'"`UNIQ--nowiki-00000022-QINU`"'? Negative}}
|-
+
{{MC-Basic/PredefinedConstant|Task_Running|1|Task state|Returned by <task>.State query.}}
|SuperImmediate/Simm
+
{{MC-Basic/PredefinedConstant|Task_Stopped|2|Task state|Returned by <task>.State query.}}
|5
+
{{MC-Basic/PredefinedConstant|Task_Error|4|Task state|Returned by <task>.State query.}}
|StartType property value (axis and group)
+
{{MC-Basic/PredefinedConstant|Task_Ready|7|Task state|Returned by <task>.State query.}}
|A1.StartType <nowiki>=</nowiki> Simm
+
{{MC-Basic/PredefinedConstant|Task_KillStart|9|Task state|Returned by <task>.State query. Intermidiate state, start of task kill sequence.}}
|-
+
{{MC-Basic/PredefinedConstant|Task_Killed|10|Task state|Returned by <task>.State query.}}
|Abort
+
{{MC-Basic/PredefinedConstant|Task_Interrupted|512|Task state qualifier|Returned by <task>.State query.}}
|4
+
{{MC-Basic/PredefinedConstant|Task_Locked|256|Task state qualifier|Returned by <task>.State query.}}
|StartType property value (axis and group)
+
{{MC-Basic/PredefinedConstant|AUTO|0|system determines the configuration flag automatically|}}
|A1.StartType <nowiki>=</nowiki> Abort
+
{{MC-Basic/PredefinedConstant|LEFTY|1|Arm flag : positive jont-2 moves the wrist in positive WORLD Z direction while joint-3 is not activated|}}
|-
+
{{MC-Basic/PredefinedConstant|RIGHTY|2|Arm flag : positive jont-2 moves the wrist in negative WORLD Z direction while joint-3 is not activated|}}
|Settled
+
{{MC-Basic/PredefinedConstant|BELOW|1|Elbow flag :Position of the wrist of the LEFTY/ RIGHTYarm with respect to the shoulder coord. system has Negative/Positive coordinate value along the Y axis of the second segment|}}
|2
+
{{MC-Basic/PredefinedConstant|ABOVE|2|Elbow flag :Position of the wrist of the LEFTY/ RIGHTYarm with respect to the shoulder coord. system has Negative/Positive coordinate value along the Y axis of the second segment|}}
|StartType property value (axis and group)
+
{{MC-Basic/PredefinedConstant|FLIP|2|Wrist flag : value of joint 5 is negative|}}
|A1.StartType <nowiki>=</nowiki> Settled
+
{{MC-Basic/PredefinedConstant|NOFLIP|1|Wrist flag : value of joint 5 is positive|}}
|-
+
}}
|InPosition/Inpos
+
 
|2
+
[[Category:MC-Basic|Constants]] [[Category:Control:Offline]]
|StartType property value (axis and group)
 
|A1.StartType <nowiki>=</nowiki> InPos
 
|-
 
|GeneratorCompleted/Gcom
 
|3
 
|StartType property value (axis and group)
 
|G1.StartType <nowiki>=</nowiki> Gcom
 
|-
 
|Sync
 
|4
 
|StartType property value (axis and group)
 
|A1.StartType <nowiki>=</nowiki> Sync
 
|-
 
|OnPath
 
|2
 
|StopType property type (axis and group)
 
|A1.StopType <nowiki>=</nowiki> OnPath
 
|-
 
|EndMotion/Emot
 
|3
 
|StopType property type (axis and group)
 
|A1.StopType <nowiki>=</nowiki> EndMotion
 
|-
 
|Continue/Cont
 
|1
 
|ProceedType property (axis and group)
 
|A1.ProceedType <nowiki>=</nowiki> Cont
 
|-
 
|NextMotion/Nmot
 
|2
 
|ProceedType property (axis and group)
 
|A1.ProceedType <nowiki>=</nowiki> NextMotion
 
|-
 
|ClearMotion/Cmot
 
|3
 
|ProceedType property (axis and group)
 
|A1.ProceedType <nowiki>=</nowiki> ClearMotion
 
|-
 
|True
 
|1
 
|Absolute property (axis and group) Simulated property (axis)
 
|A1.Absolute <nowiki>=</nowiki> True
 
|-
 
|False
 
|0
 
|Absolute property (axis and group) Simulated property (axis)
 
|A1.Absolute <nowiki>=</nowiki> False
 
|-
 
|PI
 
|3.14159265359
 
|In expressions; to convert from Radians to degrees
 
|Deg <nowiki>=</nowiki> Rad *180 / PI
 
|-
 
|Gear
 
|1
 
|Slave property (axis only)
 
|A1.Slave <nowiki>=</nowiki> Gear
 
|-
 
|Cam
 
|2
 
|Slave property (axis only)
 
|A1.Slave <nowiki>=</nowiki> Cam
 
|-
 
|External
 
|1
 
|Feedback type
 
|a1.Feedback <nowiki>=</nowiki> External
 
|-
 
|Rise
 
|1
 
|Capture Polarity
 
|a1.CapturePolarity <nowiki>=</nowiki> Rise
 
|-
 
|Fall
 
|2
 
|Capture Polarity
 
|a1.CapturePolarity <nowiki>=</nowiki> Fall
 
|-
 
|Halt
 
|0
 
|Drive Halt/Restart control.
 
|a1.HaltRestart <nowiki>=</nowiki> Halt
 
|-
 
|Restart
 
|1
 
|Drive Halt/Restart control.
 
|a1.HaltRestart <nowiki>=</nowiki> Restart
 
|-
 
|In1
 
|1
 
|
 
|
 
|-
 
|In2
 
|2
 
|
 
|
 
|-
 
|In3
 
|3
 
|
 
|
 
|-
 
|Homing
 
|10
 
|Assigning home switch
 
|In1mode <nowiki>=</nowiki> homing
 
|-
 
|Capturing
 
|16
 
|Assigning capture switch
 
|In2mode <nowiki>=</nowiki> capturing
 
|-
 
|Positive
 
|1
 
|Axis direction
 
|A1.Direction <nowiki>=</nowiki> Positive
 
|-
 
|Negative
 
| -1
 
|Axis direction
 
|A1.Direction <nowiki>=</nowiki> Negative
 
|-
 
|Task_Running
 
|1
 
|Task state
 
|Returned by <task>.State query.
 
|-
 
|Task_Stopped
 
|2
 
|Task state
 
|Returned by <task>.State query.
 
|-
 
|Task_Error
 
|4
 
|Task state
 
|Returned by <task>.State query.
 
|-
 
|Task_Ready
 
|7
 
|Task state
 
|Returned by <task>.State query.
 
|-
 
|Task_KillStart
 
|9
 
|Task state
 
|Returned by <task>.State query. Intermidiate state, start of task kill sequence.
 
|-
 
|Task_Killed
 
|10
 
|Task state
 
|Returned by <task>.State query.
 
|-
 
|Task_Interrupted
 
|512
 
|Task state qualifier
 
|Returned by <task>.State query.
 
|-
 
|Task_Locked
 
|256
 
|Task state qualifier
 
|Returned by <task>.State query.
 
|-
 
|LEFTY
 
|1
 
|Arm flag : positive jont-2 moves the wrist in positive WORLD Z direction while joint-3 is not activated
 
|
 
|-
 
|RIGHTY
 
|2
 
|Arm flag : positive jont-2 moves the wrist in negative WORLD Z direction while joint-3 is not activated
 
|
 
|-
 
|BELOW
 
|1
 
|Elbow flag :Position of the wrist of the LEFTY/ RIGHTYarm with respect to the shoulder coord. system has Negative/Positive coordinate value along the Y axis of the second segment
 
|
 
|-
 
|ABOVE
 
|2
 
|Elbow flag :Position of the wrist of the LEFTY/ RIGHTYarm with respect to the shoulder coord. system has Negative/Positive coordinate value along the Y axis of the second segment
 
|
 
|-
 
|FLIP
 
|2
 
|Wrist flag : value of joint 5 is negative
 
|
 
|-
 
|NOFLIP
 
|1
 
|Wrist flag : value of joint 5 is positive
 
|
 
|}
 

Latest revision as of 08:15, 24 April 2022

Constants are numbers, which are written as ordinary text characters; for example, 161. Constants can be written in decimal or in hexadecimal (HEX). To write a constant in hex, precede it by a 0x; for example, 0xF is the hex representation of 15 decimal.

The softMC provides numerous literal constants (reserved words with a fixed value). You can use these constants anywhere in your program to make your code more intuitive and easier to read. For example:

A1.Motion = ON

turns on the A1 property Motion. This is more intuitive to read than:

A1.Motion = 1

although the effect is identical.

A number of keywords have been defined in the system to facilitate operation. These keywords, or constants, may be used in place of explicit numeric values in instances where a parameter has a discrete range of allowed values.

The following is a list of constants.

Reserved Name Value Usage Example
ON 1 MOTION property (axis and system) ENABLE property (System, axis and group) A1.Motion ?'"`UNIQ--nowiki-00000003-QINU`"'? ON A1.Enable ?'"`UNIQ--nowiki-00000004-QINU`"'? ON
OFF 0 MOTION property (axis and system) ENABLE property (System, axis and group) SLAVE axis property A1.Motion?'"`UNIQ--nowiki-00000005-QINU`"'?OFF A1.Enable?'"`UNIQ--nowiki-00000006-QINU`"'?OFF A1.Slave ?'"`UNIQ--nowiki-00000007-QINU`"'? OFF
MaxDouble 1.797693134862311 e+308 Returns the maximum double precision value
Maxlong 2147483647 Returns the maximum integer value
MinLong -2147483648 Returns the minimum integer value
Immediate/Immed 1 StartType property value (axis and group) StopType property value (axis and group) A1.StartType ?'"`UNIQ--nowiki-00000008-QINU`"'? Immediate A1.StopType ?'"`UNIQ--nowiki-00000009-QINU`"'? Immed
SuperImmediate/Simm 5 StartType property value (axis and group) A1.StartType ?'"`UNIQ--nowiki-0000000A-QINU`"'? Simm
Abort 4 StartType property value (axis and group) A1.StartType ?'"`UNIQ--nowiki-0000000B-QINU`"'? Abort
Settled 2 StartType property value (axis and group) A1.StartType ?'"`UNIQ--nowiki-0000000C-QINU`"'? Settled
InPosition/Inpos 2 StartType property value (axis and group) A1.StartType ?'"`UNIQ--nowiki-0000000D-QINU`"'? InPos
GeneratorCompleted/Gcom 3 StartType property value (axis and group) G1.StartType ?'"`UNIQ--nowiki-0000000E-QINU`"'? Gcom
Sync 4 StartType property value (axis and group) A1.StartType ?'"`UNIQ--nowiki-0000000F-QINU`"'? Sync
OnPath 2 StopType property type (axis and group) A1.StopType ?'"`UNIQ--nowiki-00000010-QINU`"'? OnPath
EndMotion/Emot 3 StopType property type (axis and group) A1.StopType ?'"`UNIQ--nowiki-00000011-QINU`"'? EndMotion
Continue/Cont 1 ProceedType property (axis and group) A1.ProceedType ?'"`UNIQ--nowiki-00000012-QINU`"'? Cont
NextMotion/Nmot 2 ProceedType property (axis and group) A1.ProceedType ?'"`UNIQ--nowiki-00000013-QINU`"'? NextMotion
ClearMotion/Cmot 3 ProceedType property (axis and group) A1.ProceedType ?'"`UNIQ--nowiki-00000014-QINU`"'? ClearMotion
True 1 Absolute property (axis and group) Simulated property (axis) A1.Absolute ?'"`UNIQ--nowiki-00000015-QINU`"'? True
False 0 Absolute property (axis and group) Simulated property (axis) A1.Absolute ?'"`UNIQ--nowiki-00000016-QINU`"'? False
PI 3.14159265359 In expressions; to convert from Radians to degrees Deg ?'"`UNIQ--nowiki-00000017-QINU`"'? Rad *180 / PI
Gear 1 Slave property (axis only) A1.Slave ?'"`UNIQ--nowiki-00000018-QINU`"'? Gear
Cam 2 Slave property (axis only) A1.Slave ?'"`UNIQ--nowiki-00000019-QINU`"'? Cam
External 1 Feedback type a1.Feedback ?'"`UNIQ--nowiki-0000001A-QINU`"'? External
Rise 1 Capture Polarity a1.CapturePolarity ?'"`UNIQ--nowiki-0000001B-QINU`"'? Rise
Fall 2 Capture Polarity a1.CapturePolarity ?'"`UNIQ--nowiki-0000001C-QINU`"'? Fall
Halt 0 Drive Halt/Restart control. a1.HaltRestart ?'"`UNIQ--nowiki-0000001D-QINU`"'? Halt
Restart 1 Drive Halt/Restart control. a1.HaltRestart ?'"`UNIQ--nowiki-0000001E-QINU`"'? Restart
In1 1
In2 2
In3 3
Homing 10 Assigning home switch In1mode ?'"`UNIQ--nowiki-0000001F-QINU`"'? homing
Capturing 16 Assigning capture switch In2mode ?'"`UNIQ--nowiki-00000020-QINU`"'? capturing
Positive 1 Axis direction A1.Direction ?'"`UNIQ--nowiki-00000021-QINU`"'? Positive
Negative -1 Axis direction A1.Direction ?'"`UNIQ--nowiki-00000022-QINU`"'? Negative
Task_Running 1 Task state Returned by <task>.State query.
Task_Stopped 2 Task state Returned by <task>.State query.
Task_Error 4 Task state Returned by <task>.State query.
Task_Ready 7 Task state Returned by <task>.State query.
Task_KillStart 9 Task state Returned by <task>.State query. Intermidiate state, start of task kill sequence.
Task_Killed 10 Task state Returned by <task>.State query.
Task_Interrupted 512 Task state qualifier Returned by <task>.State query.
Task_Locked 256 Task state qualifier Returned by <task>.State query.
AUTO 0 system determines the configuration flag automatically
LEFTY 1 Arm flag : positive jont-2 moves the wrist in positive WORLD Z direction while joint-3 is not activated
RIGHTY 2 Arm flag : positive jont-2 moves the wrist in negative WORLD Z direction while joint-3 is not activated
BELOW 1 Elbow flag :Position of the wrist of the LEFTY/ RIGHTYarm with respect to the shoulder coord. system has Negative/Positive coordinate value along the Y axis of the second segment
ABOVE 2 Elbow flag :Position of the wrist of the LEFTY/ RIGHTYarm with respect to the shoulder coord. system has Negative/Positive coordinate value along the Y axis of the second segment
FLIP 2 Wrist flag : value of joint 5 is negative
NOFLIP 1 Wrist flag : value of joint 5 is positive