Can processing times be assigned to the processors using code(flexscript)?

Can processing times be assigned to the processors using code(flexscript)?

suhas_h2
Not applicable
289 Views
9 Replies
Message 1 of 10

Can processing times be assigned to the processors using code(flexscript)?

suhas_h2
Not applicable

[ FlexSim 19.0.2 ]

I want to assign the processing times to the processor using flexscript. Can that be done?test1.fsm

0 Likes
Accepted solutions (1)
290 Views
9 Replies
Replies (9)
Message 2 of 10

Matthew_Gillespie
Autodesk
Autodesk

@Suhas H2,

The way this is generally done is to have the processors read their processing time from a global table. Then you can use flexscript to write different values to the global table.



Matthew Gillespie
FlexSim Software Developer

0 Likes
Message 3 of 10

suhas_h2
Not applicable

Can you please attach an example of how that is done?

0 Likes
Message 4 of 10

tanner_p
Not applicable
Accepted solution

Hi @Suhas H2,

Here's an example of what Matthew was describing. In the model, the Process Time is accessing Global Table values based on item.Type. When the model starts, the green items process slowly, while red items process quickly. Then, you'll notice that after 10 items have been processed, the Custom Code activities in Process Flow change the values in the Global Table such that red items now process slowly, while green items process quickly. Please review the code in the Processor as well as the Custom Code activities in Process Flow to understand and implement this in your models. Thanks!

How to access Global Table:

18571-process-time-by-case.png

How to dynamically update Global Table (and, effectively, Process Time):

18572-update-global-table.png

Model: update-global-table-dynamically.fsm

0 Likes
Message 5 of 10

suhas_h2
Not applicable

18580-capture.png

Hi @Tanner Poulton

Thanks for the reply...

What if I have 50-100 Processors in line? All this have to be done for every single of them?

Is there any way to do using flexscript? I tried this code but not getting desired output.

0 Likes
Message 6 of 10

joerg_vogel_HsH
Mentor
Mentor

The process time isn’t just a value. It is the return value of a script by itself. The script is stored at a node.

18582-process-time-not-a-value.jpg

You can copy the node of the script to every processor. If you must transfer the same script code of the process time from an highlighted object (yellow frame) to selected objects (red framed objects) you use the tool edit selected object under the View main menu.

18583-tool-edit-selected-objects.jpg

In the manual look at Copying and Pasting 3D Objects And Properties under the headline Using the Edit Selected Objects Tool. and especially there the text box Copy Specific Variables.

0 Likes
Message 7 of 10

suhas_h2
Not applicable

@Jörg Vogel

Thanks for the reply...

I agree with you on this. But can that return value of the script in processor be made dynamic by using flexscript only is my question.

0 Likes
Message 8 of 10

Matthew_Gillespie
Autodesk
Autodesk

Does each processor have its own unique processing time? Or do they all use the same time?



Matthew Gillespie
FlexSim Software Developer

0 Likes
Message 9 of 10

suhas_h2
Not applicable

Each processor have there unique processing times.

0 Likes
Message 10 of 10

joerg_vogel_HsH
Mentor
Mentor

You can’t directly make it dynamically. You can replace the return value by a reference as a substitute. This reference can be a table cell value, a label value, a node value. You change the reference value und thus you make the process time dynamically.

0 Likes