- Install Python interpreter (we use version 2.5)
- Install PythonWin extension
- Run script from VSPE install folder or copy necessary files to the application folder
- Install PythonWin extension
import msvcrt
import VSPE_Python
config_file_path = '1.vspe'
activationKey = '';
print VSPE_Python.vspe_getVersionInformation()
result = VSPE_Python.vspe_activate(activationKey)
if result == False:
print 'VSPE API activation error'
exit(1)
result = VSPE_Python.vspe_initialize()
if result == False:
print 'Initialization error'
exit(1)
result = VSPE_Python.vspe_stopEmulation()
if result == False:
print 'Error: emulation can not be stopped: maybe one of VSPE devices is still used.'
exit(1)
deviceId = VSPE_Python.vspe_createDevice("Connector", "9;0");
if deviceId == -1:
print 'Error: can not create device'
VSPE_Python.vspe_release()
exit(1)
result = VSPE_Python.vspe_saveConfiguration(config_file_path)
if result == False:
print 'Error: can not save configuration'
VSPE_Python.vspe_release()
exit(1)
result = VSPE_Python.vspe_loadConfiguration(config_file_path)
if result == False:
print 'Error: can not load configuration'
VSPE_Python.vspe_release()
exit(1)
result = VSPE_Python.vspe_startEmulation()
if result == False:
print 'Error: can not start emulation'
VSPE_Python.vspe_release()
exit(1)
print 'Press any key to quit'
msvcrt.getch()
result = VSPE_Python.vspe_stopEmulation()
if result == False:
print 'Error: emulation can not be stopped: maybe one of VSPE devices is still used.'
exit(1)
VSPE_Python.vspe_release()
exit(0)
import win32com.client
import msvcrt
vspe = win32com.client.Dispatch("VSPE.VSPEApi")
activationKey = '';
print vspe.vspe_getVersionInformation()
vspe.vspe_activate(activationKey)
vspe.vspe_initialize()
vspe.vspe_createDevice('Connector','9;0')
vspe.vspe_createDevice('Splitter','10;9;0;19200,0,8,1,0,0;0;0;0')
vspe.vspe_createDevice('Pair','21;22;0')
vspe.vspe_startEmulation()
print 'Press any key to quit'
msvcrt.getch()
vspe.vspe_stopEmulation()
vspe.vspe_release()