Jump to content
Simio Forum

Schedule and Fire Events...Choose Route

Recommended Posts

This post show how to Schedule and Fire Events using custom step. It also shows how to update states using these events while the model is running...Updating states can be used to have an entity choose a route in a model.

1) ScheduleAndFireEvents_DLL.zip - Extract, move to and unlock into the following folder C:\Users\\Documents\SimioUserExtensions

2) ScheduleAndFireEvents.spfx - Model that shows the scheduling and firing of events. (2013-10-07...Updated Mode...Model now can be opened in academic editions).

3) ScheduleAndFireEvents_Code.zip - Code for the schedule and fire of event steps.

2014-01-13 - This has been updated to show how to add a dialog within a step to choose a route for the entity.

2014-10-03 - Updated Code and Model to make sure it worked with Simio 6.111




Share this post

Link to post
Share on other sites

1) ScheduleAndFireEvents_DLL.zip contains the DLL needed for the custom steps and elements. This DLL needs to be placed in the C:\Users\\Documents\SimioUserExtensions folder. Make sure you UnBlock the DLL (right-click and select properties) before trying to use it.

2) ScheduleAndFireEvents.spfx is a sample model that shows how to use the custom steps and elements built in the DLL. Only 1 and 2 are needed to get the example running.

3) ScheduleAndFireEvents_Code.zip contains the code that was used to create the DLL. The code was developed based on the Visual Studio templates that come with Simio.

Can you provide more detail on what you are trying to achieve?

Share this post

Link to post
Share on other sites

The main concepts being shown in this example are:

1) FireEventsFromStep.png....This shows how to use a custom step to fire events in c#. The events are attached to an element. Once fired, the events will be sent back to the Simio model during runtime. The step also returns the number of entities to create in the OutputState.




2) EventFireFromC#.png....This shows the event from C# being received in the model. The event is being received by the Source. The source will be triggered to create entities. The number of entities to create is provided by the OutputState.




3) UpdateStateFromC#Code.png....This shows a step being called during runtime. The c# code will load a form and enable the user to pick a route for the entity. Based on what is select, either 1 or 2 is returned into the ListIdx state. Then, logic in the model will route the entity based on the return value.



Share this post

Link to post
Share on other sites

Hello Glen: I unzipped all (ScheduleAndFireEvents_Code) files and placed them in a folder on my PC. Then I tried opening the ScheduleAndFireEvents.sln using the visual studio 2017 but it seems not to load. Message in the Solution Explorer window says 'ScheduleAndFireEvents(unavailable)'. I get the same results when I try to open the .csproj file.

Is this due to version as the example was developed in 2014 and I am using the 2017 Visual Studio?

In case you are wondering why - I am currently working on exploring Simio's capability to interface with outside modules for information exchange.

I explored User defined Read/Write steps but they work only in a batch mode.



Share this post

Link to post
Share on other sites