Replicating a 3D source in Process Flow

Replicating a 3D source in Process Flow

robert_hambright
Not applicable
219 Views
8 Replies
Message 1 of 9

Replicating a 3D source in Process Flow

robert_hambright
Not applicable

[ FlexSim 16.2.0 ]

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

0 Likes
Accepted solutions (1)
220 Views
8 Replies
Replies (8)
Message 2 of 9

matt_long
Not applicable

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, itemname);
}

Message 3 of 9

robert_hambright
Not applicable

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
Message 4 of 9

matt_long
Not applicable

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, itemname);
}



0 Likes
Message 5 of 9

robert_hambright
Not applicable

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
Message 6 of 9

sam_stubbsYXX86
Community Manager
Community Manager

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

Message 7 of 9

robert_hambright
Not applicable

Definitely helpful, thanks a lot!

0 Likes
Message 8 of 9

regan_blackett
Autodesk
Autodesk
Accepted solution
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.

Message 9 of 9

robert_hambright
Not applicable

Awesome, thanks!!

0 Likes