New API Commands

New API Commands

Postby hermd » 12 Feb 2016, 19:46

Hello, I upgraded from MK2/4 to MK3/4 and installed version 2.10.1511.401. The SendMovePosAxis does not exist anymore and SendMovePosEx has new parameters. Is there an updated manual for the new API commands?
hermd
 
Posts: 8
Joined: 20 Feb 2014, 14:05
Controller: Mk2/4

Re: New API Commands

Postby Support » 15 Feb 2016, 16:04

Which arguments/parameters are confusing you?
Currently there is no new user manual published, it is coming.
Support
 
Posts: 2609
Joined: 07 Apr 2014, 17:39
Controller: Many controllers

Re: New API Commands

Postby hermd » 15 Feb 2016, 18:31

1. Which command can I use to move a single axis. I was using SendMovePosAxis() but it no long exist.

2. Also the SendMovePosEx() now has an additional posFrom parameter. I want to move from the current position (which I don't keep track of) to the posTo position. How do I use the posFrom parameter.
hermd
 
Posts: 8
Joined: 20 Feb 2014, 14:05
Controller: Mk2/4

Re: New API Commands

Postby NXTwoThou » 26 Sep 2016, 17:13

Any reply to this yet? I just started playing with the API today(2.10.1607.101) and was looking for the same function. I got around it by creating this but it seems like I'm missing something since previous posts reference the function.

Code: Select all
private void SendMoveAxis(PlanetCNC.API.AxisEnum axis, double value, double speed)
        {
            if ((cnc != null) && (cnc.BufferFree > 10))
            {
                if (double.IsNaN(speed))
                {
                    speed = cnc.Speed; // whatever current speed is
                    // cnc.FeedSpeed;
                    // cnc.TraverseSpeed;                   
                }
                Coord newPos = new Coord();
                newPos.CopyFrom(cnc.Position);
                if (axis == PlanetCNC.API.AxisEnum.X)
                    newPos.X = value;
                else if (axis == PlanetCNC.API.AxisEnum.Y)
                    newPos.Y = value;
                else if (axis == PlanetCNC.API.AxisEnum.Z)
                    newPos.Z = value;
                else if (axis == PlanetCNC.API.AxisEnum.A)
                    newPos.A = value;
                else if (axis == PlanetCNC.API.AxisEnum.B)
                    newPos.B = value;
                else if (axis == PlanetCNC.API.AxisEnum.C)
                    newPos.C = value;
                else if (axis == PlanetCNC.API.AxisEnum.U)
                    newPos.U = value;
                else if (axis == PlanetCNC.API.AxisEnum.V)
                    newPos.V = value;
                else if (axis == PlanetCNC.API.AxisEnum.W)
                    newPos.W = value;
                else
                {
                    MessageBox.Show("I'm sorry, I don't understand that axis value.  Are you sure you sent a single axis?(ABCXYZUVW)");
                    return;
                }
                cnc.SendMovePos(cnc.Position, newPos, speed);
            }
        }
NXTwoThou
 
Posts: 7
Joined: 22 Sep 2016, 21:18
Controller: None


Return to API



Who is online

Users browsing this forum: No registered users and 1 guest