question

Marco Casavecchia avatar image
0 Likes"
Marco Casavecchia asked tannerp commented

Is it possible to link MRP data to Flexsim model ?

Hello,

My question is related to MRP data: inventory and demand forecast, in relation to the sources in the model.

How can I link the "on-hand inventory" in the sources I am using for my model?

Also, If my product is made of 10 items in it's BOM, do I have to have 10 sources to reflect that?

Thanks,

Marco

FlexSim 17.2.5
source scheduleinventorydemandmrp
· 7
5 |100000

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

tannerp avatar image tannerp commented ·

The best way to link your data would be through Global Tables. Do you have any experience with importing tables into FlexSim? Once you've imported a table with all your quantity and label data, you can have the Source reflect that in its production. There's many ways to access table data, however, so I'm afraid I can't give an example without knowing more about your data. Perhaps you could upload your files in a private question if you need further help.

Additionally, you can have 10 sources or use Process Flow to create those 10 items in your BOM. To achieve this using Process Flow, you'd just use Create Object activities after sources. Let me know if you have more questions about this.

1 Like 1 ·
Marco Casavecchia avatar image Marco Casavecchia commented ·

@Tanner Poulton,

Thanks a lot for your answer. I have no experience in uploading Global Tables. My goal is to know how much of each components of my BOM I have consumed during the simulation run.

To do that, I am thinking of:

1/ Import BOM items and QTY in 1 table

2/ Link each finished flow item to the same table and multiply?

Are there any other methods to do "inventory management" in FlexSim? My ERP can extract tables in csv format.

Thanks,

Marco

0 Likes 0 ·
David Seo avatar image David Seo Marco Casavecchia commented ·
@Marco Casavecchia

You should know how to control 'Global Table' of flexsim for the purpose of your doing with BoM and on-hand inventory.

Or if you do not use your BoM data, you can use the process flow template of 'Material Consumption and Replenishment'

0 Likes 0 ·
tannerp avatar image tannerp Marco Casavecchia commented ·

Please review the custom code that dynamically updates the Global Table (which could be used as a BOM). Whenever an item is processed, the inventory for that item's type is decremented by 1. Obviously, this model is incomplete, but hopefully you can apply the concepts from it to your own model and make it work.

Hopefully this helps! Global Tables can be very powerful tools and they're worth learning.

Model: inventory-bom.fsm

0 Likes 0 ·
Marco Casavecchia avatar image Marco Casavecchia commented ·

@Tanner Poulton

Thanks a lot for this inventory-bom code. It is very close to my need.

2 questions on the code itself:

- In the "OnReset" code: can the 500 value be taken from a table cell?

- In the "OnProcessFinish" code: how can I select from which "Type X" it will decrease of -1 as the simulation runs?

Thanks,

Marco

0 Likes 0 ·
Joshua S avatar image Joshua S Marco Casavecchia commented ·

To pull a value from a table cell, use:

int value=Table("GlobalTable1")[row][column];

Or do you mean pulled from one table and inserted into another?

The "Type X" right now is the Type label on the item coming in, so just edit the line

int row = item.Type;

so that you can select which row will be decremented.

1 Like 1 ·
Marco Casavecchia avatar image Marco Casavecchia commented ·

I have uploaded an example of what I would like to change in this custom code.

bom-inv-decremental-logic.xlsx

Basically, I need to be able to have something different than just -1 decremental qty. And also, be able to have quantities uploaded of on-hand inventory, instead of 500 for every item.

0 Likes 0 ·

1 Answer

·
tannerp avatar image
0 Likes"
tannerp answered tannerp commented

Hi @Marco Casavecchia,

I believe that the following updated model should accomplish what you are thinking. There are a couple things I changed.

First, since you have an Excel file now, I was able to use the Excel file for direct import upon model reset (meaning that when you update the Excel sheet, it will update your Global Tables in FlexSim). There's tutorials on how to use FlexSim Import/Export, so hopefully it's straightforward enough that you can pick it up quickly. You will have to change the directory for you model. Do this by clicking the (...) next to Excel Workbook and identifying your Excel sheet.

Second, once you have imported your Global Tables, you'll need to change the code so that you're accessing the current INV value and then subtracting the BOM value from it. I think you called this "- X". The new script for the OnProcessFinish Trigger looks like the image below. Note that I used two row and column values in case you choose to alter those.

Hopefully this helps. Of course, you're probably going to need to designate more functions, such as what happens when the INV levels are insufficient and such. This will all require using a lot of custom code. Before taking on a large model, you might consider talking to your local distributor about consulting. There are many ways to utilize FlexSim and we would hope you can find the best one for your simulation.

Model: bom-inventory.fsm


· 2
5 |100000

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

Marco Casavecchia avatar image Marco Casavecchia commented ·

Hello @Tanner Poulton,

Thanks a lot, this is very close to my need.

One clarification I might have not made. When the Processor1 is outputting 1 item, the change in INV should be : (with N being the last qty in the Inv column)

Item 1 = N-2

Item 2 = N-1

Item 3 = N-1

Item 4 = N-10


These 4 subtractions should,happen every time Processor1 output qty 1

Right now, the model is doing one item after the other only.

Thanks,

Marco

1 Like 1 ·
tannerp avatar image tannerp Marco Casavecchia commented ·

Instead of using item.Type, just update the code to run a "for()" loop for each row in the table. That way, it will decrement each row for each item. Hopefully this helps. Please see updated model attached.

bom-inventory-update.fsm

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.