SDK References Class in Modules

SDK References Class in Modules

mail7WJMZ
Collaborator Collaborator
107 Views
2 Replies
Message 1 of 3

SDK References Class in Modules

mail7WJMZ
Collaborator
Collaborator

[ FlexSim 22.0.1 ]

Hello,

How to access class in other modules such as AGV, ProcessFlow.

For example:

// in dll of module sdk
AGV agv = new AGV(taskexecuter);
Token token = createtoken();
0 Likes
Accepted solutions (1)
108 Views
2 Replies
Replies (2)
Message 2 of 3

JordanLJohnson
Autodesk
Autodesk
Accepted solution

In the case of Process Flow, we do share a bunch of header files. They are in your FlexSim install directory, at /modules/ProcessFlow/include. If you include those (and probably link against ProcessFlow.dll), you can access the Token class directly. Like the module SDK, be sure to use the files from the version of FlexSim you are targeting.

For AGV, I don't think we share those header files, so I don't think you can access AGV methods directly in another module's dll.

The module SDK provides access to the widest range of types and functions available to 3rd-party developers, but it doesn't provide access to most of the other modules.

There are many cases where you need to keep some secret in a module, compiled into the dll. In these cases, you can use the following approach:

  1. Use the Module to add a set of FlexScript functions that you can use to query the model.
  2. In the module dll, you can call those functions. Or you can call the dll at certain points in the model. But you can shove all kinds of data into an Array or Map (which can contain Arrays and Maps), and get any data structure you need.
  3. Now that the module dll has the data, you can run the secret algorithm. Perhaps the algorithm makes a decision, such as which job should be done next, or creates kinematics for objects to move. Maybe it just generates additional data.
  4. You can pass the result of the secret algorithm into a FlexScript node, and from there, do anything you want (create tokens, give AGVs directions, etc.)

This kind of approach works well. An attacker can tell that you are getting information out of the model, and that somehow, you use that information to make decisions, or to drive model behavior. But the dll is a black box; the attacker doesn't know the key part, which is how you made those decisions.

.


Jordan Johnson
Principal Software Engineer
>

0 Likes
Message 3 of 3

mischa_spelt
Advisor
Advisor

Good suggestions @Jordan Johnson, just wanted to add a small warning that only the fact that logic is in a DLL, does not mean it's absolutely secure. Your approach will deter most 'casual' attackers but a determined hacker with access to the DLL will always be able to decompile and reverse engineer it to some extent.

0 Likes