Examples; Python Script - Newport MKS HXP Series Command Interface Manual

Hexapod motion controller
Table of Contents

Advertisement

HXP
3.0

Examples

EDH0318En1042 — 12/18
3.1

Python Script

#========================================================================
=
# Newport Proprietary and Confidential
#
# No part of this file in any format, with or without modification
# shall be used, copied or distributed without the express written
# consent of Newport Corporation.
#
# Description: This is a sample Python Script to illustrate how to
execute
# "query" commands.
#========================================================================
#========================================================================
#Initialization Start The script within Initialization Start and
#Initialization End is needed for #properly
#Command Interface DLL for HXP #instrument. The user should copy this
code as
#is and specify correct paths here.
import
sys
import
time
#Command Interface DLL can be found here.
sys.path.append(r'C:\Program Files
# The CLR module provide functions for interacting with the underlying
# .NET runtime
import
clr
# Add reference to assembly and import names from namespace (IronPython)
clr.AddReferenceToFile("Newport.HXP.CommandInterface.dll")
from
CommandInterface HXP
import
System
#========================================================================
# Instrument Initialization
# The key should have double slashes since
# (one of them is escape character)
address="192.168.33.3"
port=5001
# Create an HXP instance
hxp = HXP()
print
'--------------- General data ---------------'
# Connect and open a socket
result = hxp. OpenInstrument(address, port, 1000)
if
result ==
print
'Connection
else:
print
'Connection
# Get controller revision information
result, response, errString = hxp.FirmwareVersionGet()
if
result == 0 :
print
'Controller version:
else:
print
'Error=>',errString
import
*
0
:
', address, ":", port,
', address, ":", port,
', response
94
Command Interface Manual
Newport Corporation 2011
(x86)\Newport\MotionControl\HXP\Bin')
" => Successful"
" => failure
", result

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the MKS HXP Series and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Mks hxp100-elec

Table of Contents