OSError: exception: access violation reading 0x0000000000000000

  • ivan1975
  • Topic Author
More
28 Sep 2022 13:58 - 29 Sep 2022 09:15 #11510 by ivan1975
Hi,

I want to develop my owm phyton code about Wind power model using SAM's 'Generate Code' tool.

The problem is that original phyton code created by 'Generate Code' tool doesn`t work.

The message error is:
Code:
Traceback (most recent call last):   File "C:\Users\USUARIO\Desktop\MyWork\ParaScript.py", line 373, in <module> if ssc.module_exec(module, data) == 0:   File "C:\Users\USUARIO\Desktop\MyWork\PySSC.py", line 165, in module_exec return self.pdll.ssc_module_exec( c_void_p(p_mod), c_void_p(p_data) ) OSError: exception: access violation reading 0x0000000000000000

I have been debbuging code and I have found that problem is in LandBosse model.

See phyton code in PySCC.py file:
Code:
ssc.module_free(module) module = ssc.module_create(b'wind_landbosse') ssc.module_exec_set_print( 0 ); if ssc.module_exec(module, data) == 0: print ('wind_landbosse simulation error') idx = 1 msg = ssc.module_log(module, 0) while (msg != None): print (' : ' + msg.decode("utf - 8")) msg = ssc.module_log(module, idx) idx = idx + 1 SystemExit( "Simulation Error" );

If I comment this code using # symbol then the algoritm works OK.

Please help me to find a solution to run this LandBosse Model.

Thanks,
Ivan
Last edit: 29 Sep 2022 09:15 by pgilman.

Please Log in or Create an account to join the conversation.

  • pgilman
More
29 Sep 2022 09:39 #11511 by pgilman
Hi Ivan,

The code block you are commenting out must be in the .py file for your case, not in PySSC.py.

The error is caused by enabling the LandBOSSE cost model with
Code:
ssc.data_set_number( data, b'en_landbosse', 1 )

You can avoid the error by setting en_landbosse = 0, or by clearing the Enable Land-Based Balance of System Cost Model check box on the Installation Costs page in SAM before you run the code generator.

The LandBOSSE model is part of the SAM user interface, so PySSC does not know how to run it.

LandBOSSE is a Python program available at github.com/WISDEM/LandBOSSE , so if you want to use it with your Python model, you can do it in Python.

Best regards,
Paul.

Please Log in or Create an account to join the conversation.

Moderators: pgilman
Powered by Kunena Forum