question

Ankur A3 avatar image
0 Likes"
Ankur A3 asked Logan Gold commented

closeinput() is not working on model reset trigger?

Hi Team,

This is surprising for me to see that closeinput() command is not working on model reset trigger while it is working on object reset trigger.

1720782321223.png


Could you help me to resolve it?

Closeinput while model reset.fsm

Thank you!

FlexSim 23.1.2
closeinputmodel resetnot working
· 2
5 |100000

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

Joerg Vogel avatar image Joerg Vogel commented ·
Resetting a model is a sequence of preparing a model. And one step is to provide a port availability for any objects. If a global reset trigger event happens before object trigger events, then you get such a result you have watched. It is a matter of design.
1 Like 1 ·
Logan Gold avatar image Logan Gold ♦♦ commented ·

Hi @Ankur A3, was Regan Blackett'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

Regan Blackett avatar image
1 Like"
Regan Blackett answered Regan Blackett edited

Jorg is correct. One of the things that Objects do upon resetting the model is to open their own ports. It's why an input port connection turns from red to green when you reset the model.


The Model Reset trigger appears to happen before Objects open their own ports. If you put in a break point at the call to closeinput() and step through the code, you will see that the port gets closed properly, but when the trigger ends to the ports are reopened when the objects open their ports as part of their reset.

closeopen.gif

If you want to close ports on reset, you should either use the individual object On Reset trigger or you can use the statement

await Delay.seconds(0);

to put a zero seconds delay before the closeinput() call so that it executes after the other events that happen on reset.


closeopen.gif (706.7 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.