question

Mehdi K2 avatar image
0 Likes"
Mehdi K2 asked Jason Lightfoot edited

"Delay" Custom Command

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.

Choose One
processflowdelaycommands
5 |100000

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

1 Answer

Joerg Vogel avatar image
1 Like"
Joerg Vogel answered Jason Lightfoot edited

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.

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

Jason Lightfoot avatar image Jason Lightfoot ♦♦ commented ·

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);
2 Likes 2 ·
Mehdi K2 avatar image Mehdi K2 commented ·

thanks @Jörg Vogel, for your answers.

0 Likes 0 ·