Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

c) In the [Rotate] tab, you must assign the ‘Center Point’. To find the coordinate, place the mouse cursor on the center point. You will find the coordinate at the right-bottom of the XpanelDesigner.

...

(2) Script

a) Select [Tools] – [Script] – [New Script] to bring up the [Add Script] window. Set the running type as ‘Period’ then set the period as 1 sec.

...

b) Write the script as shown below. When the value of the “ROTATE_SEC” reaches or exceeds 360, the script will store 6 to the tag to continue the rotation. The object will rotate 6° per second.

...

VAR A;          //Declare variable A

A=ROTATE_SEC;        //Save ROTATE_SEC value to A

 

IF(A>=360)

{

ROTATE_SEC=6;        //ROTATE_SEC becomes 6 when it reaches 360

}

ELSE

{

ROTATE_SEC=A+6;        //Object rotates 6 degrees per sec

}

...