coordinate upgrade syntax

  • I should take the actual coordinate of a certain number of points (i.e. XP1.E1, XP2.E1, ...) from dat file and sum to it a value maybe inside a FOR loop before performing SLIN.

    Something like

    [...]

    XP1.E1_new = XP1.E1_old + i*360

    XP2.E1_new = XP2.E1_old + i*360

    [...]

    Which is the correct syntax?


    Many thanks in advance!

  • massula

    Approved the thread.
  • assuming XP1.E1_old is the original retained value, it would be like

    XP1.E1 = XP1.E1_old + ( i * 360.0)


    Calculation need to be done inside the local src file, before you have the motion to P1.

    Unless you work with Global positions and variables.

  • assuming XP1.E1_old is the original retained value, it would be like

    XP1.E1 = XP1.E1_old + ( i * 360.0)


    Calculation need to be done inside the local src file, before you have the motion to P1.

    Unless you work with Global positions and variables.

    ok, as far as I understood before the calculation

    XP1.E1 = XP1_E1_old + ( i * 360.0)

    I have to initialize the variable XP1_E1_old = XP1.E1

    Something like that?


    XP1_E1_old = XP1.E1

    XP1.E1 = XP1_E1_old + ( i * 360.0)

  • if you overwrite XP1_E1_old with the last position of the calculated E1, your point will deviate a lot.


    Always keep a Start value that never changes and do your calculation.

    I don't know your application, so is it a linear slide, and endless running external axis or a spindle kind of thing? It is like Google maps, to calculate the direction to a target you need to know the origin, your start-point

Advertising from our partners