question

Robert Hambright avatar image
0 Likes"
Robert Hambright asked Robert Hambright commented

Replicating a 3D source in Process Flow

I am not very experienced with process flow and I am having trouble replicating the 3D source in process flow.

I want the Process Flow source to create the same quantity of objects with the same labels and names as the 3D source. I tried creating a global table and indexing the token to try to name and label each box but it only names the first box and then returns an error.

How do I replicate the 3D source while still keeping the other process flow logic of deleting the objects in the rack after each scheduled arrival?

Thanks for the help!

Rob

example.fsm

FlexSim 16.2.0
process flowlabelstables
example.fsm (47.1 KiB)
5 |100000

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

Regan Blackett avatar image
2 Likes"
Regan Blackett answered Robert Hambright commented
clear-racks-manual-schedule-method.fsm

@Robert Hambright

Here's an updated version of the model that takes into account your desired table structure. Because of the way the events for the arrival table appear to be created, I needed a way for all the arrivals with the same arrival time to be created all at once, otherwise it throws off the stuff I had done to clear the rack of the "old" items.

I'm reading your global table with all the arrival data and assigning labels for arrivalTime, Name, itemType, and Quantity. There is also a label called "row" that tracks what row in the global table I should read from.

The first decision that is being made is whether or not the next shipment to create is has the same arrival time as the previous shipment, if it is I don't want to take anytime waiting for the next arrival, if it's not I do a delay for the time before the next arrival (EG. waiting from the time zero arrivals to the time 1440 arrivals and so on).

Next I check to see if the transporter is busy, just like before.

Where the items are being created I loop the token back to the assign labels to move to the next row, but notice the "More Rows?" decision that basically says if I have been all the way through the table, set the row to zero and start again; thus making the schedule a repeating schedule. To make the repeating a little easier, I put an additional row in the table for time 10080 with a zero quantity so that the second lap around row 1 happens at time 10080 as well.


· 1
5 |100000

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

Robert Hambright avatar image Robert Hambright commented ·

Awesome, thanks!!

0 Likes 0 ·
Sam Stubbs avatar image
1 Like"
Sam Stubbs answered Robert Hambright commented

I've included an example of how I would go about creating a scheduled source of items in Process Flow. Feel free to take anything you find helpful from this example.

example.fsm


example.fsm (25.9 KiB)
· 1
5 |100000

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

Robert Hambright avatar image Robert Hambright commented ·

Definitely helpful, thanks a lot!

0 Likes 0 ·
Matt Long avatar image
1 Like"
Matt Long answered Robert Hambright commented

When you have an array on a label and you say:

treenode item = getlabel(token, "item")

you only get the first item in the array. In order to set the names of all of the items, you'll want to make a for loop:

string itemname = gettablestr("MMRP", getlabel(token,"Row"), 2);
treenodearray flowitems = getlabel(token,"item");
for (int i = 1; i <= arraysize(flowitems); i++) {
	setname(flowitems[i], itemname);
}

· 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.

Robert Hambright avatar image Robert Hambright commented ·

This assigns each item a name, but the name is always the first one in the table. Is there a way to assign each name and label to the specified quantity of items in the table?

0 Likes 0 ·
Matt Long avatar image Matt Long Robert Hambright commented ·

If the label Row is the starting row you would say:

int startRow = getlabel(token,"Row");
treenodearray flowitems = getlabel(token,"item");
for (int i = 1; i <= arraysize(flowitems); i++) {
	string itemname = gettablestr("MMRP", startRow + i, 2);
	setname(flowitems[i], itemname);
}



0 Likes 0 ·
Robert Hambright avatar image Robert Hambright Matt Long commented ·

This now names them but skips the first row for item 1. I appreciate the help for getting the names correct, but my question is more geared toward replicating all parts of the source.

0 Likes 0 ·