question

Murphy avatar image
0 Likes"
Murphy asked Murphy published

port num issue

1662347661275.png

hi, I want cycletime was different by influenced inputport in Processor1, something like, if from Queue1 then cycletime is ten, if from Queue2 then cycletime is five. I dont know how to do that. please help to me. thanks guys.

FlexSim 22.0.0
differet cycletime by port
1662347661275.png (261.0 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.

Iago MF avatar image
0 Likes"
Iago MF answered Murphy published

Hi!

Instead of trying to read the port which the item came from, a simple solution is setting a label with the processing time in the item at each queue (using a trigger in each queue), then, you can read that label in the processor and use it as the processing time.

You could also set a label in the entering items at the processor with the trigger "On Entry":

1662360392382.png

Then, you can set "Values By Case" in Process Time field:

1662360527222.png


I hope it helps you.



1662360392382.png (20.3 KiB)
1662360527222.png (34.2 KiB)
· 9
5 |100000

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

Felix Möhlmann avatar image Felix Möhlmann commented ·

Edit: Iago beat me by two minutes. I'll leave the screenshots here for visual reference.

Setting the label on the item.

1662360285116.png

Then use that label in the "Values By Case" option of the process time.

1662360363789.png

0 Likes 0 ·
1662360285116.png (10.1 KiB)
Iago MF avatar image Iago MF Felix Möhlmann commented ·

I saw you answer after editing mine, i promise :)

0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Iago MF commented ·
Never mind. When I send my answer I only saw your unedited one. The site probably doesn't update immediately
0 Likes 0 ·
Murphy avatar image Murphy Felix Möhlmann commented ·

1662361075951.png

I want code in Processor Time, something like:

get a API like: int port = a function can get inputportnum;

if (port == some condition){ return 10s;}

else{ return 5s;}

then we can direct write code in Processor and will be flexible, if I want some condition ports are 10s, others are 5s. could you know how to do that? thanks professor.

0 Likes 0 ·
Murphy avatar image Murphy commented ·

1662361075951.png

I want code in Processor Time, something like:

get a API like: int port = a function can get inputportnum;

if (port == some condition){ return 10s;}

else{ return 5s;}

then we can direct write code in Processor and will be flexible, if I want some condition ports are 10s, others are 5s. could you know how to do that? thanks professor.

0 Likes 0 ·
1662361075951.png (243.0 KiB)
Felix Möhlmann avatar image Felix Möhlmann Murphy commented ·
When the process time is evaluated the information about which port the item entered through is not available anymore. That is why both of us suggested to store it on a label on the item.
1 Like 1 ·
Murphy avatar image Murphy Felix Möhlmann commented ·

so they cant judgement when code in Processor time and have not related function to get a portnum. if the model process was complex used the labels way will be more than complex, so I want find another ways to solve this problem.

0 Likes 0 ·
Show more comments
Murphy avatar image
0 Likes"
Murphy answered Felix Möhlmann commented

I got a solution, we can code in setuptime, because of it have relvent API about port, so we just use way: Object.find("PATH about cycletime").value, then will be flexible in some conditions. some code under the graph. please reference and modified if get wrong.

1662368847968.png



1662368847968.png (40.7 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.

Felix Möhlmann avatar image Felix Möhlmann commented ·
Yes, you can do this. You could also do this in the OnEntry trigger. I mostly try to first suggest options that work with just the pre-defined options FlexSim provides, so I omitted this so far.

One note though: If the processor can work on multiple items at once there might be a case where the cycle time is set wrong if two (or more) items enter at the same time because the second item overwrites the cycletime again before the process for the first is started. I say 'might' because I'm not actually sure in what exact order the codes are evaluated.

0 Likes 0 ·