
MCO 305 Design Guide
__ Software Reference __
MG.33.L4.02 – VLT
®
is a registered Danfoss trademark
125
MIPOS
Summary
Query last index or marker position of the master
Syntax
res = MIPOS
Return Value
res = last index or marker position of the master absolute to actual zero point in qc
Description
The command MIPOS returns the last index or marker position of the master
absolute to the current zero point.
The configuration of MIPOS, that is whether master-encoders index- or marker posi-
tion (= controlled drive) is returned, is done with the par. 33-19
Master Marker Type
.
NB!:
The trigger signal for the marker position has to be connected mandatory to the
input 5.
The position value in MIPOS is accurate to +/- 1qc. In opposite to the position
information in MAPOS, which is just updated in a controller cycle of typically
1 ms, the actual position value is hardware stored in real time a buffer (in an
internal processor register), when the configured signal is high. Then it will be
copied in the system variable MIPOS.
If simultaneously to the marker position an interrupt is initiated (ON INT 5 GOSUB
...) and within this interrupt it is operated with MIPOS, you should use before reading
of MIPOS a delay of 2 milliseconds (DELAY 2) within the interrupt subroutine. So it
can be ensured, that the latched position value is already complete copied in the
system variable MIPOS and that not be taken an old value. – See also sample.
NB!:
The command MIPOS can not be used:
– with absolute encoders (see par. 32-30
Incremental Signal Type)
– when Parameter 32-50 is set to [3] – Motor Control.
Command Group
I/O
Cross Index
CPOS, DEF ORIGIN, SET ORIGIN, POSA, POSR, ON INT
Parameters: 32-12
User Unit Numerator
, 32-11
User Unit Denominator
, 33-19
Master Marker Type
Syntax Example
PRINT MIPOS
/* print to the PC the last index position of the master */
Sample
// Definition Interrupt-Handler
ON INT 5 GOSUB master_int
// Definition of IPOS-Latching on positive edge at input 5
SET SYNCMTYPM 2
CVEL 10
// Start moving
CSTART //
Endless-Loop
mainloop: //
...
GOTO mainloop
SUBMAINPROG
SUBPROG master_int
int_mpos
=
MAPOS
// Latching MAPOS for testing, how exact it would be …
DELAY 2
// Wait 2 ms, to be sure, that MIPOS is correct updated
triggered_mpos = MIPOS
// Latching IPOS for a later handling etc.
//
...
//
...
PRINT "Interrupt master position: ",int_mpos
PRINT "Triggered master position: ",triggered_mpos
RETURN
ENDPROG
Summary of Contents for MCO 305
Page 4: ......