"Delay" Custom Command

"Delay" Custom Command

mehdi_k2
Not applicable
147 Views
3 Replies
Message 1 of 4

"Delay" Custom Command

mehdi_k2
Not applicable

hi,

I need the delay command in custom code. how can I apply the delay action exactly equal to delay block in process flow but in custom command?

(please if available, give me a piece of code!)

thanks in advance.

0 Likes
Accepted solutions (1)
148 Views
3 Replies
Replies (3)
Message 2 of 4

joerg_vogel_HsH
Mentor
Mentor
Accepted solution

This is not a command feature. You can do a similar construct with a delayed message and the On Message trigger. Or if you know FlexSim quite well you can create an event which execute your trigger once more and delay this event in event list. But a suspending command is not available in FlexSim.

Message 3 of 4

mehdi_k2
Not applicable

thanks @Jörg Vogel, for your answers.

0 Likes
Message 4 of 4

jason_lightfootVL7B4
Autodesk
Autodesk

The command delayednodefunction might be more useful than createevent.

Often the keyword 'c' will refer to the code itself (careful though, it's not always) so in that case you can call the same code after a delay with different parameters to indicate it's the second call with a simple expression. So if I was already passing in parameter 1 and 2 but wanted to test for the second call using paramter 3 the systax to set up that call after a 10 second delay would be this:

delayednodefunction(c,10,param(1),param(2),1);