Skip to content

Commit 9679fa3

Browse files
committed
Merge branch 'dev-1.2.0'
2 parents 67833da + aa9213e commit 9679fa3

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

absscpi/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
Controls Advanced Battery Simulator through TCP, UDP, RS-485, and UDP multicast.
1111
"""
1212

13-
__version__ = "1.1.0"
13+
__version__ = "1.2.0"
1414

1515
__all__ = [
1616
"AbsCellFault",

absscpi/client.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
from ctypes import *
77
from ctypes.util import find_library
8+
from datetime import timedelta
89
from enum import IntEnum, IntFlag
910
import os
1011
import platform
@@ -1429,6 +1430,28 @@ def get_model_status(self) -> AbsModelStatus:
14291430
self.__check_err(res)
14301431
return AbsModelStatus(val.value)
14311432

1433+
def get_elapsed_model_time(self) -> timedelta:
1434+
"""Query elapsed model time in milliseconds.
1435+
1436+
.. note::
1437+
1438+
This function requires ABS firmware version 1.3.0 or newer.
1439+
1440+
Returns:
1441+
Elapsed model time.
1442+
1443+
Raises:
1444+
ScpiClientError: An error occurred while executing the query.
1445+
1446+
.. versionadded:: 1.2.0
1447+
"""
1448+
self.__ensure_ver(1,2,0)
1449+
ms = c_int64()
1450+
res = self.__dll.AbsScpiClient_GetElapsedModelTime(
1451+
self.__handle, byref(ms))
1452+
self.__check_err(res)
1453+
return timedelta(milliseconds=ms.value)
1454+
14321455
def load_model(self):
14331456
"""Load the model configuration on the device.
14341457

0 commit comments

Comments
 (0)