Skip to content

MAPI service MeasurementManager

To get MeasurementManager service use:

with MAPIServices.instance.get_service("UserApplicationMonitoring") as uam:
    with uam.get_measurement_manager() as measurement_manager
or
with MAPIServices.instance.get_service("UserApplicationControl") as uac:
    with uac.get_measurement_manager() as measurement_manager

Bases: MAPIServiceWithSignalR

MeasurementManagerProxy manages a MORPHEE acquisition by creating dynamically MeasurementProxy objects. Do not create it by ourself, it should be created by using a UserApplicationMonitoringProxy object or UserApplicationControlProxy object. Call init_signalr if you intend to use the signalr hub events and with keyword on the MeasurementManagerProxy object to be sure that the communication is closed at the end.

Source code in restmapi\restmapi\services.py
class MeasurementManagerProxy(MAPIServiceWithSignalR):
	"""MeasurementManagerProxy manages a MORPHEE acquisition by creating dynamically MeasurementProxy objects.
	Do not create it by ourself, it should be created by using a UserApplicationMonitoringProxy object or UserApplicationControlProxy object.
	Call init_signalr if you intend to use the signalr hub events and with keyword on the MeasurementManagerProxy object to be sure that the communication is closed at the end.
	"""
	def __init__(self, url):
		"""DO NOT create MeasurementManagerProxy by yourself. Always use MAPIServices.get_service("UserApplicationMonitoring").get_measurement_manager() or MAPIServices.get_service("UserApplicationControl").get_measurement_manager() methods to create it.

		Parameters
		----------
		url : string
			Base URL to create of the REST service.
		"""
		super().__init__(url, "Measurement")

	def get_version(self):
		"""Current version of MAPI

		Returns
		-------
		string
			MAPI version
		"""
		return self.invoke_web_get_request("Version")

	def create_ex(self, workspace_index) -> MeasurementProxy:
		"""Create a new measurement.
		The measurement will be disposed automatically when the associated workspace stops.

		Parameters
		----------
		workspace_index : int
			0 based index of the workspace

		Returns
		-------
		MeasurementProxy
			Returns a MeasurementManagerProxy object. Use with keyword to automatically delete the object or use delete method explicitely.
		"""
		return MeasurementProxy(self._mapi_base_url, self.invoke_web_post_request(f"Create?mode={workspace_index}"))

	def create(self) -> MeasurementProxy:
		return MeasurementProxy(self._mapi_base_url, self.invoke_web_post_request(f""))

	def register_callback(self, measurement_id, event_name, action):
		"""Register a callback function.
		inti_signalr() method should be called first.

		Parameters
		----------
		measurement_id : int
			Id of the measurement.
		event_name : string
			Name of the event (BufferReady, BufferFull, StatusChanged, Disposed).
		action : function(instance, name, params)
			Callback function with 1 parameter (int: measurement_id) or with 2 (int: measurement_id, double[] values) for BufferReady.
		"""
		self.hub.server.invoke("Register", measurement_id, event_name)
		self.hub.client.off(event_name, action) # avoid that the same handler is registered twice
		self.hub.client.on(event_name, action)

__init__(url)

DO NOT create MeasurementManagerProxy by yourself. Always use MAPIServices.get_service("UserApplicationMonitoring").get_measurement_manager() or MAPIServices.get_service("UserApplicationControl").get_measurement_manager() methods to create it.

Parameters:

  • url (string) –
    Base URL to create of the REST service.
    
Source code in restmapi\restmapi\services.py
def __init__(self, url):
	"""DO NOT create MeasurementManagerProxy by yourself. Always use MAPIServices.get_service("UserApplicationMonitoring").get_measurement_manager() or MAPIServices.get_service("UserApplicationControl").get_measurement_manager() methods to create it.

	Parameters
	----------
	url : string
		Base URL to create of the REST service.
	"""
	super().__init__(url, "Measurement")

create_ex(workspace_index)

Create a new measurement. The measurement will be disposed automatically when the associated workspace stops.

Parameters:

  • workspace_index (int) –
    0 based index of the workspace
    

Returns:

  • MeasurementProxy

    Returns a MeasurementManagerProxy object. Use with keyword to automatically delete the object or use delete method explicitely.

Source code in restmapi\restmapi\services.py
def create_ex(self, workspace_index) -> MeasurementProxy:
	"""Create a new measurement.
	The measurement will be disposed automatically when the associated workspace stops.

	Parameters
	----------
	workspace_index : int
		0 based index of the workspace

	Returns
	-------
	MeasurementProxy
		Returns a MeasurementManagerProxy object. Use with keyword to automatically delete the object or use delete method explicitely.
	"""
	return MeasurementProxy(self._mapi_base_url, self.invoke_web_post_request(f"Create?mode={workspace_index}"))

get_version()

Current version of MAPI

Returns:

  • string

    MAPI version

Source code in restmapi\restmapi\services.py
def get_version(self):
	"""Current version of MAPI

	Returns
	-------
	string
		MAPI version
	"""
	return self.invoke_web_get_request("Version")

register_callback(measurement_id, event_name, action)

Register a callback function. inti_signalr() method should be called first.

Parameters:

  • measurement_id (int) –
    Id of the measurement.
    
  • event_name (string) –
    Name of the event (BufferReady, BufferFull, StatusChanged, Disposed).
    
  • action (function(instance, name, params)) –
    Callback function with 1 parameter (int: measurement_id) or with 2 (int: measurement_id, double[] values) for BufferReady.
    
Source code in restmapi\restmapi\services.py
def register_callback(self, measurement_id, event_name, action):
	"""Register a callback function.
	inti_signalr() method should be called first.

	Parameters
	----------
	measurement_id : int
		Id of the measurement.
	event_name : string
		Name of the event (BufferReady, BufferFull, StatusChanged, Disposed).
	action : function(instance, name, params)
		Callback function with 1 parameter (int: measurement_id) or with 2 (int: measurement_id, double[] values) for BufferReady.
	"""
	self.hub.server.invoke("Register", measurement_id, event_name)
	self.hub.client.off(event_name, action) # avoid that the same handler is registered twice
	self.hub.client.on(event_name, action)

Bases: MAPIService

MeasurementProxy is a dynamic object that manages a MORPHEE acquisition. Do not create it by ourself, it should be created by using a MeasurementManagerProxy object. Note that the object has to be deleted, so use with keyword on it!

Source code in restmapi\restmapi\services.py
class MeasurementProxy(MAPIService):
	"""MeasurementProxy is a dynamic object that manages a MORPHEE acquisition.
	Do not create it by ourself, it should be created by using a MeasurementManagerProxy object.
	Note that the object has to be deleted, so use with keyword on it!
	"""
	def __init__(self, url, id):
		"""DO NOT create MeasurementProxy by yourself. Always use MeasurementManagerProxy.create() or MeasurementManagerProxy.create_ex() methods to create it.

		Parameters
		----------
		url : string
			Base URL to create of the REST service.
		"""
		super().__init__(f"{url}/{id}")
		self._id = id	

	@property
	def id(self) -> int:
		"""Unique id of the MORPHEE measurement object"""		
		return self._id						

	def get_quantities(self):
		"""Get the list of quantities to measure. Only number quantities are supported.

		Returns
		-------
		string array
			Quantities id from the measurement.
		"""
		return self.invoke_web_get_request(f"Quantities")

	def set_quantities(self, quantities):
		"""Set the list of quantities to measure. Only number quantities are supported.

		Parameters
		----------
		quantities : string array
			New quantity id list.
		"""
		self.invoke_web_request(f"Quantities", "POST", quantities, False)

	def get_period(self):
		"""Get sampling period in second.

		Returns
		-------
		double
			Sampling period in second.
		"""
		return self.invoke_web_get_request(f"Period")

	def set_period(self, period):
		"""Set sampling period in second.

		Parameters
		----------
		period : double
			Sampling period in second.
		"""
		self.invoke_web_request(f"Period", "POST", period, False)

	def get_number_of_bloc_values(self):
		"""Get bloc number of values. Each time the buffer size reaches NumberOfBlocValues the event MeasurementBufferReady is raised.

		Returns
		-------
		uint
			Number of values per bloc.
		"""
		return self.invoke_web_get_request(f"NumberOfBlocValues")

	def set_number_of_bloc_values(self, number_of_bloc_values):
		"""Set bloc number of values. Each time the buffer size reaches NumberOfBlocValues the event MeasurementBufferReady is raised.

		Parameters
		----------
		number_of_bloc_values : uint
			Number of values per bloc.
		"""
		self.invoke_web_request(f"NumberOfBlocValues", "POST", number_of_bloc_values, False)		

	def get_number_of_values(self):
		"""Get total number of values. It defines the size of the internal buffer.

		Returns
		-------
		unit
			Total number of values.
		"""
		return self.invoke_web_get_request(f"NumberOfValues")

	def set_number_of_values(self, number_of_values):
		"""Set total number of values. It defines the size of the internal buffer.
		Note that duration and number_of_values cannot be both set.

		Parameters
		----------
		number_of_values : unit
			Total number of values.
		"""
		self.invoke_web_request(f"NumberOfValues", "POST", number_of_values, False)	

	def get_duration(self):
		"""Get duration of the measurement. Duration = NumberOfValues * Period.

		Returns
		-------
		double
			Duration of the acquisition buffer.
		"""
		return self.invoke_web_get_request(f"Duration")

	def set_duration(self, duration):
		"""Set duration of the measurement. Duration = NumberOfValues * Period.
		Note that duration and number_of_values cannot be both set.

		Parameters
		----------
		duration : double
			Duration of the acquisition buffer.
		"""
		self.invoke_web_request(f"Duration", "POST", duration, False)	

	def get_measurement_mode(self):
		"""Get the Measurement Mode. If MeasurementMode is OneShot (1), the measurement stop at the end of the Duration and NumberOfBlocValues is ignored. If MeasurementMode is Continuous (0), the measurement does not stop until you read the values with GetValues. If MeasurementMode is StepByStep (2), values are acquired at each TriggerGetValues call.

		Returns
		-------
		uint
			Continuous (0), OneShot (1), StepByStep (2).
		"""
		return self.invoke_web_get_request(f"MeasurementMode")

	def set_measurement_mode(self, measurement_mode):
		"""Set the Measurement Mode. If MeasurementMode is OneShot (1), the measurement stop at the end of the Duration and NumberOfBlocValues is ignored. If MeasurementMode is Continuous (0), the measurement does not stop until you read the values with GetValues. If MeasurementMode is StepByStep (2), values are acquired at each TriggerGetValues call.

		Parameters
		----------
		measurement_mode : uint
			Continuous (0), OneShot (1), StepByStep (2).
		"""
		self.invoke_web_request(f"MeasurementMode", "POST", measurement_mode, False)	

	def get_status(self):
		"""The current status of the Measurement. To change properties of the measurement, the Status should be Created.
		<div class="grid table-desc" markdown>
		| Created   |  0  |  Measurement is Created, properties can be set to configure it.                          |
		| Activated |  1  |  Measurement is Activated, properties can not be set. Measurement is ready to start.     |
		| Started   |  2  |  Measurement is Started. Use GetValues to retrieves the result buffer.                   |
		| Disposed  |  3  |  Measurement is Disposed. It could happen if the associated mode has stopped.            |
		| Unknown   |  4  |  Unknown state indicates a serious internal error.                                       |
		</div>

		Returns
		-------
		uint
			Current status
		"""
		return self.invoke_web_get_request(f"Status")

	def get_last_error(self):
		"""String error description of the last error. For example, after Activate method call, the user can get the reason why the activation was performed.

		Returns
		-------
		string
			Last error message.
		"""
		return self.invoke_web_get_request(f"LastError")

	def activate(self):
		"""Activate the measurement. During the activation, MORPHEE checks the properties. To activate the measurement, the Status should be Created. If it works the Status is set to Activated.

		Returns
		-------
		bool
			Returns True if all properties are correct.
		"""
		return self.invoke_web_get_request(f"Activate")

	def start(self):
		"""Start the measurement. To start the measurement, the Status should be Activated. If it works the Status is set to Started.

		Returns
		-------
		bool
			Returns False if the operation could not be performed. Use LastError property to have the description of the error.
		"""
		return self.invoke_web_get_request(f"Start")

	def stop(self):
		"""Stop the measurement. To stop the measurement, the Status should be Started. If it works the Status is set to Activated.

		Returns
		-------
		bool
			Returns False if the operation could not be performed. Use LastError property to have the description of the error.
		"""
		return self.invoke_web_get_request(f"Stop")

	def deactivate(self):
		"""Deactivate the measurement. During the activation, MORPHEE checks the properties. To Deactivate the measurement, the Status should be Activated. If it works the Status is set to Created.

		Returns
		-------
		bool
			Returns False if the operation could not be performed. Use LastError property to have the description of the error.
		"""
		return self.invoke_web_get_request(f"Deactivate")

	def get_values(self):
		"""return buffered values with timestamp as first columns.
		If MeasurementMode is Continuous, the buffer is cleared in order to continue the acquistion. If MeasurementMode is OneShot, the buffer values remains in buffer until you starts again the measurement.

		Returns
		-------
		double array
			Measurement values.
		"""
		return self.invoke_web_get_request(f"Values")

	def trigger_get_values(self):
		"""If MeasurementMode is StepByStep, it triggers the Measurement to get value at the next tick

		Returns
		-------
		bool
			Returns False if the operation could not be performed. Use LastError property to have the description of the error.
		"""
		return self.invoke_web_post_request(f"TriggerGetValues")

	def get_properties(self):
		"""Get Measurement object properties in Json format using one single request.

		Returns
		-------
		MeasurementProperties
			Returns an object with every properties of the measurement (only for read purpose).
		"""
		return self.invoke_web_get_request(f"")	

	def delete(self):
		"""Delete/Release Measurement object.
		After that, any call to the measurement raise an exception

		"""
		self.invoke_web_request(f"", "DELETE", None, True)

	def __enter__(self):
		return self	

	def __exit__(self, exception_type, exception_value, traceback):
		self.delete()

id property

Unique id of the MORPHEE measurement object

__init__(url, id)

DO NOT create MeasurementProxy by yourself. Always use MeasurementManagerProxy.create() or MeasurementManagerProxy.create_ex() methods to create it.

Parameters:

  • url (string) –
    Base URL to create of the REST service.
    
Source code in restmapi\restmapi\services.py
def __init__(self, url, id):
	"""DO NOT create MeasurementProxy by yourself. Always use MeasurementManagerProxy.create() or MeasurementManagerProxy.create_ex() methods to create it.

	Parameters
	----------
	url : string
		Base URL to create of the REST service.
	"""
	super().__init__(f"{url}/{id}")
	self._id = id	

activate()

Activate the measurement. During the activation, MORPHEE checks the properties. To activate the measurement, the Status should be Created. If it works the Status is set to Activated.

Returns:

  • bool

    Returns True if all properties are correct.

Source code in restmapi\restmapi\services.py
def activate(self):
	"""Activate the measurement. During the activation, MORPHEE checks the properties. To activate the measurement, the Status should be Created. If it works the Status is set to Activated.

	Returns
	-------
	bool
		Returns True if all properties are correct.
	"""
	return self.invoke_web_get_request(f"Activate")

deactivate()

Deactivate the measurement. During the activation, MORPHEE checks the properties. To Deactivate the measurement, the Status should be Activated. If it works the Status is set to Created.

Returns:

  • bool

    Returns False if the operation could not be performed. Use LastError property to have the description of the error.

Source code in restmapi\restmapi\services.py
def deactivate(self):
	"""Deactivate the measurement. During the activation, MORPHEE checks the properties. To Deactivate the measurement, the Status should be Activated. If it works the Status is set to Created.

	Returns
	-------
	bool
		Returns False if the operation could not be performed. Use LastError property to have the description of the error.
	"""
	return self.invoke_web_get_request(f"Deactivate")

delete()

Delete/Release Measurement object. After that, any call to the measurement raise an exception

Source code in restmapi\restmapi\services.py
def delete(self):
	"""Delete/Release Measurement object.
	After that, any call to the measurement raise an exception

	"""
	self.invoke_web_request(f"", "DELETE", None, True)

get_duration()

Get duration of the measurement. Duration = NumberOfValues * Period.

Returns:

  • double

    Duration of the acquisition buffer.

Source code in restmapi\restmapi\services.py
def get_duration(self):
	"""Get duration of the measurement. Duration = NumberOfValues * Period.

	Returns
	-------
	double
		Duration of the acquisition buffer.
	"""
	return self.invoke_web_get_request(f"Duration")

get_last_error()

String error description of the last error. For example, after Activate method call, the user can get the reason why the activation was performed.

Returns:

  • string

    Last error message.

Source code in restmapi\restmapi\services.py
def get_last_error(self):
	"""String error description of the last error. For example, after Activate method call, the user can get the reason why the activation was performed.

	Returns
	-------
	string
		Last error message.
	"""
	return self.invoke_web_get_request(f"LastError")

get_measurement_mode()

Get the Measurement Mode. If MeasurementMode is OneShot (1), the measurement stop at the end of the Duration and NumberOfBlocValues is ignored. If MeasurementMode is Continuous (0), the measurement does not stop until you read the values with GetValues. If MeasurementMode is StepByStep (2), values are acquired at each TriggerGetValues call.

Returns:

  • uint

    Continuous (0), OneShot (1), StepByStep (2).

Source code in restmapi\restmapi\services.py
def get_measurement_mode(self):
	"""Get the Measurement Mode. If MeasurementMode is OneShot (1), the measurement stop at the end of the Duration and NumberOfBlocValues is ignored. If MeasurementMode is Continuous (0), the measurement does not stop until you read the values with GetValues. If MeasurementMode is StepByStep (2), values are acquired at each TriggerGetValues call.

	Returns
	-------
	uint
		Continuous (0), OneShot (1), StepByStep (2).
	"""
	return self.invoke_web_get_request(f"MeasurementMode")

get_number_of_bloc_values()

Get bloc number of values. Each time the buffer size reaches NumberOfBlocValues the event MeasurementBufferReady is raised.

Returns:

  • uint

    Number of values per bloc.

Source code in restmapi\restmapi\services.py
def get_number_of_bloc_values(self):
	"""Get bloc number of values. Each time the buffer size reaches NumberOfBlocValues the event MeasurementBufferReady is raised.

	Returns
	-------
	uint
		Number of values per bloc.
	"""
	return self.invoke_web_get_request(f"NumberOfBlocValues")

get_number_of_values()

Get total number of values. It defines the size of the internal buffer.

Returns:

  • unit

    Total number of values.

Source code in restmapi\restmapi\services.py
def get_number_of_values(self):
	"""Get total number of values. It defines the size of the internal buffer.

	Returns
	-------
	unit
		Total number of values.
	"""
	return self.invoke_web_get_request(f"NumberOfValues")

get_period()

Get sampling period in second.

Returns:

  • double

    Sampling period in second.

Source code in restmapi\restmapi\services.py
def get_period(self):
	"""Get sampling period in second.

	Returns
	-------
	double
		Sampling period in second.
	"""
	return self.invoke_web_get_request(f"Period")

get_properties()

Get Measurement object properties in Json format using one single request.

Returns:

  • MeasurementProperties

    Returns an object with every properties of the measurement (only for read purpose).

Source code in restmapi\restmapi\services.py
def get_properties(self):
	"""Get Measurement object properties in Json format using one single request.

	Returns
	-------
	MeasurementProperties
		Returns an object with every properties of the measurement (only for read purpose).
	"""
	return self.invoke_web_get_request(f"")	

get_quantities()

Get the list of quantities to measure. Only number quantities are supported.

Returns:

  • string array

    Quantities id from the measurement.

Source code in restmapi\restmapi\services.py
def get_quantities(self):
	"""Get the list of quantities to measure. Only number quantities are supported.

	Returns
	-------
	string array
		Quantities id from the measurement.
	"""
	return self.invoke_web_get_request(f"Quantities")

get_status()

The current status of the Measurement. To change properties of the measurement, the Status should be Created.

| Created | 0 | Measurement is Created, properties can be set to configure it. | | Activated | 1 | Measurement is Activated, properties can not be set. Measurement is ready to start. | | Started | 2 | Measurement is Started. Use GetValues to retrieves the result buffer. | | Disposed | 3 | Measurement is Disposed. It could happen if the associated mode has stopped. | | Unknown | 4 | Unknown state indicates a serious internal error. |

Returns:

  • uint

    Current status

Source code in restmapi\restmapi\services.py
def get_status(self):
	"""The current status of the Measurement. To change properties of the measurement, the Status should be Created.
	<div class="grid table-desc" markdown>
	| Created   |  0  |  Measurement is Created, properties can be set to configure it.                          |
	| Activated |  1  |  Measurement is Activated, properties can not be set. Measurement is ready to start.     |
	| Started   |  2  |  Measurement is Started. Use GetValues to retrieves the result buffer.                   |
	| Disposed  |  3  |  Measurement is Disposed. It could happen if the associated mode has stopped.            |
	| Unknown   |  4  |  Unknown state indicates a serious internal error.                                       |
	</div>

	Returns
	-------
	uint
		Current status
	"""
	return self.invoke_web_get_request(f"Status")

get_values()

return buffered values with timestamp as first columns. If MeasurementMode is Continuous, the buffer is cleared in order to continue the acquistion. If MeasurementMode is OneShot, the buffer values remains in buffer until you starts again the measurement.

Returns:

  • double array

    Measurement values.

Source code in restmapi\restmapi\services.py
def get_values(self):
	"""return buffered values with timestamp as first columns.
	If MeasurementMode is Continuous, the buffer is cleared in order to continue the acquistion. If MeasurementMode is OneShot, the buffer values remains in buffer until you starts again the measurement.

	Returns
	-------
	double array
		Measurement values.
	"""
	return self.invoke_web_get_request(f"Values")

set_duration(duration)

Set duration of the measurement. Duration = NumberOfValues * Period. Note that duration and number_of_values cannot be both set.

Parameters:

  • duration (double) –
    Duration of the acquisition buffer.
    
Source code in restmapi\restmapi\services.py
def set_duration(self, duration):
	"""Set duration of the measurement. Duration = NumberOfValues * Period.
	Note that duration and number_of_values cannot be both set.

	Parameters
	----------
	duration : double
		Duration of the acquisition buffer.
	"""
	self.invoke_web_request(f"Duration", "POST", duration, False)	

set_measurement_mode(measurement_mode)

Set the Measurement Mode. If MeasurementMode is OneShot (1), the measurement stop at the end of the Duration and NumberOfBlocValues is ignored. If MeasurementMode is Continuous (0), the measurement does not stop until you read the values with GetValues. If MeasurementMode is StepByStep (2), values are acquired at each TriggerGetValues call.

Parameters:

  • measurement_mode (uint) –
    Continuous (0), OneShot (1), StepByStep (2).
    
Source code in restmapi\restmapi\services.py
def set_measurement_mode(self, measurement_mode):
	"""Set the Measurement Mode. If MeasurementMode is OneShot (1), the measurement stop at the end of the Duration and NumberOfBlocValues is ignored. If MeasurementMode is Continuous (0), the measurement does not stop until you read the values with GetValues. If MeasurementMode is StepByStep (2), values are acquired at each TriggerGetValues call.

	Parameters
	----------
	measurement_mode : uint
		Continuous (0), OneShot (1), StepByStep (2).
	"""
	self.invoke_web_request(f"MeasurementMode", "POST", measurement_mode, False)	

set_number_of_bloc_values(number_of_bloc_values)

Set bloc number of values. Each time the buffer size reaches NumberOfBlocValues the event MeasurementBufferReady is raised.

Parameters:

  • number_of_bloc_values (uint) –
    Number of values per bloc.
    
Source code in restmapi\restmapi\services.py
def set_number_of_bloc_values(self, number_of_bloc_values):
	"""Set bloc number of values. Each time the buffer size reaches NumberOfBlocValues the event MeasurementBufferReady is raised.

	Parameters
	----------
	number_of_bloc_values : uint
		Number of values per bloc.
	"""
	self.invoke_web_request(f"NumberOfBlocValues", "POST", number_of_bloc_values, False)		

set_number_of_values(number_of_values)

Set total number of values. It defines the size of the internal buffer. Note that duration and number_of_values cannot be both set.

Parameters:

  • number_of_values (unit) –
    Total number of values.
    
Source code in restmapi\restmapi\services.py
def set_number_of_values(self, number_of_values):
	"""Set total number of values. It defines the size of the internal buffer.
	Note that duration and number_of_values cannot be both set.

	Parameters
	----------
	number_of_values : unit
		Total number of values.
	"""
	self.invoke_web_request(f"NumberOfValues", "POST", number_of_values, False)	

set_period(period)

Set sampling period in second.

Parameters:

  • period (double) –
    Sampling period in second.
    
Source code in restmapi\restmapi\services.py
def set_period(self, period):
	"""Set sampling period in second.

	Parameters
	----------
	period : double
		Sampling period in second.
	"""
	self.invoke_web_request(f"Period", "POST", period, False)

set_quantities(quantities)

Set the list of quantities to measure. Only number quantities are supported.

Parameters:

  • quantities (string array) –
    New quantity id list.
    
Source code in restmapi\restmapi\services.py
def set_quantities(self, quantities):
	"""Set the list of quantities to measure. Only number quantities are supported.

	Parameters
	----------
	quantities : string array
		New quantity id list.
	"""
	self.invoke_web_request(f"Quantities", "POST", quantities, False)

start()

Start the measurement. To start the measurement, the Status should be Activated. If it works the Status is set to Started.

Returns:

  • bool

    Returns False if the operation could not be performed. Use LastError property to have the description of the error.

Source code in restmapi\restmapi\services.py
def start(self):
	"""Start the measurement. To start the measurement, the Status should be Activated. If it works the Status is set to Started.

	Returns
	-------
	bool
		Returns False if the operation could not be performed. Use LastError property to have the description of the error.
	"""
	return self.invoke_web_get_request(f"Start")

stop()

Stop the measurement. To stop the measurement, the Status should be Started. If it works the Status is set to Activated.

Returns:

  • bool

    Returns False if the operation could not be performed. Use LastError property to have the description of the error.

Source code in restmapi\restmapi\services.py
def stop(self):
	"""Stop the measurement. To stop the measurement, the Status should be Started. If it works the Status is set to Activated.

	Returns
	-------
	bool
		Returns False if the operation could not be performed. Use LastError property to have the description of the error.
	"""
	return self.invoke_web_get_request(f"Stop")

trigger_get_values()

If MeasurementMode is StepByStep, it triggers the Measurement to get value at the next tick

Returns:

  • bool

    Returns False if the operation could not be performed. Use LastError property to have the description of the error.

Source code in restmapi\restmapi\services.py
def trigger_get_values(self):
	"""If MeasurementMode is StepByStep, it triggers the Measurement to get value at the next tick

	Returns
	-------
	bool
		Returns False if the operation could not be performed. Use LastError property to have the description of the error.
	"""
	return self.invoke_web_post_request(f"TriggerGetValues")