CATIA-Systems / FMPy

Simulate Functional Mockup Units (FMUs) in Python
Other
438 stars 118 forks source link

array support for Binary datatype #604

Open PRAVEENFrmBOSCH opened 1 year ago

PRAVEENFrmBOSCH commented 1 year ago

I am trying to send array of binary data. e.g. call of function setBinary([1], [b'CHECK', b'OUTPUT', b'CLEAR'])

@ fmi3.py: line no 781 , getting invalid index error size = (c_size_t len(vr))([len(v) for v in values])

do binary type support array ?

Traceback (most recent call last): File simulate_custom_input() File "C:\Project\New_Project_Setup_bin\lib\Windows\Debug\x86\TestFMI3.py", line 104, in simulate_custom_input fmu.setBinary([binary_input_VR],[binary_input_value, binary_input_value, binary_input_value, binary_input_value]) File "C:\User\AppData\Local\Programs\Python\Python311-32\Lib\site-packages\fmpy\fmi3.py", line 791, in setBinary size = (c_size_t len(vr))([len(v) for v in values]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ IndexError: invalid index

t-sommer commented 1 year ago

Arrays of type Binary are currently not supported.

PRAVEENFrmBOSCH commented 1 year ago

This is as per fmi standard ? I saw in documentation that only for clock types array not supported. Will other simulators support array of binary type ?

chrbertsch commented 1 year ago

This is as per fmi standard ? I saw in documentation that only for clock types array not supported.

The FMI standard allows binary arrays. Tools such as fmpy are currently implementing the FMI 3.0 features step by step