Python command: MTConnect

The MTConnect commands in Pythonâ„¢ allow you to interface with MTConnect agents.

The MTConnect Action can generate a Python script for basic data collection from an MTConnect agent.

See Python commands for other commands you can use with GainSeeker.

 

Syntax

Example

Description/Remarks

mtconnect.current()

current = mtconnect.current()

Returns the current value of the DataItem.

mtconnect.dataitemid

mtconnect.dataitemid = "x2"

Gets/Sets the ID of the DataItem to target on the device.

mtconnect.deviceuuid

mtconnect.deviceuuid = "000"

Gets/Sets the uuid of the device to target from the agent.

mtconnect.sample(maxitems)

samplelist = mtconnect.sample(5)

Returns a list of values for a DataItem up to the maxitem amount.

mtconnect.setaddress(address, port)

mtconnect.setaddress("agent.mtconnect.org", 80)

Sets the address and port of the MTConnect agent to connect to.