Gemini GV6K and Gemini GT6K Programmer's Guide
Gemini GV6K and Gemini GT6K Programmer's Guide
Gemini GV6K and Gemini GT6K Programmer's Guide
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Transfer <strong>and</strong><br />
Assignment/<br />
Comparison of Master<br />
Cycle Position <strong>and</strong><br />
Number;<br />
The current master cycle position <strong>and</strong> the current master cycle number may be displayed with<br />
the TPMAS <strong>and</strong> TNMCY comm<strong>and</strong>s, respectively. These values may also be read into numeric<br />
variables (VAR) at any time using the PMAS <strong>and</strong> NMCY comm<strong>and</strong>s (e.g., VAR6=NMCY). If<br />
position capture is used, the master cycle position <strong>and</strong> be captured, <strong>and</strong> the value is available<br />
with the TPCMS <strong>and</strong> PCMS comm<strong>and</strong>s.<br />
Very often, the master cycle number will be directly related to the quantity of product produced<br />
in a manufacturing run, <strong>and</strong> the master cycle position can be used to determine what portion of<br />
a current cycle is complete.<br />
The master cycle number is sampled once per position sampling period (see note, left). If the<br />
master cycle length (FMCLEN) divided by the master's velocity (VMAS) is less than the<br />
position sampling period (2 ms), then the sample (TNMCY or NMCY value) may not be<br />
accurate.<br />
Details on using PMAS in conditional expressions is provided below in Using Conditional<br />
Statements with PMAS.<br />
Using Conditional<br />
Statements with<br />
Master Cycle Position<br />
(PMAS);<br />
The current master cycle position (PMAS) value may be used in comparison expressions, just<br />
like other position variables such as PC, PE, <strong>and</strong> FB. PMAS is a special case, however, because<br />
its value rolls over to zero when the master cycle length (FMCLEN) is met or exceeded. This<br />
means that PMAS values greater than or equal to the master cycle length will never be reported<br />
with the TPMAS comm<strong>and</strong>, or with expressions such as (VAR1=1PMAS).<br />
The other fact that makes PMAS special is that master cycle counting may be restarted after<br />
the comm<strong>and</strong> containing the PMAS expression has been executed. Either the FMCNEW<br />
comm<strong>and</strong> or the TRGFNcx1 comm<strong>and</strong> may be used to restart counting, each with a different<br />
effect on the evaluation of PMAS.<br />
The treatment of PMAS in comparison expressions depends on the comm<strong>and</strong> using the<br />
expression, as described below. WAIT <strong>and</strong> GOWHEN are treated as special cases.<br />
IF, UNTIL, <strong>and</strong><br />
WHILE<br />
WAIT <strong>and</strong> GOWHEN<br />
These comm<strong>and</strong>s evaluate the current value of PMAS in the same way that TPMAS does (i.e.,<br />
PMAS values will never be greater than or equal to the master cycle length). With these<br />
comm<strong>and</strong>s, avoid comparing PMAS to be greater than or equal to variables or constants which<br />
are nearly equal to the master cycle length, because rollover may occur before a PMAS sample<br />
is read which makes the comparison true. If such a comparison is necessary, it should be<br />
combined (using OR) with a comparison for master cycle number (NMCY) being greater than<br />
the current master cycle number.<br />
Also, master cycle counting restart may be pending activation of a trigger, but this will not<br />
affect the evaluation of PMAS for IF, WAIT, <strong>and</strong> WHILE. It is simply evaluated based on<br />
counting currently underway.<br />
These comm<strong>and</strong>s evaluate the current value of PMAS differently than TPMAS does, in such a<br />
way that it is possible to compare PMAS to variables or constants which are greater than or<br />
equal to the master cycle length <strong>and</strong> still have the comparison be reliably detected.<br />
Effectively, PMAS is evaluated as if the master cycle length were suddenly set to its maximum<br />
value (2 32 ) at the time the WAIT or GOWHEN comm<strong>and</strong> is encountered. It eliminates the need to<br />
OR the PMAS comparison with a comparison for master cycle number (NMCY) being greater than<br />
the current master cycle number. Such multiple expressions are not allowed in the GOWHEN<br />
comm<strong>and</strong>, so this alternative evaluation of PMAS offers the required flexibility.<br />
This method of evaluation of PMAS allows comm<strong>and</strong>s which sequence follower axis events<br />
through a master cycle to be placed in a loop. The WAIT or GOWHEN comm<strong>and</strong> at the top of<br />
the loop can execute, even though the actual master travel has not finished the previous cycle.<br />
If it is desired to WAIT or GOWHEN for a master cycle position of the next master cycle, the<br />
variable or constant specified in the comm<strong>and</strong> should be calculated by adding one master<br />
cycle length to the desired master cycle position.<br />
184 Gem6K Series Programmer’s <strong>Guide</strong>