Difference between revisions of "MC-Basic Constants"

From SoftMC-Wiki
Jump to: navigation, search
m (Miborich moved page Axystems:MC-Basic Constants to MC-Basic Constants: Global renaming of Axystems: namespace into (Main):)
(Undo revision 133881 by Hallel (talk))
 
(3 intermediate revisions by 2 users not shown)
Line 3: Line 3:
  
 
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:
 
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>
+
<pre>A1.Motion = ON
A1.Motion = ON
 
 
</pre>
 
</pre>
  
 
turns on the A1 property Motion. This is more intuitive to read than:
 
turns on the A1 property Motion. This is more intuitive to read than:
<pre>
+
<pre>A1.Motion = 1
A1.Motion = 1
 
 
</pre>
 
</pre>
  
 
although the effect is identical.
 
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.
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.
  
 
{{MC-Basic/PredefinedConstantHeader|
 
{{MC-Basic/PredefinedConstantHeader|
{{MC-Basic/PredefinedConstant|ON|1|MOTION property (axis and system) ENABLE property (System, axis and group)|A1.Motion <nowiki>=</nowiki> ON A1.Enable <nowiki>=</nowiki> ON}}
+
{{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}}
{{MC-Basic/PredefinedConstant|OFF|0|MOTION property (axis and system) ENABLE property (System, axis and group) SLAVE axis property|A1.Motion<nowiki>=</nowiki>OFF A1.Enable<nowiki>=</nowiki>OFF A1.Slave <nowiki>=</nowiki> OFF}}
+
{{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}}
 
{{MC-Basic/PredefinedConstant|MaxDouble|1.797693134862311 e+308|Returns the maximum double precision value|}}
 
{{MC-Basic/PredefinedConstant|MaxDouble|1.797693134862311 e+308|Returns the maximum double precision value|}}
 
{{MC-Basic/PredefinedConstant|Maxlong|2147483647|Returns the maximum integer value|}}
 
{{MC-Basic/PredefinedConstant|Maxlong|2147483647|Returns the maximum integer value|}}
 
{{MC-Basic/PredefinedConstant|MinLong|-2147483648|Returns the minimum integer value|}}
 
{{MC-Basic/PredefinedConstant|MinLong|-2147483648|Returns the minimum integer value|}}
{{MC-Basic/PredefinedConstant|Immediate/Immed|1|StartType property value (axis and group) StopType property value (axis and group)|A1.StartType <nowiki>=</nowiki> Immediate A1.StopType <nowiki>=</nowiki> Immed}}
+
{{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}}
{{MC-Basic/PredefinedConstant|SuperImmediate/Simm|5|StartType property value (axis and group)|A1.StartType <nowiki>=</nowiki> Simm}}
+
{{MC-Basic/PredefinedConstant|SuperImmediate/Simm|5|StartType property value (axis and group)|A1.StartType ?'"`UNIQ--nowiki-0000000A-QINU`"'? Simm}}
{{MC-Basic/PredefinedConstant|Abort|4|StartType property value (axis and group)|A1.StartType <nowiki>=</nowiki> Abort}}
+
{{MC-Basic/PredefinedConstant|Abort|4|StartType property value (axis and group)|A1.StartType ?'"`UNIQ--nowiki-0000000B-QINU`"'? Abort}}
{{MC-Basic/PredefinedConstant|Settled|2|StartType property value (axis and group)|A1.StartType <nowiki>=</nowiki> Settled}}
+
{{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 <nowiki>=</nowiki> InPos}}
+
{{MC-Basic/PredefinedConstant|InPosition/Inpos|2|StartType property value (axis and group)|A1.StartType ?'"`UNIQ--nowiki-0000000D-QINU`"'? InPos}}
{{MC-Basic/PredefinedConstant|GeneratorCompleted/Gcom|3|StartType property value (axis and group)|G1.StartType <nowiki>=</nowiki> Gcom}}
+
{{MC-Basic/PredefinedConstant|GeneratorCompleted/Gcom|3|StartType property value (axis and group)|G1.StartType ?'"`UNIQ--nowiki-0000000E-QINU`"'? Gcom}}
{{MC-Basic/PredefinedConstant|Sync|4|StartType property value (axis and group)|A1.StartType <nowiki>=</nowiki> Sync}}
+
{{MC-Basic/PredefinedConstant|Sync|4|StartType property value (axis and group)|A1.StartType ?'"`UNIQ--nowiki-0000000F-QINU`"'? Sync}}
{{MC-Basic/PredefinedConstant|OnPath|2|StopType property type (axis and group)|A1.StopType <nowiki>=</nowiki> OnPath}}
+
{{MC-Basic/PredefinedConstant|OnPath|2|StopType property type (axis and group)|A1.StopType ?'"`UNIQ--nowiki-00000010-QINU`"'? OnPath}}
{{MC-Basic/PredefinedConstant|EndMotion/Emot|3|StopType property type (axis and group)|A1.StopType <nowiki>=</nowiki> EndMotion}}
+
{{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 <nowiki>=</nowiki> Cont}}
+
{{MC-Basic/PredefinedConstant|Continue/Cont|1|ProceedType property (axis and group)|A1.ProceedType ?'"`UNIQ--nowiki-00000012-QINU`"'? Cont}}
{{MC-Basic/PredefinedConstant|NextMotion/Nmot|2|ProceedType property (axis and group)|A1.ProceedType <nowiki>=</nowiki> NextMotion}}
+
{{MC-Basic/PredefinedConstant|NextMotion/Nmot|2|ProceedType property (axis and group)|A1.ProceedType ?'"`UNIQ--nowiki-00000013-QINU`"'? NextMotion}}
{{MC-Basic/PredefinedConstant|ClearMotion/Cmot|3|ProceedType property (axis and group)|A1.ProceedType <nowiki>=</nowiki> ClearMotion}}
+
{{MC-Basic/PredefinedConstant|ClearMotion/Cmot|3|ProceedType property (axis and group)|A1.ProceedType ?'"`UNIQ--nowiki-00000014-QINU`"'? ClearMotion}}
{{MC-Basic/PredefinedConstant|True|1|Absolute property (axis and group) Simulated property (axis)|A1.Absolute <nowiki>=</nowiki> True}}
+
{{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 <nowiki>=</nowiki> False}}
+
{{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 <nowiki>=</nowiki> Rad *180 / PI}}
+
{{MC-Basic/PredefinedConstant|PI|3.14159265359|In expressions; to convert from Radians to degrees|Deg ?'"`UNIQ--nowiki-00000017-QINU`"'? Rad *180 / PI}}
{{MC-Basic/PredefinedConstant|Gear|1|Slave property (axis only)|A1.Slave <nowiki>=</nowiki> Gear}}
+
{{MC-Basic/PredefinedConstant|Gear|1|Slave property (axis only)|A1.Slave ?'"`UNIQ--nowiki-00000018-QINU`"'? Gear}}
{{MC-Basic/PredefinedConstant|Cam|2|Slave property (axis only)|A1.Slave <nowiki>=</nowiki> Cam}}
+
{{MC-Basic/PredefinedConstant|Cam|2|Slave property (axis only)|A1.Slave ?'"`UNIQ--nowiki-00000019-QINU`"'? Cam}}
{{MC-Basic/PredefinedConstant|External|1|Feedback type|a1.Feedback <nowiki>=</nowiki> External}}
+
{{MC-Basic/PredefinedConstant|External|1|Feedback type|a1.Feedback ?'"`UNIQ--nowiki-0000001A-QINU`"'? External}}
{{MC-Basic/PredefinedConstant|Rise|1|Capture Polarity|a1.CapturePolarity <nowiki>=</nowiki> Rise}}
+
{{MC-Basic/PredefinedConstant|Rise|1|Capture Polarity|a1.CapturePolarity ?'"`UNIQ--nowiki-0000001B-QINU`"'? Rise}}
{{MC-Basic/PredefinedConstant|Fall|2|Capture Polarity|a1.CapturePolarity <nowiki>=</nowiki> Fall}}
+
{{MC-Basic/PredefinedConstant|Fall|2|Capture Polarity|a1.CapturePolarity ?'"`UNIQ--nowiki-0000001C-QINU`"'? Fall}}
{{MC-Basic/PredefinedConstant|Halt|0|Drive Halt/Restart control.|a1.HaltRestart <nowiki>=</nowiki> Halt}}
+
{{MC-Basic/PredefinedConstant|Halt|0|Drive Halt/Restart control.|a1.HaltRestart ?'"`UNIQ--nowiki-0000001D-QINU`"'? Halt}}
{{MC-Basic/PredefinedConstant|Restart|1|Drive Halt/Restart control.|a1.HaltRestart <nowiki>=</nowiki> Restart}}
+
{{MC-Basic/PredefinedConstant|Restart|1|Drive Halt/Restart control.|a1.HaltRestart ?'"`UNIQ--nowiki-0000001E-QINU`"'? Restart}}
 
{{MC-Basic/PredefinedConstant|In1|1||}}
 
{{MC-Basic/PredefinedConstant|In1|1||}}
 
{{MC-Basic/PredefinedConstant|In2|2||}}
 
{{MC-Basic/PredefinedConstant|In2|2||}}
 
{{MC-Basic/PredefinedConstant|In3|3||}}
 
{{MC-Basic/PredefinedConstant|In3|3||}}
{{MC-Basic/PredefinedConstant|Homing|10|Assigning home switch|In1mode <nowiki>=</nowiki> homing}}
+
{{MC-Basic/PredefinedConstant|Homing|10|Assigning home switch|In1mode ?'"`UNIQ--nowiki-0000001F-QINU`"'? homing}}
{{MC-Basic/PredefinedConstant|Capturing|16|Assigning capture switch|In2mode <nowiki>=</nowiki> capturing}}
+
{{MC-Basic/PredefinedConstant|Capturing|16|Assigning capture switch|In2mode ?'"`UNIQ--nowiki-00000020-QINU`"'? capturing}}
{{MC-Basic/PredefinedConstant|Positive|1|Axis direction|A1.Direction <nowiki>=</nowiki> Positive}}
+
{{MC-Basic/PredefinedConstant|Positive|1|Axis direction|A1.Direction ?'"`UNIQ--nowiki-00000021-QINU`"'? Positive}}
{{MC-Basic/PredefinedConstant|Negative|-1|Axis direction|A1.Direction <nowiki>=</nowiki> Negative}}
+
{{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.}}
 
{{MC-Basic/PredefinedConstant|Task_Running|1|Task state|Returned by <task>.State query.}}
 
{{MC-Basic/PredefinedConstant|Task_Stopped|2|Task state|Returned by <task>.State query.}}
 
{{MC-Basic/PredefinedConstant|Task_Stopped|2|Task state|Returned by <task>.State query.}}
Line 63: Line 59:
 
{{MC-Basic/PredefinedConstant|Task_Interrupted|512|Task state qualifier|Returned by <task>.State query.}}
 
{{MC-Basic/PredefinedConstant|Task_Interrupted|512|Task state qualifier|Returned by <task>.State query.}}
 
{{MC-Basic/PredefinedConstant|Task_Locked|256|Task state qualifier|Returned by <task>.State query.}}
 
{{MC-Basic/PredefinedConstant|Task_Locked|256|Task state qualifier|Returned by <task>.State query.}}
 +
{{MC-Basic/PredefinedConstant|AUTO|0|system determines the configuration flag automatically|}}
 
{{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|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|}}
+
{{MC-Basic/PredefinedConstant|RIGHTY|2|Arm flag : positive jont-2 moves the wrist in negative WORLD Z direction while joint-3 is not activated|}}
{{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|}}
+
{{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|}}
{{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|}}
+
{{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|}}
 
{{MC-Basic/PredefinedConstant|FLIP|2|Wrist flag : value of joint 5 is negative|}}
 
{{MC-Basic/PredefinedConstant|FLIP|2|Wrist flag : value of joint 5 is negative|}}
{{MC-Basic/PredefinedConstant|NOFLIP|1|Wrist flag : value of joint 5 is positive|}}
+
{{MC-Basic/PredefinedConstant|NOFLIP|1|Wrist flag : value of joint 5 is positive|}}
 
}}
 
}}
  
[[Category:Axystems:MC-Basic|Constants]]
+
[[Category:MC-Basic|Constants]] [[Category:Control:Offline]]
[[Category:Control:Offline|MC-Basic Constants]]
 

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