question

Steven Chen avatar image
0 Likes"
Steven Chen asked Mischa Spelt commented

SDK References Class in Modules

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();
FlexSim 22.0.1
module sdk
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

·
Jordan Johnson avatar image
0 Likes"
Jordan Johnson answered Mischa Spelt commented

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.

· 1
5 |100000

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

Mischa Spelt avatar image Mischa Spelt commented ·

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 0 ·

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.