Application Programming Interface: Low-Level Sockets for MachineMotion

Prev Next

Cover image of technical document

This document details the commands that can be sent to your MachineMotion V2 using Ethernet TCP/IP protocol. It is supported on MachineMotion software version v2.3.0 This API uses sockets to exchange data. All information is packaged in string format and sent over the socket communication channel to port 9999 of the ethernet IP Address.

For details on previous releases of Vention’s Low-Level Socket Programming Interface with MachineMotion 2 and MachineMotion 1, refer to the ‘Documentation for Previous Releases’ section at the end of this document.

There are three physical ethernet connections available on the MachineMotion V2. The default ethernet port (labeled “To PC”) will always have an IP address of 192.168.7.2. The second and third ethernet ports (labeled “LAN 1” and “LAN 2”) may have a user configurable IP address. The configurable IP address can be set in one of three ways:

  • Using a laptop and chrome web browser, navigate to 192.168.7.2, select the network configuration tab and enter the desired IP address.

  • Using a laptop and the low level socket API, send the “ethernet configuration commands” to set the desired static IP commands.

  • Use a pendant to connect to the Machine Motion control center, select the network configuration tab and enter the desired IP address.

A connection must be opened before any commands can be sent or received from the MachineMotion V2 ethernet port. How to open a connection will depend on the programming language being used. Once the connection is open, the MachineMotion V2 will respond with “MachineMotion connection established”. It is recommended the first command sent is isReady to confirm a properly established connection.

User Agent

Direction

MachineMotion

Initialize TCP Connection

Accept

Receive

Send: MachineMotion connection established

Send: isReady;

Receive

Receive

Send: MachineMotion isReady=true;

Continuous Move

Moves a conveyor or rotary table axis continuously at a given speed and acceleration. This command is only available with MachineMotion software v1.16 and newer.

SET im_conv_<axis> S<speed> A<acceleration>; Where <axis> is the axis (1, 2, 3 or 4) to move as a (String). Where <speed> is the speed to move the axis in mm/sec as a (String). Where <acceleration> is the acceleration to move the axis in mm/sec^2 as a (String).

SET im_conv_3 S100 A400; Starts moving axis 3 at 100 mm/sec with an acceleration of 400 mm/sec^2. SET im_conv_3 S0 A400; Stops axis 3 using 400 mm/sec^2 deceleration.

Ack

Delayed Absolute Move

Moves an axis to the specified absolute position after the de_move_abs_exec command is sent.

SET de_move_abs_<axis>/<value>/; Where <axis> is the axis to move (1, 2 or 3) as a (String). Where <value> (String) is a position in mm.

SET de_move_abs_1/50/ Will move axis 1 to absolute position 50mm after the de_move_abs_exec command is sent.  SET de_move_abs_2/150/; Will move axis 2 to absolute position 150mm after the de_move_abs_exec command is sent.  SET de_move_abs_3/175/ Will move axis 3 to absolute position 175mm after the de_move_abs_exec command is sent.

Ack

Delayed Absolute Move Execute

Executes the latest de_move_abs_1, de_move_abs_2 and de_move_abs_3 commands simultaneously.

de_move_abs_exec;

de_move_abs_exec;

Ack

Delayed Relative Move

Move an axis relative to the its current position by the distance specified in the distance parameter after the command de_move_abs_exec is sent.

SET de_move_rel_<axis>/<value>/; Where <axis> is the axis to move (1, 2 or 3) as a (String). Where <value> (String<!--<mark-->) is a position change in mm.

SET de_move_rel_1/-50/; Will move axis 1, 50 mm in the negative direction after the de_move_rel_exec command is sent.  SET de_move_rel_2/100/; Will move axis 2, 100 mm in the positive direction after the de_move_rel_exec command is sent.  SET de_move_rel_3/-75/; Will move axis 3, 75 mm in the negative direction after the de_move_rel_exec command is sent.

Ack

Delayed Relative Move Execute

Executes the latest de_move_rel_1, de_move_rel_2 and de_move_rel_3 commands simultaneously.

de_move_rel_exec;

de_move_rel_exec;

Ack

Get Position

Queries the current position of an axis.

GET im_get_controller_pos_axis_<axis>; Where <axis> is the axis to get position from (1, 2 or 3) as a (String)

GET im_get_controller_pos_axis_1 Returns position of axis 1.  GET im_get_controller_pos_axis_2 Returns position of axis 2.  GET im_get_controller_pos_axis_3 Returns position of axis 3.

(<> Where  is the position in mm units. is="" the="" position="" in="" mm=""> is the position in mm units.>

Immediate Absolute Move

Moves an axis to the specified absolute position.

SET im_move_abs_<axis>/<value>/; Where <axis> is the axis to move (1, 2 or 3) as a (String). Where <value> (String) is a position in mm.

SET im_move_abs_1/50/; Immediately Moves axis 1 to absolute position 50mm  SET im_move_abs_2/100/; Immediately Moves axis 2 to absolute position 100mm  SET im_move_abs_3/200/; Immediately Moves axis 3 to absolute position 200mm

Ack

Immediate Home All

Returns all axes to their home locations sequentially: first axis 1, then axis 2, then axis 3.

im_home_axis_all;

im_home_axis_all;

MachineMotion im_home_axis_all = completed

Immediate Home Axis

Returns an axis to its home location.

im_home_axis_<axis>; Where <axis> is the axis to home (1, 2 or 3) as a (String)

im_home_axis_1; Immediately Homes axis 1  im_home_axis_2; Immediately Homes axis 2  im_home_axis_3; Immediately Homes axis 3.

MachineMotion im_home_axis_<axis> = completed Where <axis> is the axis requested to home.

Immediate Relative Move

Immediately moves an axis by the distance specified relative to the current location of the axis. The distance parameter can be negative.

SET im_move_rel_<axis>/<value>/; Where <axis> is the axis to move (1, 2 or 3) as a (String) Where <value> is a position value in mm as a (String)

SET im_move_rel_1/50/; Immediately Moves axis 1, 50mm in the positive direction from its current position.  SET im_move_rel_2/-100/; Immediately Moves axis 2, 100mm in the negative direction from its current position.  SET im_move_rel_3/200/; Immediately Moves axis 3, 200mm in the positive direction from its current position.

Ack

Immediate Stop

Immediately stops motion on all axes.

im_stop;

im_stop;

MachineMotion im_stop = complete

is Motion Completed

Queries MachineMotion to determine if motion is currently being executed. This function is useful for waiting for the completion of a movement.

isMotionCompleted;

isMotionCompleted;

MachineMotion isMotionCompleted = true or MachineMotion isMotionCompleted = false

is Ready

Queries MachineMotion to know if it is ready to receive commands. This function indicates if the MachineMotion system is initialized and ready for operation after a connection event.

isReady;

isReady;

MachineMotion is Ready = true

Move to Closest Angle

Moves a rotary table axis to a given angle without making a full rotation. This makes it easier to move the axis after multiple full rotations. The axis will take the shortest path to the new position. This command is only available with MachineMotion software v1.16 and newer.

moveToClosestAngle/<axis>/<position>/request; Where <axis> is the axis (1, 2 or 3) to move as a (String). Where <position> is the angle command in degrees as a (String).

moveToClosestAngle/2/45/request; Moves axis 2 to the 45 degree position. For example, if the axis was previously at 365 degrees, it would move to 405 degrees after this command. This differs from the absolute move command, which would move the axis from 365 degrees to 45 degrees.

Ack moveToClosestAngle/<axis>/<position>/request Where <axis> is the requested axis to move. Where <position> is the requested angle (in degrees).

Read Digital Input

Reads a digital input from a Digital IO Module. This command is only available with MachineMotion software v1.14_hotfix_200325 and newer.

io-expander/<module>/digital-input/<pin> Where <module> is the address (1 to 8) of the Digital IO Module (String). Where <pin> is the terminal on the Digital IO Module (0, 1, 2 or 3) as a (String).

io-expander/2/digital-input/0; Returns the current state of pin 0 on the Digital IO Module with address 2.

io-expander/<module>/digital-input/<pin> <value>

Where <value> will be 0 or 1

Read E-Stop Status

Reads the current status of the e-stop. This command is only available with MachineMotion software v1.14_hotfix_200325 and newer.

estop/status;

estop/status;

estop/status true When e-stop is engaged.  false When e-stop is not engaged.

Read Push Button

Read Push-Button for module [1-8]. Button 0 is the black button, button 1 is white

push-button/<module>/digital-input/<button>;

push-button/2/digital-input/0;

push-button/<module>/digital-input/<button> <pushed|released>

Release E-Stop

Releases software generated e-stop. It must be followed by a estop/systemreset/request command. This command is only available with MachineMotion software v1.14_hotfix_200325 and newer.

estop/release/request;

estop/release/request;

Ack estop/release/request;

Set All Axes Acceleration

Configures the travel acceleration of the system in mm/min^2. For single-axis movements, the travel acceleration of the axis will be equal to this setting. For multi-axis synchronous moves, the overall motion acceleration will be equal to this setting.

SET acceleration/<value>/; Where <value> is an acceleration value in mm/min^2 as a (String)

SET acceleration/100/; Sets acceleration for all axes to 100mm /min^2

Ack

Set All Axes Speed

Configures the travel speed of the system in mm/minute. For single-axis movements, the travel speed of the axis will be equal to this setting. For multi-axis synchronous moves, the overall motion speed will be equal to this setting.

SET speed/<value>/; Where <value> is a position value in mm/minute as a (String)

SET speed/300/; Sets speed for all axes to 300 mm/minute

Ack

Set Position

Sets the current position of an axis to a new value (mm).

SET im_set_controller_pos_axis_<axis>/<value>/; Where <axis> is the axis to set position (1, 2 or 3) as a (String). Where <value> (String) is a position in mm.

SET im_set_controller_pos_axis_1/0/; Sets the current location of axis 1 as position 0 mm  SET im_set_controller_pos_axis_2/0/; Sets the current location of axis 2 as position 0 mm  SET im_set_controller_pos_axis_3/0/; Sets the current location of axis 3 as position 0 mm

Ack

Set Power Switch

Write a state (on or off) to a power switch module

power-switch/<module>/digital-output/<"on"|"off">;

power-switch/3/digital-output/"off"

power-switch/3/digital-output/"off"

System Reset

Resets the system, this must be done after all e-stop event. This command is only available with MachineMotion software v1.14_hotfix_200325 and newer.

estop/systemreset/request;

estop/systemreset/request;

Ack estop/release/request;

Trigger E-Stop

Sets the e-stop. This command is only available with MachineMotion software v1.14_hotfix_200325 and newer.

estop/trigger/request;

estop/trigger/request;

Ack estop/trigger/request;

Brake Status

Request the status of a desired brake

brakeStatus/<axis>; Where <axis> is the drive number of the relevant brake

brake <axis> locked or brake <axis> unlocked

Unlock Brake

Requests that the brake of the desired drive be ulocked

brake/<axis>/unlock; Where <axis> is the drive number of the brake to be unlocked.

Ack

Lock Brake

Requests that the brake of the desired drive be locked

brake/<axis>/lock; Where <axis> is the drive number of the brake to be locked.

Ack

Wait On Push Button

Wait for a button [0-1] on module [1-8] to achieve a certain state [pushed or released]. Button 0 is the black button, button 1 is white

push-button/<module>/wait-on/<button>/<pushed|released>;

push-button/2/wait-on/0/pushed;

push-button/<module>/digital-input/<button> <pushed|released>

Write Digital Output

Writes a digital output to a Digital IO Module. This command is only available with MachineMotion software v1.14_hotfix_200325 and newer.

io-expander/<module>/digital-output/<pin> <value>; Where <module> is the address (1 to 8) of the Digital IO Module (String). Where <pin> is the terminal on the Digital IO Module (0, 1, 2 or 3) as a (String). Where <value> is the desired state of the output (0 = 0V, 1 = 24V) as a (String).

io-expander/3/digital-output/2 1; Sets state of pin 2 to the value of 1 on the Digital IO Module with address 3.

Ack io-expander/<module>/digital-outut/<pin>

Application Programming Interface: Low-Level Sockets for MachineMotion V2

Application Programming Interface: Low-Level Sockets for MachineMotion V1