bcallaghan avatar image
bcallaghan asked Jeanette F commented

Custom Process Time using Code and excel sheet

Modeling a high mix, low volume environment. I need a processor to adjust its process time based on the part number that arrives at the processor. My thought was to use the custom code function and create an IF structure to differentiate and determine the correct process time. I want to reference an excel sheet as a database for finding the respective time standard to use for the process time. Any thoughts on how to do this? It's been a minute since I've done much coding so need help there. Thanks!

FlexSim 21.2.4
flexscriptcustom codeprocess timecoding
· 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.

Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @bcallaghan, was Kavika F's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always comment back to reopen your question.

0 Likes 0 ·
Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @bcallaghan,

We haven't heard back from you. Were you able to solve your problem? If so, please add and accept an answer to let others know the solution. Or please respond to the previous comment so that we can continue to help you.

If we don't hear back in the next 3 business days, we'll assume you were able to solve your problem and we'll close this case in our tracker. You can always comment back at any time to reopen your question, or you can contact your local FlexSim distributor for phone or email help.

0 Likes 0 ·

1 Answer

Kavika F avatar image
1 Like"
Kavika F answered Kavika F commented

Hey @bcallaghan, this logic is built into FlexSim processors already so you don't have to make it yourself! Here's an example model to demonstrate this.



I started by making a simple GlobalTable with types and times.


Then I setup my 3D model.


If you click on the processor, you can change the processing time to be based upon a Global Table Lookup. This one looks at the table I made, gets the row by type of item, and gets the column I specify (in this case, PTime is col 2).


If you want to import your data from Excel, you can do that using the Excel Import/Export tool in the Toolbox.


You can setup your import to look at a specific workbook and sheet name. In the Table Data section, use the sampler dropper to select the table you want to load the info into. I made a second Global Table "ImportedProcessingTimes" to send my data to. Then select Import Tables.


Then you would simply need to click on the processor and switch to using the table you want for your processing! If your data changes in the excel file, you can always reimport.

Hope this helps.

· 3
5 |100000

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

bcallaghan avatar image bcallaghan commented ·

Thanks! Just saw you posted this answer. I'll give it a shot and see if it solves my problem.

0 Likes 0 ·
bcallaghan avatar image bcallaghan commented ·

@Kavika F I tried your solution. However, after linking the global table using the lookup option within the process time, it is now setting the process time to zero instead of the time designated with that part number in my global table. Thoughts? Is there something else I need to do ensure it reads the kit label properly and thus processes at the correct time? Thanks

0 Likes 0 ·
Kavika F avatar image Kavika F ♦ bcallaghan commented ·
Hey @bcallaghan, could you provide a model that demonstrates this behavior? Or screenshots? I don't know what's going wrong if I can't see it. Thanks!
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.