question

sachin tandulkar avatar image
0 Likes"
sachin tandulkar asked sachin tandulkar commented

Variable Load & Unload Time for

operator-load-unloadtime.fsm

I want operator to consume different loading and unloading time based upon the machine its loading/unloading and the item getting loaded/unloaded. I created a table with Column header as Machine name and Row header as Item name. But the operator is not consuming the desired time. In the operator LoadTime field I used the global table and asked it to pull the value from the item its carrying and the machine its going to load, but I am not able to return the Machine value. I will be able to solve the problem, if I can figure out how to get the machine its loading the part and unloading the part. using "current" is returning the operator not the machine. I am attaching the a small model, please help me figure out the solution.

Choose One
operaotor loadtime
5 |100000

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

Matt Long avatar image
1 Like"
Matt Long answered sachin tandulkar commented

If you open the Code Editor for the Load/Unload you'll see in the code header there are three objects defined:

treenode item = param(1);
treenode current = ownerobject(c);
treenode station = param(2);

The variable station is a reference to the object the item is being loaded into or unloaded from.

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

sachin tandulkar avatar image sachin tandulkar commented ·

Thanks Matt.

0 Likes 0 ·
Jeff Nordgren avatar image
0 Likes"
Jeff Nordgren answered sachin tandulkar commented

@sachin tandulkar

Sachin,

Attached is your model with the changes that I've made. As Matt mentioned in his reply, you need to use the "station" variable to reference which machine the operator is at. But also, when you reference a table row/col that is a number that should be used, not a row/col header name. So I changed your label on the flowitems to NameID and gave them a numeric value rather than an string. I also changed the labels on the processors to be numeric instead of a string. By changing them to numeric values, it is easy to reference the tables and retrieve the proper return values.

Take a look at the attached model and see if this method will work better for you.

operator-load-unloadtime-jn1.fsm


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

sachin tandulkar avatar image sachin tandulkar commented ·

Thanks Jeff.

0 Likes 0 ·