& Construction

Integrated BIM tools, including Revit, AutoCAD, and Civil 3D
& Manufacturing

Professional CAD/CAM tools built on Inventor and AutoCAD
Integrated BIM tools, including Revit, AutoCAD, and Civil 3D
Professional CAD/CAM tools built on Inventor and AutoCAD
Use a two-layer schedule to create Main ID and Sub ID tokens in a process flow.
Type:
Tutorial
Length:
7 min.
Tutorial resources
These downloadable resources will be used to complete this tutorial:
Transcript
00:03
In FlexSim, a two-layer schedule allows you to manage processes with both Main IDs and Sub IDs,
00:10
efficiently coordinating the arrival of both types of tokens.
00:13
An example of a Main ID is a container, an order, or a test tube,
00:19
while the Sub IDs might be the pallets or cases that make up containers or orders, or the tests that are run on test tubes.
00:27
Here, you can see an Input table with a series of 25 CONEX containers.
00:33
Each container has a set SKU, and each SKU is assigned an arrival time and a quantity.
00:41
In the ProcessFlow, there are three flows that control how the two-layer schedule operates.
00:47
The ScheduleControlProcess manages the control token, which references the Input table to drive the Main ID and Sub ID arrivals.
00:55
The Main ID process flow controls the Main ID tokens, and the Sub ID process flow controls the Sub ID tokens.
01:04
The control token is the only token created when the model is reset, so you start with one token, which needs to be set up.
01:12
In the ProcessFlow, select SetupSource.
01:15
In the Quick Properties, enter the corresponding information that ties this flow to your Input table,
01:21
including the name of the table that the process flow will reference, and the column number for the MainID, SubID, Time, and Quantity.
01:31
As you can see in the Input table, the rows are not sorted by Container, which is the Main ID, but by Time.
01:38
This is not optimal to run the process flow.
01:41
Therefore, the first thing the control token is set to do is to sort the table by the Main ID, and then by the Time.
01:49
To view the code for this trigger, in the ProcessFlow, click SortTableByMainID, then click Add/Edit this trigger’s operations.
01:59
Here, the code instructs the control token to reference the Table and use the .sort function to sort by the column with the MainID,
02:06
and then by the column with the Time.
02:08
The 1 indicates that the token will sort from smallest to largest.
02:13
To view this in action, click in the table, then, in the Simulation Control Bar,
02:18
click Step until the control token has executed the SortTableByMainID activity.
02:24
Now, the table is sorted and grouped by the Main ID, or Container; and within each of those groups, by Time.
02:32
The Control token will now move on to read each row in the table to identify unique Main IDs,
02:38
count the number of Sub IDs for each, and then generate a token for each Main ID, including the appropriate labels.
02:46
Here, Step is clicked repeatedly to step through this process.
02:51
First, a unique Main ID is identified.
02:55
Then, labels are set up to count the Sub IDs.
02:58
The control token steps back and forth between counting Sub IDs and checking the next row for a unique Main ID,
03:05
until it encounters a new Main ID in the sixth row.
03:09
Then, the control token moves to the CreateMainIDToken activity.
03:14
Click the token to review the labels that will be used to set up the MainID token,
03:19
then Step forward again.
03:22
The token now arrives at the MainIDProcess flow.
03:26
Click the created token in this flow to view its Labels in Properties.
03:30
Here, you can see that the token started at row 1, ended at row 5, includes 5 Sub IDs, has a Main ID of CONEX_00001,
03:42
and has an arrival time of .18 seconds.
03:45
Skipping forward, the control token will continue to loop through the schedule until all Main ID tokens are created.
03:53
Notice that there are some Sub ID tokens already created.
03:57
This is because one Main ID token was set to arrive at Time 0, so the process flow already generated the Sub ID tokens for this Main ID.
04:07
Next, Step forward in the Main ID process flow to see the Sub ID token creation process.
04:13
The token with the next arrival time—in this case, .18 seconds—informs the control token that the Main ID has started,
04:22
then moves on to create a Sub token for each of its Sub IDs.
04:26
Click the first Sub ID token to view its Properties.
04:30
Here, you can see that the Sub ID is set up with Labels to indicate the table row, the SKU, and the quantity.
04:39
There is also an arrival time that indicates the number of seconds past the arrival of the Main ID before they can start.
04:46
Here, this is 0, because it arrived 0 seconds after the Main ID token.
04:52
The first row is always 0, but if you click the second Sub ID token,
04:57
you see that the arrival time is equal to the Time in the table minus the .18 arrival time of the first Sub ID token.
05:05
The Main ID token will repeat the same process until all Sub ID tokens have started,
05:11
then it will inform the control token and both tokens will drop down into storage.
05:16
This two-layer schedule demonstrates how a control token can create Main ID and Sub ID tokens efficiently,
05:23
in a way that allows you to track those tokens later on through the model.
05:27
Using this setup, you can also capture the time it takes to complete activities—
05:32
—for example, you can record the time from the model start to the arrival of the final Sub ID,
05:38
or you can capture the stop time for the model.
05:40
Additionally, lists are used in this scenario to enable communication
05:45
and tracking between the flows by appropriately pushing and pulling tokens between the lists and informing the control of list progress.
05:53
For example, when the Sub ID process starts, the list is set to use the Main ID as the partition,
05:59
so that multiple children can pull from the list.
06:02
Likewise, at this step in the process, instead of one control token, multiple control tokens pull from the list as well.
06:10
Each control token represents a list partition, or Main ID.
06:15
Each child partitions off of its parent, allowing the Sub IDs to inform the Main IDs and the Main IDs to inform the control IDs.
06:25
The process reviewed here is a simple setup; once the Sub ID tokens are started, the process ends.
06:32
However, you can use this model with more complex processes.
06:37
For example, the tokens can move on to a processing step where they enter a conveyor or must get to a certain location,
06:44
or the Main ID tokens can be set up to wait for a dock to unload the cases of Sub IDs.
06:50
These are just a few examples of additional uses for this type of flow.
06:55
Now you can use the two-layer schedule creation process to efficiently create Main ID and Sub ID tokens.
Video transcript
00:03
In FlexSim, a two-layer schedule allows you to manage processes with both Main IDs and Sub IDs,
00:10
efficiently coordinating the arrival of both types of tokens.
00:13
An example of a Main ID is a container, an order, or a test tube,
00:19
while the Sub IDs might be the pallets or cases that make up containers or orders, or the tests that are run on test tubes.
00:27
Here, you can see an Input table with a series of 25 CONEX containers.
00:33
Each container has a set SKU, and each SKU is assigned an arrival time and a quantity.
00:41
In the ProcessFlow, there are three flows that control how the two-layer schedule operates.
00:47
The ScheduleControlProcess manages the control token, which references the Input table to drive the Main ID and Sub ID arrivals.
00:55
The Main ID process flow controls the Main ID tokens, and the Sub ID process flow controls the Sub ID tokens.
01:04
The control token is the only token created when the model is reset, so you start with one token, which needs to be set up.
01:12
In the ProcessFlow, select SetupSource.
01:15
In the Quick Properties, enter the corresponding information that ties this flow to your Input table,
01:21
including the name of the table that the process flow will reference, and the column number for the MainID, SubID, Time, and Quantity.
01:31
As you can see in the Input table, the rows are not sorted by Container, which is the Main ID, but by Time.
01:38
This is not optimal to run the process flow.
01:41
Therefore, the first thing the control token is set to do is to sort the table by the Main ID, and then by the Time.
01:49
To view the code for this trigger, in the ProcessFlow, click SortTableByMainID, then click Add/Edit this trigger’s operations.
01:59
Here, the code instructs the control token to reference the Table and use the .sort function to sort by the column with the MainID,
02:06
and then by the column with the Time.
02:08
The 1 indicates that the token will sort from smallest to largest.
02:13
To view this in action, click in the table, then, in the Simulation Control Bar,
02:18
click Step until the control token has executed the SortTableByMainID activity.
02:24
Now, the table is sorted and grouped by the Main ID, or Container; and within each of those groups, by Time.
02:32
The Control token will now move on to read each row in the table to identify unique Main IDs,
02:38
count the number of Sub IDs for each, and then generate a token for each Main ID, including the appropriate labels.
02:46
Here, Step is clicked repeatedly to step through this process.
02:51
First, a unique Main ID is identified.
02:55
Then, labels are set up to count the Sub IDs.
02:58
The control token steps back and forth between counting Sub IDs and checking the next row for a unique Main ID,
03:05
until it encounters a new Main ID in the sixth row.
03:09
Then, the control token moves to the CreateMainIDToken activity.
03:14
Click the token to review the labels that will be used to set up the MainID token,
03:19
then Step forward again.
03:22
The token now arrives at the MainIDProcess flow.
03:26
Click the created token in this flow to view its Labels in Properties.
03:30
Here, you can see that the token started at row 1, ended at row 5, includes 5 Sub IDs, has a Main ID of CONEX_00001,
03:42
and has an arrival time of .18 seconds.
03:45
Skipping forward, the control token will continue to loop through the schedule until all Main ID tokens are created.
03:53
Notice that there are some Sub ID tokens already created.
03:57
This is because one Main ID token was set to arrive at Time 0, so the process flow already generated the Sub ID tokens for this Main ID.
04:07
Next, Step forward in the Main ID process flow to see the Sub ID token creation process.
04:13
The token with the next arrival time—in this case, .18 seconds—informs the control token that the Main ID has started,
04:22
then moves on to create a Sub token for each of its Sub IDs.
04:26
Click the first Sub ID token to view its Properties.
04:30
Here, you can see that the Sub ID is set up with Labels to indicate the table row, the SKU, and the quantity.
04:39
There is also an arrival time that indicates the number of seconds past the arrival of the Main ID before they can start.
04:46
Here, this is 0, because it arrived 0 seconds after the Main ID token.
04:52
The first row is always 0, but if you click the second Sub ID token,
04:57
you see that the arrival time is equal to the Time in the table minus the .18 arrival time of the first Sub ID token.
05:05
The Main ID token will repeat the same process until all Sub ID tokens have started,
05:11
then it will inform the control token and both tokens will drop down into storage.
05:16
This two-layer schedule demonstrates how a control token can create Main ID and Sub ID tokens efficiently,
05:23
in a way that allows you to track those tokens later on through the model.
05:27
Using this setup, you can also capture the time it takes to complete activities—
05:32
—for example, you can record the time from the model start to the arrival of the final Sub ID,
05:38
or you can capture the stop time for the model.
05:40
Additionally, lists are used in this scenario to enable communication
05:45
and tracking between the flows by appropriately pushing and pulling tokens between the lists and informing the control of list progress.
05:53
For example, when the Sub ID process starts, the list is set to use the Main ID as the partition,
05:59
so that multiple children can pull from the list.
06:02
Likewise, at this step in the process, instead of one control token, multiple control tokens pull from the list as well.
06:10
Each control token represents a list partition, or Main ID.
06:15
Each child partitions off of its parent, allowing the Sub IDs to inform the Main IDs and the Main IDs to inform the control IDs.
06:25
The process reviewed here is a simple setup; once the Sub ID tokens are started, the process ends.
06:32
However, you can use this model with more complex processes.
06:37
For example, the tokens can move on to a processing step where they enter a conveyor or must get to a certain location,
06:44
or the Main ID tokens can be set up to wait for a dock to unload the cases of Sub IDs.
06:50
These are just a few examples of additional uses for this type of flow.
06:55
Now you can use the two-layer schedule creation process to efficiently create Main ID and Sub ID tokens.
Sign in for the best experience
Save your progress
Get access to courses
Receive personalized recommendations
May we collect and use your data?
Learn more about the Third Party Services we use and our Privacy Statement.May we collect and use your data to tailor your experience?
Explore the benefits of a customized experience by managing your privacy settings for this site or visit our Privacy Statement to learn more about your options.