Jump to content

User Programming for Alternative Sequences (Routings) FMS


brenobos
 Share

Recommended Posts

My name is Breno Souza and I have already done some questions on Simio User Facebook group about my model.

I am working in the Automation Strategies Laboratory of the Computing Department of Federal University of São Carlos.

As computer engineering students, we have to model more complex models in order to validate our researchs, using some dispatching rules for Automated Guided Vehicles using Genetic Algorithms, and we also use complex algorithm systems to the production scheduling using some ERPs integrated with the simulation model.


The suggested solution, by Mr. Sturrock, on the Facebook group, using decision nodes for each part type in each process production, means limiting our model, decreasing the flexibility of our factory and our programming possibilities, since that we cannot specify complex rules both for dispatching and routing.

We are mainly concerned about specifying manufacturing production sequences using programming, due our complex and several routing rules. We would like to know if is possible to control the simulation, mainly specifying routings, using some programme language. We have used Automod some years ago, and it was possible to specify alternative routings and some control logics using C++ programming. Is that possible in SIMIO? Are there examples on that? How can we integrate our model with some ERP or SCADA system? Would be possible doing that using some factory floor protocol, such as OPC?


My past doubts (posted on Simio Users Facebook group) are attached.


Yours faithfully,

Breno de Oliveira Souza

Computer Engineering Undergraduate Student

Researcher at Automation Strategies Laboratory

Federal University of São Carlos


----------------------------------------------------------

Hello everyone,


I'm a new SIMIO user and I have a problem on my model.

Let me give a brief explanation about my model.


I am modeling a Flexible Manufacturing System, where different parts are produced by different machines. I have many different entities (parttypes) that follow each one a different process sequence. Each part type pass through about 10 process. I have already seen examples where the sequence is modeled by using the sequence tables. However, my problem is due, for each process, a entity could be processed by different machines.


For example, the part type A has the following sequence:

M1 OR M2 -> M3 OR M4 -> M5 OR M6 OR M7 and so on..


I'd like to know how I can put this "OR" im my model...

I don't think I can use the sequence tables, since that I am not able to use expressions on that.


I really would appreciate if u could help me. If I wasnt understandable, pls let me know.


Thank you very much for your attention.

-------------------------------------------------------------

Link to comment
Share on other sites

I suggest using Node Lists column in a table (see attached example) instead of using a sequence table, I setup a routing table with steps (representing sequences). The route table is a child of the entity table. The sources in the model are setup to reference row 1 of the entity table in Source1 and row2 of the entity table in Source2.


Each step in the route table is associated to a node list....The node lists represent the "OR" condition. If the node list has Input@Server1 and Input@Server2, the transfer node will use the list to either sent it to Input@Server1 or Input@Server2 based on the selection goal. In the attached model, the selection goal "Smallest Value" and the selection expression is "Candidate.Node.AssociatedStationOverload"....This represents the sending the entity to the server least available input buffer capacity. I think this handles the scenario you explained.



As for integrating with OPC, I would suggest looking at this example:


http://www.simio.com/forums/viewtopic.php?f=12&t=1381


It shows how to build custom steps and firing events using .NET code. If you wanted to communicate with OPC, you would use a custom step to read the OPC server. If you want the OPC server to interact with Simio. you would call a custom event.


It is possible to setup the same of integration with an ERP system; although it is not recommended. For ERP integration, I would recommend using a data table with data binding. Since the data in an ERP system is much more static, it can be loaded at the beginning on the model run. Then the data can be referenced in the data table during the simulation run.

RouteByNodeListsModel.spfx

Link to comment
Share on other sites

Thank you very much Mr. Glen Wirth.

The suggested solution to the alternative routes worked very well.


In our researches, we have to use more complex algorithms in order to both choose the machine and the AGV to be requested.

For instance, I can choose which machine will be the next (from the nodelist) by using Fuzzy Logic and several variables at the same time, such as input buffers, output buffers, distances and so on. Is there some example of using the .NET code in order to define new rules, instead of simply the "Smallest Value First", etc? How can I insert these rules in my model?


Regarding the "Schedule and Fire Events...Update states while model is runs" Example, I couldn't open the models, since that my Simio License is Academic.

Could you save that in an Academic Version, please?


Thank you for your consideration.

Link to comment
Share on other sites

When you install Simio, we provide .NET code that for dynamic selection rules.. This code is located at:


C:\Users\Public\Documents\Simio\Examples\UserExtensions\SimioSelectionRules


This the same code the implements the Campaign Cycle, Campaign Down, Campaign Up, Largest Value First and Smallest Value First dynamic selection rules in Simio. You can modify this code to create your own rules.. These rules can include additional properties that can be used when evaluating. Attached is the same SimioSelectionRules project with 2 additional selection rules (Largest Value First Time Fence and Smallest Value First Time Fence). These additional rules include a Time Fence...In this example, we use the Time Fence to only select entities are are within "x" days of the entity with the smallest due date in the queue. NOTE: If you choose to run the solution / project, you should load Visual Studio as "Run As Administrator". You will need this permission to compile the DLL into the C:\Program Files (x86)\Simio\UserExtensions\SimioSelectionRules\ folder.



You also can implement your complex algorithms using a custom step. I have update the "Schedule and Fire Events" model so it can be opened in academic editions. The updated model is located at:


http://www.simio.com/forums/viewtopic.php?f=12&t=1381


This will provide an example on how Simio integrates with .NET using a custom step.

SimioSelectionRules.zip

Link to comment
Share on other sites

Thank you Mr. Glen Wirth,


I have generated the .dll file both to my rule and to your rule example, but I cannot select them into SIMIO. After generating the .dll file, how can I use the new rule in my SIMIO model?


Thank you for your attention.

Link to comment
Share on other sites

What license of Simio do you have? You need at least a Student license to use the custom DLLs.


Make sure the custom step DLL is placed into Documents\SimioUserExtensions


Make sure the custom selection rule DLL is placed into C:\Program Files (x86)\Simio\UserExtensions\SimioSelectionRules. The selection rules should show up on the server as a Dynamic Selection Rule.

Link to comment
Share on other sites

Thank you Mr. Glen Wirth. I have found the new rules on SIMIO in Servers and Vehicles, as shown in the figures attached. However, in order to program the routing, I have to be able to change the Selection Goals (maybe as dynamic selection rules) at the nodes, which are my point decisions, as suggested by you at first time (as shown in the figure DynamicRuleAtNode). Could be possible to change these selection goals too, in the same way I change the dynamic selection rules? As the nodes are my point decisions, I have to dynamically routing my production programming on its. It would be much simplier if I could create a new selection goal.


Another issue is that I have created a new selection rule for dispatching to use in the vehicles, using the MWArray.dll in my .NET code to implement some Fuzzy Logic. However, the SIMIO pointed a problem when I runned it, saying that it couldn't find this dll. When I debug the .NET code, the Visual Studio automatically copied this DLL to the DynamicSelectionRules folder, on the SIMIO directory. Have I to copy the auxiliary DLLs (such as MWArray.dll) to another place on SIMIO directory?


My model is attached.


Thank you very much for your atention.


Best Regards,

Breno.

DynamicRuleAtNode.thumb.jpg.7b2ec9a46718dca560d62cf0e5233cf6.jpg

DynamicRuleAtServer.thumb.jpg.cecd53a08436f859a3d9e432d9ce746f.jpg

DynamicRuleAtVehicle.thumb.jpg.d4a39a01c9cf8719723b85281ae7f270.jpg

FMS v0.0.1.1.spfx

Link to comment
Share on other sites

There is not a way to add custom selection goals. The easier way to provide the node selection in .NET code is using a custom step. I have added a custom step called 'CustomRouteStep" in the attached VS project. The step is real simple. It has an expression and a state. Based on the value of the expression, the state will be populated with the value. Then, the state can be used to select which node on a node list to use. The entity will be routed to the selected node. In this example, a state value = 1 will route the entity to Server1 and a state value = 2 will route the entity to Server2.



In your implementation, you would need to build the logic to determine what node to route the entity. Then, you would return the correct node in a state. The state would then be used to find the right node to select in Simio.


See attached model and VS code.

ScheduleAndFireEvents.zip

ScheduleFireEventsCustomRoute.spfx

Link to comment
Share on other sites

Thank you so much Mr. Glen.


Opening your model, it appeared the following message: File was opened with warnings: This file was save in a later version of SIMIO and thus may not run properly... Then I click on OK button and the RUN button is disable. (My version is 5.91.10320)


I have executed the VS solution and then copied the .dll file into SIMIO directory. However, in the SIMIO, it is showing an error (shown in the picture below)


How can I solve this error and then run the model??


Thank you very much for your consideration.

Breno.

error.thumb.jpg.f56b93bbdef024bf43490fc1d2654cda.jpg

Link to comment
Share on other sites

I'm very sorry for being insistent, but I really would appreciate if you could help me.


I have three questions regarding my model.


1 - I have created a new dynamic selection rule for dispatching to use in the vehicles, using the MWArray.dll in my .NET code to implement some Fuzzy Logic. However, the SIMIO pointed a problem when I runned it, saying that it couldn't find this dll. When I debug the .NET code, the Visual Studio automatically copied this DLL to the DynamicSelectionRules folder, on the SIMIO directory. Have I to copy the auxiliary DLLs (such as MWArray.dll) to another place on SIMIO directory?


2 - Would be possible to create a new Ranking Rule for the Vehicle Resource Logic, such as we did with the dynamic ones? If yes, how could I do that?


3 - If it is not possible to create or establish a new Ranking Rule, we would like to use custom steps in order to ranking the jobs to vehicles, but would necessary to disable the ranking rule property in the Vehicle Resource Logic. How could we replace the "ranking rule option" by the custom step?


-- The issue is that we have more complex ways to make the ranking rule decision than simply FIFO (First In First Out), LIFO and so on.


Thank you very much for your attention.


Breno.

Link to comment
Share on other sites

As I referenced in the above post, you need to use a custom step. We do not have custom selection rules for vehicles.


When you create a custom step, you need to place a folder called "SimioUserExtensions" under your Documents folder.


Typically, the folder is located at C:\Users\\Documents\SimioUserExtensions


Just put your DLL in this folder. Do not include any of the Simio DLLs. They will be referenced in the C:\Program Files (x86)\Simio folder.

Link to comment
Share on other sites

×
×
  • Create New...