In this example, we'll show you how to set a processor's Process Time dynamically based on a cell in a Global Table.
Create a Simple Model
- Create the simple model as shown above.
- Add a Global Table through the Toolbox Add > Global Table.
- Change the name of the table to ProcessingTimes.
- Right click the first cell and column (0.00) of the Global Table and select Assign String Data.
- Enter the following text:
exponential(0, 20, 0)
Arranging Windows
In FlexSim, windows can be arranged in any configuration. Though there are multiple ways to sample a cell in a Global Table, we will look at just one way.
- Click and drag the ProcessingTimes table tab to "pull" the Global Table window out of the docked view.
- While still holding the mouse down, drag the mouse over the Dock Windows icon that has appeared in the middle of your main window.
Your main document window will now have your 3D view on the left and your Global Table on the right.
Sample a Global Table Cell
- In the 3D view, click on the Processor object to display its properties in the Quick Properties window.
In the Quick Properties window you'll see a Processor section.
- Click the next to Process Time to enter "Sample Mode".
- Click on the first row and column of the ProcessingTimes Global Table to reference that cell.
The Sampler will automatically insert the correct line of code for referencing the Global Table cell. Notice that the value the Sampler was looking for was a number (Process Time) and the Global Table cell contained string data. The Sampler automatically added in an executetablecell() command in order to return a numeric value from the cell, in this case exponential(0, 20, 0).
Reset and Run the model to see how it works.