question

viviane-b avatar image
0 Likes"
viviane-b asked Jeanette F commented

Pointers in module SDK

Hello.

I am working with module SDK and I am referecing some objects using pointers. However when I open a saved model, the pointers are all reset. I would like to know if there is a way to not lose the reference of pointers when opening a model.

Thanks.

FlexSim 23.0.8
module sdkmodulepointers
· 5
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Matthew Gillespie avatar image Matthew Gillespie ♦♦ commented ·
@Viviane_B Where are the pointers and what are they pointing at?
0 Likes 0 ·
viviane-b avatar image viviane-b Matthew Gillespie ♦♦ commented ·

I am sorry for the lack for a more detailed explanation. The pointers are declared in the module classes, cpp files, and they are referencing the model objects. The objects are created in the model, stored in a treenode and then referenced (using objectAs).

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel viviane-b commented ·
@Viviane_B, please read about pointers as a reference to hardware memory addresses. As long as a model is not compiled and a pointer is assigned to an address they should be empty by default. A method can establish a kind of coupling between an hardware address and a model tree node, but therefore this method must be executed right from the opening of a model. You might want to insert a construct that fulfill this kind of coupling by an event like on open a model. I believe it won’t be possible to establish exactly the same computer memory address to a reloaded model on modern PCs nowadays. This was a common practice, when computers were built with an capacity of some few kilobytes and it’s System didn’t swap assembled machine code to different physical resources.
0 Likes 0 ·
Show more comments
Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @viviane-b,

We haven't heard back from you. Were you able to solve your problem? If so, please add and accept an answer to let others know the solution. Or please respond to the previous comment so that we can continue to help you.

If we don't hear back in the next 3 business days, we'll assume you were able to solve your problem and we'll close this case in our tracker. You can always comment back at any time to reopen your question.

0 Likes 0 ·

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.