<filename>example/imm_interface/run_emi_interface.py
#--------------------------------------------------------------------
#Module Description
#--------------------------------------------------------------------
"""
Example to communicate with EMI as a normal python script.
This is an example how to use EMI
"""
#--------------------------------------------------------------------
# Administration Details
#--------------------------------------------------------------------
__author__ = "<NAME>"
__copyright__ = "2020 [NTNU Gjøvik and SINTEF Manufacturing]"
__credits__ = ["<NAME>"]
__license__ = "MIT"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__status__ = "Development"
__date__ = "30032020"
__version__ = "1.0"
#--------------------------------------------------------------------
#Import
#--------------------------------------------------------------------
import imm
#--------------------------------------------------------------------
#CONSTANTS
#--------------------------------------------------------------------
#Parameters settings for config EMI
NAME = 'EMI'
IP = '172.16.10.39'
PORT = 10050
USERNAME = 'name'
PASSW = '<PASSWORD>'
uri_shotcounter = 'cc300://imm/cm#//c.ShotCounter/p.sv_iShotCounter/v'
#--------------------------------------------------------------------
#METHODS
#--------------------------------------------------------------------
if __name__ ==  "__main__":
    '''
    Testing this module by connecting to the machine and perform several methods
    '''
    #Create EMI_INTERFACE
    e = imm.EMI_Interface(name=NAME,
                          ip=IP,
                          port=PORT,
                          username=USERNAME,
                          passw=PASSW,
                          debug=True
                          )
    # Connect to machine
    if e.connect() == False:       # Connect to IMM
        print('Did not connect correctly')
        sys.exit()
    e.logout()        # First logout and then login
    e.login()         # Login

    # Get parameter
    param = e.get_param_value(uri_shotcounter)
    print('Get Shot Counter : %s' %param)

    # Logout
    e.logout()

    # Close emi
    e.close()
    del e

<filename>example/imm_interface/run_emi_interface.py
#--------------------------------------------------------------------
#Module Description
#--------------------------------------------------------------------
"""
Example to communicate with EMI as a normal python script.
This is an example how to use EMI
"""
#--------------------------------------------------------------------
# Administration Details
#--------------------------------------------------------------------
__author__ = "<NAME>"
__copyright__ = "2020 [NTNU Gjøvik and SINTEF Manufacturing]"
__credits__ = ["<NAME>"]
__license__ = "MIT"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__status__ = "Development"
__date__ = "30032020"
__version__ = "1.0"
#--------------------------------------------------------------------
#Import
#--------------------------------------------------------------------
import imm
#--------------------------------------------------------------------
#CONSTANTS
#--------------------------------------------------------------------
#Parameters settings for config EMI
NAME = 'EMI'
IP = '172.16.10.39'
PORT = 10050
USERNAME = 'name'
PASSW = '<PASSWORD>'
uri_shotcounter = 'cc300://imm/cm#//c.ShotCounter/p.sv_iShotCounter/v'
#--------------------------------------------------------------------
#METHODS
#--------------------------------------------------------------------
if __name__ ==  "__main__":
    '''
    Testing this module by connecting to the machine and perform several methods
    '''
    #Create EMI_INTERFACE
    e = imm.EMI_Interface(name=NAME,
                          ip=IP,
                          port=PORT,
                          username=USERNAME,
                          passw=PASSW,
                          debug=True
                          )
    # Connect to machine
    if e.connect() == False:       # Connect to IMM
        print('Did not connect correctly')
        sys.exit()
    e.logout()        # First logout and then login
    e.login()         # Login

    # Get parameter
    param = e.get_param_value(uri_shotcounter)
    print('Get Shot Counter : %s' %param)

    # Logout
    e.logout()

    # Close emi
    e.close()
    del e

#-------------------------------------------------------------------- #Module Description #-------------------------------------------------------------------- Example to communicate with EMI as a normal python script.
 This is an example how to use EMI #-------------------------------------------------------------------- # Administration Details #-------------------------------------------------------------------- #-------------------------------------------------------------------- #Import #-------------------------------------------------------------------- #-------------------------------------------------------------------- #CONSTANTS #-------------------------------------------------------------------- #Parameters settings for config EMI #//c.ShotCounter/p.sv_iShotCounter/v' #-------------------------------------------------------------------- #METHODS #-------------------------------------------------------------------- Testing this module by connecting to the machine and perform several methods #Create EMI_INTERFACE # Connect to machine # Connect to IMM # First logout and then login # Login # Get parameter # Logout # Close emi