question

Mark S3 avatar image
0 Likes"
Mark S3 asked Phil BoBo commented

How can I pass a treenodearray type parameter to the DLL function?

In Dll Maker I'm building my own DLL function.If I'm passing treenode types , I can use treenode A=parnode(1).If I'm passing numeric types and I can use int B=parval(2). But if I'm passing a treenodearray type ,how should my DLL function accept this type of parameter? In the old version, Flexsim used parval, parnode and parstr to pass parameters to functions or triggers.But in the updated version,Flexsim use param pass parameters to functions or triggers, and param can be compatible with more data types(including treenodearray type). unfortunately,I can't use param in my Dll project! Is there anyone who can help me with this problem?

FlexSim 17.1.6
dll
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
2 Likes"
Phil BoBo answered Phil BoBo commented

Add the following line to FlexsimDefs.h near the #define for parnode, parval, and parstr:

#define param(__a__) _param(__a__, callPoint)

Then use that function in the usual way:

Array myArray = param(1);


param.png (34.8 KiB)
param-usage.png (18.9 KiB)
· 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.

Lucas Klein avatar image Lucas Klein commented ·

Beyond this two configurations, is needed something else to make the "param(1)" works?

I'm using the v2010 of Visual Studio Solution at the DllMaker template directory. I did the update at FlexSimDefs.h but still not able to use "param" in my code, no matter the variable type.

0 Likes 0 ·
report3.jpg (317.3 KiB)
Phil BoBo avatar image Phil BoBo ♦♦ Lucas Klein commented ·

Support for Visual Studio 2010 was dropped in FlexSim 7.5.

The param() command was introduced in FlexSim 7.7.

Try updating to a newer version of Visual Studio.

1 Like 1 ·

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.