ATTENTIONThis FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices. |
flexsim.com |
#2
|
||||
|
||||
Juan,
Check out the article in the Wiki section of this forum about attaching a DLL to Flexsim http://www.flexsim.com/community/for...read.php?t=382 Steven PS I removed your other post. No double posting please! Last edited by Steven Hamoen; 03-23-2010 at 07:12 AM. |
The Following 2 Users Say Thank You to Steven Hamoen For This Useful Post: | ||
RalfGruber (03-23-2010) |
#3
|
|||
|
|||
Hello,
I have read the post and I know how to create the dll. However, I don't know how to load the dll in flexsim. I mean, How can I open/load the dll in flexsim? And How I can use the functions of the dll when I'm programming in flexsim? Thanks. Quote:
|
#4
|
||||
|
||||
Are you sure you read throught the article?
Quote:
Change your node to DLL (either in the code editor or via the tree ) Change the code to let it point to the right DLL and the right function in your DLL If you want to use a function from the DLL in Flexscript the easiest way is to create a usercommand that is toggled as DLL and call's the DLL function or you could use the nodefunction command to call the node directly |
The Following 2 Users Say Thank You to Steven Hamoen For This Useful Post: | ||
Tom David (03-24-2010) |
#5
|
|||
|
|||
Hello again,
I have more problems with this topic. How can I get a value that my dll function returns? For example: int NumeroAleatorio() This functions returns a random number, and I want to get it when I use it in flexsim. I'm sorry for my questions, but I'm new in this topic. Thank you! Quote:
|
#6
|
|||
|
|||
Hi,
Create a User Command that wraps your dll call, switch the user command as dll. Then call the user command as normally you do. Example: Create a use command called Test: dll:"../libraries/thedll.dll" name:"NumeroAleatorio" Call user command like: int number=Test(); Do not forget to add return in your int NumeroAleatorio() code. Lars-Olof |
The Following 4 Users Say Thank You to Lars-Olof Leven For This Useful Post: | ||
Tom David (03-24-2010) |
#7
|
|||
|
|||
Hello there, I have been trying to attach the dll of the wiki example to any of a simple model in flexsim but I keep getting an error throwing Windows Error Code: 193. I feel it might have to do with compability issues? And the debugging in VS says it cannot start the program because the dll is not in the path defined... Can someone shed a light on this, please?
|
#8
|
||||
|
||||
Make sure you're building against the same platform as your FlexSim installer, i.e. if you installed the 64-bit version of FlexSim, you need to build your dll using the x64 Platform, and for 32-bit FlexSim you need to build your dll using the Win32 Platform. You can set the build platform in the toolbar of Visual Studio.
|
The Following 4 Users Say Thank You to Anthony Johnson For This Useful Post: | ||
Paulo Lopes (10-27-2014) |