question

Nikhil_p K avatar image
0 Likes"
Nikhil_p K asked Nikhil_p K commented

Error while implementing the Module Class

Hello

I'm trying to implement the Snowflake Processor example from Module SDK https://docs.flexsim.com/en/21.0/Reference/DeveloperAdvancedUser/ModuleSDK/ExampleModuleClass/

I can successfully create the Snowflake Processor, but when I'm trying to reset the model i'm getting this error

  1. exception: Exception Caught in ObjectFunction441__project_events_OnResetModel_move_objects_to_reset_positions object: MAIN:/project/events/OnResetModel/move objects to reset positions i: MAIN:/project/events/OnResetModel/move objects to reset positions class: MAIN:/project/events/OnResetModel/move objects to reset positions
  2.  
  3. exception: Exception caught in TreeNode::callMemberFunction() c++/dll execution. Throwing... MAIN:/project/events/OnResetModel/move objects to reset positions c: MAIN:/project/events/OnResetModel/move objects to reset positions i: MAIN:/project/events/OnResetModel/move objects to reset positions thisClass: MAIN:/project/events/OnResetModel/move objects to reset positions

Can someone please help?

FlexSim 21.2.1
module sdkmodulesflexsim 21.2.1
· 2
5 |100000

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

1 Answer

Phil BoBo avatar image
0 Likes"
Phil BoBo answered Nikhil_p K commented

Your module directory only contains SnowFlake_86.dll and not a SnowFlake.dll, so it appears that you compiled an x86 Win32 DLL instead of a x64 DLL. You are probably using 64-bit FlexSim, so you need to compile your module in 64-bit by selecting x64 from the dropdown at the top. Also ensure that your project settings are set properly for the x64 configuration.

1630344530243.png

You didn't actually save your module, as specified in step 16 of Example Module Class (flexsim.com) so I can't actually see what changes you made in the tree. You need to use your Save Defaults button after making module changes in order to actually save your changes into your module. The module you attached is empty and does nothing.

Based on the model you attached though, it appears that you named your class [SnowFlake]::SnowProcessor instead of SnowFlake::SnowProcessor. Remove the brackets. The brackets in the documentation are to indicate that you replace that part of the text with your module name. You shouldn't include the brackets.

1630344651804.png


1630344530243.png (115.3 KiB)
1630344651804.png (50.4 KiB)
· 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.