MC-Basic Constants

From SoftMC-Wiki
Jump to: navigation, search

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