User Manual

Table Of Contents
Runtime Queries
Advanced Digital Motor Controller User Manual 231
MGS - Read Magsensor Status
Alias: MGSTATUS HexCode: 2C CANOpen id: 0x2120
Description:
When one or more MGS1600 Magnetic Guide Sensors are connected to the controller,
this query reports the state of the sensor. If only one sensor is connected to any pulse in-
put, no argument is needed for this query. If more than one sensor is connected to pulse
inputs and these inputs are enabled and configured in Magsensor MultiPWM mode, then
the argument following the query is used to select the sensor.
Syntax Serial: ?MGS
Argument: SensorNumber
Min: None Max: Total Number of Pulse Inputs
Syntax Scripting: result = getvalue(_MGS, )
result = getvalue(_MGSTATUS, )
Reply:
MGS=f1 + f2*2 + f3*4 + ... + fn*2n-1 Type: Unsigned 16-bit
Where:
cc = (When only one sensor enabled)
None or 1 : Current sensor
cc = (When only several sensors enabled)
1 : Sensor at pulse input 1
2 : Sensor at pulse input 2
...
p : Sensor at pulse input p
f1 : Tape cross
f2 : Tape detect
f3 : Left marker present
f4 : Right marker present
f9 : Sensor active
MGT - Read Magsensor Track Position
Alias: MGTRACK HexCode: 2A CANOpen id: 0x211E
Description:
When one or more MGS1600 Magnetic Guide Sensors are connected to the controller,
this query reports the position of the tracks detected under the sensor. If only one sensor
is connected to any pulse input, the argument following the query selects which track to
read. If more than one sensor is connected to pulse inputs and these inputs are enabled
and configured in Magsensor MultiPWM mode, then the argument following the query is
used to select the sensor. The reported position of the magnetic track in millimeters, us-
ing the center of the sensor as the 0 reference.
Syntax Serial: ?MGT cc
Argument: Channel
Min: 1 Max: 3 * Total Number of Pulse Inputs