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.

For situations where a script is constantly running - such as polling a data source for new information every few minutes - you can use the GS Console Manager module to launch and/or monitor the progress of such scripts.

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

 

Syntax

Example

Description/Remarks

New or changed in GainSeeker version

mtconnect.current()

current = mtconnect.current()

Returns the current value of the Data Item ID(s)specified by mtconnect.dataitemid.

  • If mtconnect.dataitemid is set to a string, mtconnect.current() will return a single value.

  • If mtconnect.dataitemid is set to a list, mtconnect.current() will return a list of values.

9.1

mtconnect.dataitemid

mtconnect.dataitemid = "x2"

 

mtconnect.dataitemid = ["x2", "y2", "xpos", "ypos"]

Gets/Sets the Data Item ID name(s) to target on the device.

You can set this to a string or a list of strings.

9.1

mtconnect.deviceuuid

mtconnect.deviceuuid = "000"

Gets/Sets the Device UUID to target from the agent.

 

mtconnect.sample(maxitems)

samplelist = mtconnect.sample(5)

Deprecated - use mtconnect.current() instead.

9.1

mtconnect.setaddress(address, port)

mtconnect.setaddress("http://mtconnect.mazakcorp.com", 5609)

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