Jump to content

silverChariot

Members
  • Posts

    10
  • Joined

  • Last visited

About silverChariot

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

silverChariot's Achievements

Newbie

Newbie (1/14)

  • Week One Done Rare
  • One Month Later Rare
  • One Year In Rare

Recent Badges

0

Reputation

  1. Sure, here you are. You can try this one. The inputs are the function name without .m and the function address. CallMATLAB2.dll
  2. Hi atuba, Thank you for your friendly reply! I'm using Matlab 2019a and Simio12 in Windows10. I did try to use the CallMATLAB dll file online, but that required the corresponding software version and system version. I rewrite the code in C# that calls Matlab with cmd. The created dll file works but requires a pause after the CallMatlab step, and it was inconvenient but helped me obtains the experiment result. I will definitely try your suggestion next time the optimization-based simulation is needed. Thank you!
  3. Hi gocken, Thank you for your reply and your attention to this problem! The current method that adds a breakpoint after 'CallMATLAB' function works in my project. Before Simio runs MATLAB, Simio will send out needed data to SQL server and then call MATLAB function. MATLAB receives the data through the database, implements the algorithm, and writes the data into the database. The Simio program pauses at the step that Simio reads the MATLAB results from the database. I have validated the .dll file with a simple MATLAB program that plays a music file and it works. Because the Simio API is a little complex, I just use the code from https://www.sciencedirect.com/science/article/pii/S1569190X16301356 and recomplie that to obtain the .dll. Through this example, I also found Simio continues running after the matlab file is executed Otherwise, if I didn't pause the Simio after the MATLAB function is called, it generates error like this I also find that when the MATLAB program is running, it will open a MATLAB command window. If you don't pause, sometimes the MATLAB is still running when the command window exists, and Simio also begins to run before that window closes, and it will generate the same error like abov e. So I guess I have to pause it to let MATLAB program finishes. I have attached the UserStep.cs that generates CallMatlab.dll. If you have any further idea on this problem, I am really glad to know that. Again, thanks for your reply and idea on this problem. Shu UserStep.cs
  4. To pause Simio can be implemented by add a breakpoint after the step that calls MATLAB function and continue the model after the MATLAB program is finished.
  5. This can be done by calling c# from simio and calling Matlab from c# with Simio API. Details can be found here: https://www.sciencedirect.com/science/article/pii/S1569190X16301356 And here: https://www.simio.com/resources/events/2018-User-Group-Meeting/presentations/API.pdf But another problem is that how do we pause Simio until the MATLAB problem is finished? Any suggestions on this?
  6. Hello everyone, I met a problem during the use of 'CallMatlab' UserExtension process. I am using Simio 8, MATLAB 2019a, and Windows 10, following the process introduced here: The problem is that when Simio is trying to call MATLAB function, some files are not registered and a certain dll cannot be found. Has anyone met such a problem before? Or is there anyway to write the CallMatlab myself? Thank you. Shu
×
×
  • Create New...