Documentation Home Page HYPERSIM Home Page
Pour la documentation en FRANÇAIS, utilisez l'outil de traduction de votre navigateur Chrome, Edge ou Safari. Voir un exemple.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Below is the list of commands for the HYPERSIM® API (windows).

Commands are accessible through HyWorksApi.”command”.

General

closeHyperWorks():

Close HYPERSIM

connectToHyWorks(host=socket.gethostname(), register=getpass.getuser(), timeout=120000, index=1):

Connect HyJavaApi to HYPERSIM

Parameters

  • host (str): computer name
  • register (str): user name
  • timeout (int): timeout for function
  • index (int): Hyworks index to register to

Returns error value

Return type int

Raises AssertionError: raises exception on error

disableHyWorksApiExceptions():

Disable HyWorksApi from returning HYPERSIM exceptions through Python

disableScopeViewscopeview_ApiExceptions ():

Disable HyWorksApi from returning ScopeView exceptions through Python

enableHyWorksApiExceptions():

Enable HyWorksApi to return HYPERSIM exceptions through Python

enableScopeViewscopeview_ApiExceptions():

Enable HyWorksApi to return ScopeView exceptions through Python

getProperty(key):

Get HYPERSIM property

Parameters :

  • key(str): property key

Returns HYPERSIM property

Return type str

Raises AssertionError: raises exception on error

Examples:

  • HyWorksApi.getProperty("hyworks.hysim.extraTimeout")

getProperties():

Get current HYPERSIM properties

Returns HYPERSIM properties

Return type str

setProperty(key, value, save=False):

Set HYPERSIM general property

Parameters :

  • key(str): property key
  • value(str): property value
  • save(bool): save preferences for the next session

Returns error value

Return type bool

Raises AssertionError: raises exception on error

Examples:

  • HyWorksApi.setProperty("hyworks.hysim.extraTimeout", "1200000")
  • HyWorksApi.setProperty("hyworks.hysim.extraTimeout", "1800000", True)

startAndConnectHypersim(host=socket.gethostname(), register=getpass.getuser(), stdout=None, stderr=None, timeout=2500):

Open and connect HyJavaApi to HYPERSIM

Parameters

  • host (str): computer name
  • register (str): user name
  • stdout: standard output
  • stderr: standard error
  • timeout (int): timeout for function

Returns error value

Return type int

Raises AssertionError: raises exception on error

startHyperWorks(stdout=None, stderr=None):

Start HYPERSIM

Parameters

  • stdout: standard output
  • stderr: standard error

Design

closeDesign(designPath):

Close design

Parameters designPath (str): path to the HYPERSIM model (.ecf)

Returns error value

Return type int

Raises AssertionError: raises exception on error

disconnectDesign(designPath):

Disconnect HyWorksApi from the HYPERSIM model

Parameters designPath (str): path to the HYPERSIM model (.ecf)

Returns error value

Return type int

Raises AssertionError: raises exception on error

displayConnections():

Print component interconnections to STDOUT

Returns error value

Return type int

Raises AssertionError: raises exception on error

getDesignPrefs():

Get current model preferences

Returns model preferences

Return type str

importEDD(eddFilePath, doConnections):

Import EDD to current HYPERSIM model

Parameters

  • eddFilePath (str): path to EDD (.edd)
  • doConnections (bool): connect imported devices

Returns error value

Return type int

Raises AssertionError: raises exception on error

newDesign(designFilePath=None):

Create new HYPERSIM model

Parameters designFilePath (str): path to the HYPERSIM model (.ecf)

Returns error value

Return type int

Raises AssertionError: raises exception on error

openDesign(designPath):

Open HYPERSIM model

Parameters designPath (str): path to HYPERSIM model (.ecf)

Returns error value

Return type int

Raises AssertionError: raises exception on error

recheckPorts():

Check connections by page connectors

Recommended after build circuits involving page connectors via API

Returns error value

Return type int

Raises AssertionError: raises exception on error

saveDesign():

Save current HYPERSIM model

Returns error value

Return type int

Raises AssertionError: raises exception on error

saveDesignAs(fileName):

Save current HYPERSIM model

Parameters fileName (str): desired model path

Returns error value

Return type int

Raises AssertionError: raises exception on error

updateEDD(eddFilePath, doConnections):

Update EDD

Parameters

  • eddFilePath (str): path to EDD (.edd)
  • doConnections (bool): connect imported devices

Returns error value

Return type int

Raises AssertionError: raises exception on error

Device

activateObservables(deviceName, observables):

Activate a list of observable pins on the device

Parameters

  • blocA (str): name of the first device
  • observables (list(str)) ; list of observable names. If list is empty, all observables are removed. Note that it does not append, but is the final list of observables.

Returns error value

Return type int

Raises AssertionError: raises exception on error

Examples

  • HyWorksApi.activateObservables('Imeas1', ['a', 'b'])
  • HyWorksApi.activateObservables('Imeas1', [])

addControlSignal(signalName, points, hitCheck = False, subcircuit=None):

Add a control signal to HYPERSIM model

Parameters

  • signalName(str): signal name
  • points(list(int)): list of points as X-Y coordinates
  • hitCheck(bool): true to check for connections to other signals at both ends of the line.
  • subcircuit (str) : subcircuit path

Returns unique signal name

Return type str

Example :

  • HyWorksApi.addControlSignal('signal1', [[-700, 0], [700, 0], [700, 700])

addBus1ph(signalName, points, hitCheck = False, subcircuit=None):

Add a 1 phase bus to HYPERSIM model.

Note : until connected to a power pin, a 1 phase bus is considered a control signal

Parameters

  • signalName(str): signal name
  • points(list(int)): list of points as X-Y coordinates
  • hitCheck(bool): true to check for connections to other signals at both ends of the line.
  • subcircuit (str) : subcircuit path

Returns unique signal name

Return type str

Example :

  • HyWorksApi.addBus1ph('myBus', [[-700, 0], [700, 0]])

addBus3ph(signalName, points, hitCheck = False, subcircuit=None):

Add a bus to HYPERSIM model

Parameters

  • signalName(str): signal name
  • points(list(int)): list of points as X-Y coordinates
  • hitCheck(bool): true to check for connections to other signals at both ends of the line.
  • subcircuit (str) : subcircuit path

Returns unique signal name

Return type str

Example :

  • HyWorksApi.addBus3ph('myBus', [[-700, 0], [700, 0]])

addDevice(libName, blocName, coordX=0, coordY=0, page=1, subcircuit=None, name=None):

Add device to HYPERSIM model

Parameters

  • libName (str): device library name
  • blocName (str): device name
  • coordX (int): X coordinate
  • coordY (int): Y coordinate
  • page (int): page number
  • subcircuit (str) : subcircuit path
  • name (str) : Name to assign to the device. If non, a default name will be assigned

Returns unique device name, reusable in the other APIs

Return type str

NOTE: The library name must include the .clf for this to work. Example: HyWorksApi.addDevice('Network RLC.clf', 'R grounded', 700, 700, 1)

Examples

  • HyWorksApi.addDevice('Network RLC.clf', 'R grounded', 700, 700)
  • HyWorksApi.addDevice('Network RLC.clf', 'R grounded', 700, 700, 1, "MySubCircuit", "Resistor1")

addPinsToDevice(name, cardinalPoint, function, pins, redraw=False):

Add pins, bundles, or pins inside bundles on a device

Parameters

  • name(str): device name
  • cardinalPoint(str): Location on the symbol of the device
  • function(str): The function of the listed pins. Input, Output or Power
  • pins(list[str]): List of pins
  • redraw (bool) : if True, the symbol will be redrawn with a default representation

Returns error value

Return type int

Raises AssertionError: raises exception on error

Examples

  • HyWorksApi.addPinsToDevice('SubCircuit1', 'N', 'I', ['in1'], True)
  • HyWorksApi.addPinsToDevice('SubCircuit7', 'S', 'P', ['pow1'], True)
  • HyWorksApi.addPinsToDevice('SubCircuit7', 'S', 'P', ['pow1'], True)
  • HyWorksApi.addPinsToDevice('SubCircuit1', 'W', 'O', ['Bundle1[o1]', 'Bundle1[o2]', 'Bundle1[o3]'], True)
    • And to make a sub circuit port connect with the sub circuit pins :
    • HyWorksApi.addPinsToDevice('SubCircuit1/SubCircuitPort', 'W', 'I', ['PORT[o1]', 'PORT[o2]', 'PORT[o3]')

connectBundleToBundle(blocA, signalListA, blocB, signalListB):

Connect two bundle pins together

Parameters

  • blocA (str): name of the first device
  • signalListA (list[str]): list of first bundle signals. ex: [‘a’,’b’,’c’]
  • blocB (str): name of the first pin
  • signalListB (list[str]): list of second bundle signals. ex: [‘a’,’b’,’c’]

Returns error value

Return type int

Raises AssertionError: raises exception on error

connectDevices(blocA, pinA, blocB, pinB, isThreePhaseAndPowerFlexible, signalName=None):

Connect two device pins

Parameters

  • blocA (str): name of the first device
  • pinA (str): name of the first pin
  • blocB (str): name of the second device
  • pinB (str): name of the second pin
  • isThreePhaseAndPowerFlexible (bool): make the connection 3 phase, for components which can be both 1 phase or 3 phases
  • signalName (str):  new signal name on the connection

Returns error value

Return type int

Raises AssertionError: raises exception on error

Examples

  • HyWorksApi.connectDevices('Max1', 'y', 'mySubCircuit', 'a1', False)
  • HyWorksApi.connectDevices('mySubCircuit/B1', 'a1', 'mySubCircuit/Gain1', 'u', False)

connectDeviceToControlSignal(deviceName, pinName, signalName):

Connects a device onto a control signal

Parameters

  • deviceName (str): device name
  • pinName (str): device pin name
  • signalName (str): signal name

Returns error value

Return type bool

Raises AssertionError: raises exception on error

Examples

  • HyWorksApi.connectDeviceToControlSignal('Const1', 'y', 's1')

connectDeviceToBus1ph(deviceName, pinName, signalName):

Connects a device onto 1 phase bus

Parameters

  • deviceName (str): device name
  • pinName (str): device pin name
  • signalName (str): signal name

Returns error value

Return type bool

Raises AssertionError: raises exception on error

Examples

  • HyWorksApi.connectDeviceToBus1ph('R1', 'net_1', 'myBus')
  • HyWorksApi.connectDeviceToBus1ph('SubCC1/SubSubCC1/R3', 'net_1', 'myBus')

connectDeviceToBus3ph(deviceName, pinName, signalName):

Connects a device onto 3 phase bus

Parameters

  • deviceName (str): device name
  • pinName (str): device pin name
  • signalName (str): signal name

Returns error value

Return type bool

Raises AssertionError: raises exception on error

Examples

  • HyWorksApi.connectDeviceToBus3ph('R1', 'net_1', 'myBus')
  • HyWorksApi.connectDeviceToBus3ph('SubCC1/SubSubCC1/R3', 'net_1', 'myBus')

connectPinToBundle(blocA, pinA, blocB, signalB):

Connect a pin to a bundle’s signal

Parameters

  • blocA (str): name of the first device
  • pinA (str): pin name
  • blocB (str): name of the second device
  • signalB (str): bundle signal name

Returns error value

Return type int

Raises AssertionError: raises exception on error

createSubCircuit(name, type=None, coordX=0, coordY=0, page=1):

Add device to HYPERSIM model

Parameters

  • name (str): subcircuit definition name
  • type(str): subcircuit type name. This name will show when redrawing the device
  • blocName (str): device name
  • coordX (int): X coordinate
  • coordY (int): Y coordinate
  • page (int): page number

Returns unique device name

Return type str

Examples

  • HyWorksApi.createSubCircuit('Subcircuit1', 700, 700, 1)
  • HyWorksApi.createSubCircuit('Subcircuit1', 'THD', 700, 700, 1)
  • HyWorksApi.createSubCircuit('DEV1/Subsubcircuit1')

disconnectPin(deviceName, pinName, removeAllConnections = False):

Disconnects the signal from a pin

Parameters

  • deviceName(str): device name
  • pinName(str): pinName
  • removeAllConnections(bool) : if True, also disconnects the pins of the connected devices, effectively removing completely the line connection of the design

Returns error value

Return type bool

Examples

  • HyWorksApi.disconnectPin('Cons1', 'y')
  • HyWorksApi.disconnectPin('RC1', 'net_1', True)

displayComponent(componentName=""):

(warning) This call requires an analyze call before to function properly

Print component information to STDOUT, including tunable parameter values, default values, parameter types and connectors By default shows all model components, but a specific component can be given as an argument

Parameters componentName (str): component name

Returns error value

Return type int

Raises AssertionError: raises exception on error

flipHorizontallyDevice(deviceName, keepConnections=True):

Flips a device horizontally

Parameters

  • deviceName (str): device name
  • keepConnections(bool): true if pin connections should be kept

Returns error value

Return type bool

Raises AssertionError: raises exception on error


Examples

  • HyWorksApi.flipHorizontallyDevice('R1')

flipVerticallyDevice(deviceName, keepConnections=True):

Flips a device vertically

Parameters

  • deviceName (str): device name
  • keepConnections(bool): true if pin connections should be kept

Returns error value

Return type bool

Raises AssertionError: raises exception on error


Examples

  • HyWorksApi.flipVerticallyDevice('R1')

getAllDevicesNames():

(warning) This call requires an analyze call before to function properly

Gets the list of all devices names

Returns the list of all visible devices

Return type list

Raises AssertionError: raises exception on error

getCoordinates(deviceName, pinName = None):

Retrieve a device or its pin X-Y coordinates

Parameters

  • deviceName(str): device name
  • pinName (str): pin name, can be non if only the position of the device is required

Returns a list of 2 int, representing the (X, Y) coordinates

Return type list

Raises AssertionError: raises exception on error

Examples

  • HyWorksApi.getCoordinates('R1')
  • HyWorksApi.getCoordinates('MTL', 'baseVolt)

getComponentParameter(compName, compParam):

(warning) This call requires an analyze call before to function properly

Retrieve component parameter value

Parameters

  • compName (str): component name
  • compParam (str): component parameter

Returns a list of 2 str, the first one being the value and the second one being the unit

Return type list

Raises AssertionError: raises exception on error

getDeviceBundleChildPins(deviceName, pinName):

Retrieve the list of all children pin names in a bundle pin of a device

Parameters

  • deviceName (str): device name
  • pinName (str): bundle pin  name

Returns the list of the sub-pin names

Return type list of strings

Raises AssertionError: raises exception on error

Examples

  • HyWorksApi.getDeviceBundleChildPins('AC1A_1', 'In')

getDeviceBundlePins(deviceName):

Retrieve the list of all pin names of type bundle on a device

Parameters

  • deviceName (str): device name

Returns error value

Return type list of strings

Raises AssertionError: raises exception on error

Examples

  • HyWorksApi.getDeviceBundlePins('AC1A_1')

importUCM(defFilePath):

Import UCM to current HYPERSIM model

Parameters defFilePath (str): path to UCM (. . . py: function: : )

Returns error value

Return type int

Raises AssertionError: raises exception on error

includeDevice(deviceName, include):

Include or exclude a device in HYPERSIM model

Parameters

  • deviceName (str): device name
  • include (bool): true if device should be included, false if excluded

Returns error value

Return type bool

Raises AssertionError: raises exception on error

removeDevice(deviceName):

Remove device from model

Parameters deviceName (str): device name

Returns error value

Return type int

Raises AssertionError: raises exception on error

renameDevice(oldDeviceName, newDeviceName):

Rename a device inside the model

Parameters

  • oldDeviceName (str): old device name
  • newDeviceName (str): new device name

Returns error value

Return type int

Raises AssertionError: raises exception on error

Examples

  • HyWorksApi.renameDevice('DEV1', 'SubCircuit1')
  • HyWorksApi.renameDevice('SubCircuit1/Gain1', 'SubCircuit1/factor')

renameSignal(oldName, newName, visible=True):

Rename all signals sharing a name inside the model

Parameters

  • oldName (str): old signal name
  • newName (str): new signal name
  • visible (bool) : if name should be visible on the design

Returns error value

Return type bool

Raises AssertionError: raises exception on error

rotateLeftDevice(deviceName, keepConnections=True):

Rotates a device to the left

Parameters

  • deviceName (str): device name
  • keepConnections(bool): true if pin connections should be kept

Returns error value

Return type bool

Raises AssertionError: raises exception on error


Examples

  • HyWorksApi.rotateLeftDevice('R1')

rotateRightDevice(deviceName, keepConnections=True):

Rotates a device to the right

Parameters

  • deviceName (str): device name
  • keepConnections(bool): true if pin connections should be kept

Returns error value

Return type bool

Raises AssertionError: raises exception on error


Examples

  • HyWorksApi.rotateRightDevice('R1')

setComponentParameter(compName, compParam, value):

(warning) This call requires an analyze call before to function properly

Set a component parameter to a certain value

Parameters

  • compName (str): component name
  • compParam (str): component parameter
  • value (str): component value

Returns error value

Return type int

Note : Please refer to Variables and Expressions to see how to set certain expressions via API.

Raises AssertionError: raises exception on error

setDeviceFillColor(name, colorHexRGB)

Set the fill color of the 2D shapes on a device symbol

Parameters

  • name(str): device name
  • colorHexRGB(str): RGB color in hex values

Returns error value

Return type int

Raises AssertionError: raises exception on error

Examples

  • HyWorksApi.setDeviceFillColor('Tr2', 'ff0000')

setDeviceLineColor(name, colorHexRGB)

Set the color of the line segments on a device symbol

Parameters

  • name(str): device name
  • colorHexRGB(str): RGB color in hex values

Returns error value

Return type int

Raises AssertionError: raises exception on error

Examples

  • HyWorksApi.setDeviceLineColor('Tr2', 'ff0000')

setSignalLineColor(name, colorHexRGB)

Set the line color of a signal

Parameters

  • name(str): device name
  • colorHexRGB(str): RGB color in hex values

Returns error value

Return type int

Raises AssertionError: raises exception on error

Examples

  • HyWorksApi.setSignalLineColor('WED7', 'ff0000')

setSignalLineWidth(name, width)

Set the line width of a signal

Parameters

  • name(str): device name
  • width(int): width

Returns error value

Return type int

Raises AssertionError: raises exception on error

Examples

  • HyWorksApi.setSignalLineWidth('WED7', 4)

setDevicesNameVisibility(deviceList, isVisible)

Hide/Show devices name in the model.

Parameters

  • deviceList(list[str]): list of devices name
  • isVisible(str): visibility

Returns error value

Return type int

Raises AssertionError: raises exception on error

Examples

  • HyWorksApi.setDevicesNameVisibility(['F18/CB4', 'F19/CB4', 'Dec1', 'Dec2', 'F1'], False)

setPinPhaseNumber(deviceName, pinName, value)

Forces a power flexible pin to take a specific amount of phase.

Normally, power flexible pins will use the same amount of phases for each power pin of the device. This call allows to disconnect this behaviour.

Parameters

  • deviceName(str): device name
  • pinName(str): pin name
  • value(int): 1 or 3

Returns error value

Return type int

Raises AssertionError: raises exception on error

updateUCM(deviceName):

Update UCM

Parameters deviceName (str): UCM name

Returns error value

Return type int

Raises AssertionError: raises exception on error

Sensor

editSensor(blocName, sensorName, IOType=None, IONumber=None, base=None, unit=None):

Edit device sensor

Parameters

  • blocName (str): device name
  • sensorName (str): sensor name
  • IOType (str): IO Type. ex: AD, DA, DI or DO
  • IONumber (int): IO number
  • base (float): base value
  • unit (str): unit value

Returns error value

Return type int

Raises AssertionError: raises exception on error

Examples

  • HyWorksApi.editSensor('R1', 'Ia', 1.0, 'pu', 'DA', 1001)
  • HyWorksApi.editSensor('R1', 'Ia', base = 1.0, unit = 'pu')
  • HyWorksApi.editSensor('R1', 'Ia', IOType = 'DA', IONumber = 1001)

getSensorInfo(blocName, sensorName, key):

Get value for the specified key on the specified sensor

Parameters

  • blocName (str): device name
  • sensorName (str): sensor name
  • blocName (str): key in sensor info. Supported keys :
    • 'selected'
    • 'userName'
    • 'userUnit'
    • 'iotype'
    • 'ionum'
    • 'iofactor'
    • 'base'
    • 'dataLoggerRecord'
    • 'dataLoggerGroup'
    • 'dataLoggerTrigger'
    • 'exchangerTag'
    • 'dataPointName'
    • 'dataPointIndex'

Return type str

loadSensors (filePath):

Load sensor file to current model

Parameters filePath (str): path to sensor file (.sig, .csv)

Returns error value

Return type bool

Raises AssertionError: raises exception on error

selectAllSensors(blocName):

Select all sensors for device

Parameters blocName (str): device name

Returns error value

Return type int

Raises AssertionError: raises exception on error

setSensorDataLogger(blocName, sensorName, record, groupName, trigger):

Set sensor parameter through datapoints

Parameters

  • blocName (str): device name
  • sensorName (str): sensor name
  • exchangerTag (bool): record signal
  • groupName(str): signal group name
  • trigger(bool): set signal as trigger for the group

Returns error value

Return type int

Raises AssertionError: raises exception on error

Examples

  • HyWorksApi.setSensorDataLogger('sine1', 'y', True, 'SIGNAL_GROUP_1', False)
  • HyWorksApi.setSensorDataLogger('sine2', 'y', True, 'SIGNAL_GROUP_2', True)
  • HyWorksApi.setSensorDataLogger('sine3', 'y', False, 'SIGNAL_GROUP_3', False)

setSensorDataPoint(blocName, sensorName, exchangerTag, dataPointName, dataPointIdx):

Set sensor parameter through datapoints

Parameters

  • blocName (str): device name
  • sensorName (str): sensor name
  • exchangerTag (str): exchanger tag
  • dataPointName (str): data point name
  • dataPointIdx(str): data point index

Returns error value

Return type int

Raises AssertionError: raises exception on error

Examples

  • HyWorksApi.setSensorDataPoint('Const_Amplitude', 'y, 'Signal Generator', 'Sine Waves/Sine Wave 1/Amplitude', '0')
  • HyWorksApi.setSensorDataPoint('Const_Frequency', 'y, 'Signal Generator', 'Sine Waves/Sine Wave 1/Frequency', '0')
  • HyWorksApi.setSensorDataPoint('Gain', 'u, 'Signal Generator', 'Sine Waves/Sine Wave 1/Output', '0')

selectAllSensors(blocName):

Select all sensors for device

Parameters blocName (str): device name

Returns error value

Return type int

Raises AssertionError: raises exception on error

selectSensor(blocName, sensorName, selected=True):

Select device sensor

Parameters

  • blocName (str): device name
  • sensorName (str): sensor name
  • selected (bool): selected

Returns error value

Return type int

Raises AssertionError: raises exception on error

Settings

analyze():

Analyse

Returns error value

Return type int

Raises AssertionError: raises exception on error

buildTopology():

Build topology

Returns error value

Return type int

clearCodeDir():

Clear code directory

Returns error value

Return type int

genCode():

Generate code

Returns error value

Return type int

Raises AssertionError: raises exception on error

getPreference(prefName):

Retrieve a model preference

Parameters prefName (str): preference name

Returns error value

Return type int

Raises AssertionError: raises exception on error

mapTask():

Map tasks

Returns error value

Return type int

Raises AssertionError: raises exception on error

setPreference(prefName, value):

Set a model preference to a specific value

Parameters

  • prefName (str): preference name
  • value (str): preference value

Returns error value

Return type int

Raises AssertionError: raises exception on error

setTarget(hostname, mode=None):

Set simulation target

Parameters

  • hostname (str): target IP
  • mode(str): simulation mode. Options
    • Offline (RTA): nrt_optimized
    • Offline (PMI) : nrt_mpi
    • Real-time : rt

Returns error value

Return type int

Raises AssertionError: raises exception on error

startLoadFlow():

Load flow

Returns error value

Return type int

Raises AssertionError: raises exception on error

Simulation

getMonitoringAllValues():

Get the current value of all monitors during simulation

Returns dictionary where the key is the monitor name, and the value is the current value

Return dict[str, str]

Raises AssertionError: raises exception on error

getMonitoringValue(monitorName):

Get the current value of a monitor during simulation

Parameters

  • monitorName (str): Name of the monitor

Returns value

Return type str

Raises AssertionError: raises exception on error

Examples

  • HyWorksApi.getMonitoringValue('MyMonitor1')

getLastSensorValues(sensorNames):

Get the last values of the list of sensors during simulation

Parameters

  • sensorNames (list[str]): Names of the sensors

Returns values in the same order as the sensor names

Return type list[float]

Raises AssertionError: raises exception on error

Examples

  • HyWorksApi.getLastSensorValues(['Const1.y', 'Subcircuit1/Gain1.u", '/Subcircuit1/R15.Ia"])

getSimulationTime():

Get the current simulation time, in the unit of the Point-On-Wave

Returns value

Return type float

Raises AssertionError: raises exception on error

loadSnapshot():

Loads a snapshot in the simulation

Returns error value

Return type int

Raises AssertionError: raises exception on error

resetMonitoring(cpuList):

Reset performance indicators and timings for simulation

Parameters cpuList (list[int]): list of cpu cores to reset. ex: [1, 2, 3, 4] Returns error value

Return type int

Raises AssertionError: raises exception on error

resetPerfIndic(cpuList):

Reset performance indicators for simulation

Parameters cpuList (list[int]): list of cpu cores to reset. ex: [1, 2, 3, 4] Returns error value

Return type int

Raises AssertionError: raises exception on error

resetTiming(cpuList):

Reset performance timing for simulation

Parameters cpuList (list[int]): list of cpu cores to reset. ex: [1, 2, 3, 4] Returns error value

Return type int

Raises AssertionError: raises exception on error

simtrig (sync):

Trig the programmable devices in the simulation

Parameters sync (bool): synchronize with POW

Returns error value

Return type bool

Raises AssertionError: raises exception on error

startMonitoring():

Start monitoring

Returns error value

Return type int

Raises AssertionError: raises exception on error

startSim():

Start simulation

Returns error value

Return type int

Raises AssertionError: raises exception on error

stopMonitoring():

Stop monitoring

Returns error value

Return type int

Raises AssertionError: raises exception on error

stopSim():

Stop simulation

Returns error value

Return type int

Raises AssertionError: raises exception on error

takeSnapshot():

Takes a snapshot of the simulation

Returns error value

Return type int

Raises AssertionError: raises exception on error

Target

addTargetToManager(targetHostName):

Add target to HYPERSIM target manager

Parameters targetHostName (str): target IP

Returns error value

Return type int

Raises AssertionError: raises exception on error

diagnosticTarget(targetHostName):

Prints a diagnostic report of the target configuration. More information on Target Manager

Parameters targetHostName (str): target IP

Returns diagnostic report on the target

Return type str

getAllTargetsName():

Get all known targets by HYPERSIM target manager : return: list of all known targets : rtype: str

getCurrentVersionOnTarget(targetHostName):

Get current HYPERSIM version on target

Parameters targetHostName (str): target IP

Returns HYPERSIM version

Return type str

getInstalledVersionOnTarget(targetHostName):

Get all HYPERSIM versions installed on target

Parameters targetHostName (str): target IP

Returns list of all HYPERSIM versions

Return type str

installHypersimOnTarget(targetHostName, rpmPath):

Install HYPERSIM version on target

Parameters

  • targetHostName (str): target IP
  • rpmPath (str): path to target rpm file

Returns error value

Return type int

Raises AssertionError: raises exception on error

installHypersimOnTarget(targetHostName):

Install HYPERSIM version on target

Parameters targetHostName (str): target IP

Returns error value

Return type int

Raises AssertionError: raises exception on error

isTargetReady(targetHostName):

Determine if target is ready for simulation

Parameters targetHostName (str): target IP

Returns ready status

Return type bool

removeTargetFromManager(targetHostName):

Remove target from HYPERSIM target manager

Parameters targetHostName (str): target IP

Returns error value

Return type int

Raises AssertionError: raises exception on error

switchVersionOnTarget(targetHostName, switchToVersion):

Switch HYPERSIM versions on target

Parameters

  • targetHostName (str): target IP
  • switchToVersion (str): HYPERSIM version to switch to

Returns error value

Return type int

Raises AssertionError: raises exception on error

ScopeView Commands

The following commands are used to interact with ScopeView and are accessible through HyJavaApi.”command”.

ScopeViewApi can also be accessed without HyWorksApi, ScopeViewApi python module is located in C: \OPAL-RT\HYPERSIM\hypersim-version\Windows\ScopeView\lib

To use ScopeViewApi without HyWorksApi, add the path above to System PythonPath and use the following command:

import ScopeViewApi as ScopeView


General

ScopeView.close():

Close ScopeView

Returns error value

Return type int

Raises AssertionError: raises exception on error

ScopeView.connectToScopeViewRemote():

Connect to the first instance of ScopeView

Returns error value

Return type int

Raises AssertionError: raises exception on error

ScopeView.disableScopeViewApiExceptions():

Disable ScopeViewApi from returning ScopeView exceptions through Python

ScopeView.enableScopeViewApiExceptions():

Enable ScopeViewApi to return ScopeView exceptions through Python

ScopeView.initScopeViewApi():

Initializes ScopeView VM with necessary arguments

ScopeView.openScopeView():

Open ScopeView note: ScopeView location is relative to HYPERSIM_DIR variable

Returns process ID

Return type int

Acquisition

ScopeView.exportToPDF(filePath):

Export ScopeView graphs to PDF at provided file location

Parameters filePath (str): path to export PDF

Returns error value

Return type int

Raises AssertionError: raises exception on error

ScopeView.exportToFile(filePath):

Export ScopeView data source to desired format at provided file location

Parameters filePath (str): path to export file

Returns error value

Return type int

Raises AssertionError: raises exception on error

ScopeView.evalAllExpressions():

Evaluate all ScopeView expressions from template

Returns error value

Return type int

Raises AssertionError: raises exception on error

ScopeView.getCont():

Get ScopeView cont state

Returns cont state

Return type str

ScopeView.getExpressions():

Gets all ScopeView expressions from template

ScopeView.getNumAcq():

Get number of ScopeView acquisitions

Returns number of acquisitions

Return type str

ScopeView.getNumData():

Get number of ScopeView data

Returns number of data

Return type str

ScopeView.getSamplingRate():

Get ScopeView acquisition sample rate

Returns sample rate

Return type str

ScopeView.getStartTime():

Get ScopeView acquisition start time

Returns start time

Return type str

ScopeView.getTimeLength():

Get ScopeView acquisition duration

Returns time length

Return type str

ScopeView.startAcquisition():

Start ScopeView acquisition

ScopeView.stopAcquisition():

Stop ScopeView acquisition

ScopeView.pauseAcquisition():

Pause ScopeView acquisition


ScopeView.setCont(state):

Set ScopeView cont option

Parameters state (bool): cont state

Returns error value

Return type int

Raises AssertionError: raises exception on error

ScopeView.setNumAcq(numAcq):

Set number of ScopeView acquisitions

Parameters nbAcq (int): number of acquisition

Returns error value

Return type int

Raises AssertionError: raises exception on error

ScopeView.setSamplingRate(rate):

Set ScopeView acquisition sample rate

Parameters rate (float): acquisition sample rate (seconds)

Returns error value

Return type int

Raises AssertionError: raises exception on error

ScopeView.setStartTime(time):

Set ScopeView acquisition start time

Parameters time (float): time to start acquisition (seconds)

Returns error value

Return type int

Raises AssertionError: raises exception on error

ScopeView.setTimeLength(time):

Set ScopeView acquisition duration

Parameters time (float): acquisition duration (seconds)

Returns error value

Return type int

Raises AssertionError: raises exception on error

ScopeView.setSync(state):

Set ScopeView sync option

Parameters state (bool): sync state

Returns error value

Return type int

Raises AssertionError: raises exception on error

ScopeView.setTrig(state):

Set ScopeView trig option

Parameters state (bool): trig state

Returns error value

Return type int

Raises AssertionError: raises exception on error

Data Source

ScopeView.loadDataSource(strURI):

Load data source from provided source

Parameters strURI (str): data source location

ScopeView.loadFileDataSource(filePath):

Load ScopeView data source

Parameters filePath (str): path to data source location

ScopeView.reloadAllDataSources():

Reload all ScopeView data sources

Returns error value

Return type int

Raises AssertionError: raises exception on error

ScopeView.removeAllDataSources():

Remove all ScopeView data sources

Returns error value

Return type int

Raises AssertionError: raises exception on error

ScopeView.replaceDataSource(oldDataSourceLabel, newDataSourceLocation):

Replace ScopeView data source with provided source

Parameters

  • oldDataSourceLabel (str): ScopeView data source label
  • newDataSourceLocation (str): data source location

Returns error value

Return type int

Raises AssertionError: raises exception on error

ScopeView.setDataSourceParameter(dataSourceLabel, parameter, value):

Set an acquisition parameter for a custom data source which uses additional parameters

Parameters

  • dataSourceLabel (str): The data source label. It should contain the brackets
  • parameter(str): The string parameter ID. The parameters are defined in the description of the relevant data sources.
  • value(str): value

Returns error value

Return type int

Raises AssertionError: raises exception on error

Examples

  • HyWorksApi.ScopeView.setDataSourceParameter('[REC1]', 'timeLength', '0.4')
  • HyWorksApi.ScopeView.setDataSourceParameter('[OPA1]', 'triggerFunction', 'Level')

Template

ScopeView.executeTemplate(filePath):

Execute ScopeView template

Parameters filePath (str): path to template location

Returns error value

Return type int

Raises AssertionError: raises exception on error

ScopeView.importTemplate(filePath, appendNewPage):

Import template to ScopeView

Parameters

  • filePath (str): path to template location
  • appendNewPage (bool): append template to new page

Returns error value

Return type int

Raises AssertionError: raises exception on error

ScopeView.loadTemplate(filePath):

Load template to ScopeView

Parameters filePath (str): path to template location

Returns error value

Return type int

Raises AssertionError: raises exception on error

ScopeView.newTemplate():

Create new ScopeView template

Returns error value

Return type int

Raises AssertionError: raises exception on error

ScopeView.removeAllPages():

Removes all pages from ScopeView template

ScopeView.saveTemplate(filePath):

Save ScopeView template

Parameters filePath (str): path to template location

Returns error value

Return type int

Raises AssertionError: raises exception on error


  • No labels