question

Abhay Bajpai avatar image
0 Likes"
Abhay Bajpai asked Jeanette F commented

To access 'Map' label from Station on Conveyor belt

I want to the processing time at conveyor station to be the number from a Map array "cycleTimeMap" at every station corresponding to the 'modelID' of the generated flow item at source. For example, if the station is "M1A", then it should look for all parts that need to be created in the label called "partMap" of station and then check the corresponding cycle time value for each of those parts in the list of "partMap" in the label "cycleTimeMap". If there is only 1 part, then the same number should be chosen but if there are 2 or more than 2 parts in the list for modelID "M1A", then it should take the maximum one. I have circled the "cycleTimeMap" in the picture below. Also attached the model.

ChampionHomes_V8_6.fsm 1696531228031.png

FlexSim 23.2.0
labelsconveyor stationmap
1696531228031.png (120.5 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.

Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @Abhay Bajpai, was Jason Lightfoot's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always comment back to reopen your question.

0 Likes 0 ·

1 Answer

·
Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Jason Lightfoot edited

From champion-homes-assembly-making-replica-2-jl.fsm you had the expression for cycletime as:

current.cycleTimeMap.as(Map)[item.modelID]

This relied on the max processing time already being calculated as part of the cycletime map creation using this code from the original WriteStationMaps:

string sql="SELECT ModelName, MAX(ProcessingTime) FROM PTimeByPart WHERE StationID='"+stationID+"' GROUP BY ModelName";
Table result=Table.query(sql);
Map cycleTimeMap;
for (int n=result.numRows;n>0;n--)
    cycleTimeMap[result[n][1]]=result[n][2];
station.cycleTimeMap=cycleTimeMap.clone();


However I see that this has been rewritten for some reason. I would suggest reinstating the max processing time into the cycletimeMap if it's not there already and read it using the syntax above.

5 |100000

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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