[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
CAPE-OPEN • View topic - Value of StringParameter not saved in Pro-II

Value of StringParameter not saved in Pro-II

Value of StringParameter not saved in Pro-II

Postby SLiebschner » 15 September 2022, 12:16

SLiebschner
 
Posts: 19
Joined: 01 February 2022, 10:14

Re: Value of StringParameter not saved in Pro-II

Postby jasper » 16 September 2022, 07:16

The unit operation is responsible for saving and restoring the values. This should be implemented in IPersistStream(Init)::Save and IPersistStream(Init)::Load (and if IPersistPropertyBag is implemented, also in IPersistPropertyBag ::Save and IPersistPropertyBag ::Load)
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: Value of StringParameter not saved in Pro-II

Postby SLiebschner » 19 September 2022, 21:42

SLiebschner
 
Posts: 19
Joined: 01 February 2022, 10:14

Re: Value of StringParameter not saved in Pro-II

Postby jasper » 20 September 2022, 15:09

Can you perhaps check what happens in Save and Load from a debugger, by attaching it to the running PME instance?
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: Value of StringParameter not saved in Pro-II

Postby jasper » 20 September 2022, 15:10

Does GetSizeMax return the right amount of required storage?
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: Value of StringParameter not saved in Pro-II

Postby SLiebschner » 21 September 2022, 09:51

SLiebschner
 
Posts: 19
Joined: 01 February 2022, 10:14

Re: Value of StringParameter not saved in Pro-II

Postby jasper » 24 September 2022, 11:05

As saving and loading the parameters is internal to the unit operation, the log does not help much in this case - it logs the interaction between the PME and PMC.

I think best here is to set a break point in the debugger, and check whether Save and Load to as you expect them to do.

GetSizeMax is supposed to return the amount of memory needed for storage - it should be the number of double parameters times the size of a double, plus the number of string parameters plus for each string parameter the size of the length and the size of the data.
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: Value of StringParameter not saved in Pro-II

Postby SLiebschner » 04 October 2022, 11:14

I haven't succeeded in actual debugging, but printed values of parameters to file.

It turns out that the parameters, with which I am having problems, have a **fixed** value, e.g. nan, -83, -0.649452
when I print them to file. It is not influenced by my giving numbers to the parameters in question. However, their value is not displayed within the CAPE-OPEN Settings withn Pro-II. Again the fact: this happens only with input-parameters succeeding number 32 (start counting from 0). You don't know about a maximum size of input parameters in the parameterCollection, do you?
Btw, I check that this happens also, if all of those parameters are RealParameters, i.e. there are no StringParameters.

I changed the return value of GetSizeMax() accordingly, but it does not seem to have an influence at all.
Actually it should not matter what GetSizeMax() returns, as long as its value is larger or equal the actual required size and I have enough memory. Is that so?
SLiebschner
 
Posts: 19
Joined: 01 February 2022, 10:14

Re: Value of StringParameter not saved in Pro-II

Postby jasper » 04 October 2022, 13:35

Are you using Visual Studio?

CAPE-OPEN does not define a maximum size of the parameter collection. Perhaps there is such a limitation in Pro/II although I am not aware of it - can you try whether it works in any other simulator? (e.g. COCO/COFE?)
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: Value of StringParameter not saved in Pro-II

Postby SLiebschner » 10 October 2022, 12:24

Yes, I use Visual Studio. Why do you ask?

It works in DWSIM. So the problem seems to be Pro-II related.
I see whether I can get some help from Pro-II.
SLiebschner
 
Posts: 19
Joined: 01 February 2022, 10:14

Next

Return to Unit Operations

Who is online

Users browsing this forum: No registered users and 0 guests

cron