question

Robson T avatar image
0 Likes"
Robson T asked Jacob W2 commented

Realease box in processor by change variable

I need to pass a box in processor when my variable is equal 1, I try make the code in event On entry below:

/******************************************************************

Object current = ownerobject(c);

Object item = param(1);

int port = param(2);


int i = Test();


if(i == 1){

current.resume();

current.input.open();

}else{

current.input.close();

}

*******************************************************************/


I am using a user comand called Task(), it return 1 or 0, it is changed in User GUI.


The idea is when the Task() return 1, so we need to pass only one box, when Task() return 0, the processor start wait.


but this code no work, because the command "current.input.close()" stop the app, We need that the app continue running.




FlexSim 22.2.0
simulationemulationdigital shadow
· 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.

Jacob W2 avatar image Jacob W2 ♦ commented ·

Hi @Robson T,

It's hard to know how to help without looking at your model. To receive a more accurate solution, please post your model or a sample model that demonstrates your question.

You can upload your models or other files by appending ".jpg" to the filename. Files ending in .jpg are not effected by the bug. You can also upload your model and other files to FlexSim's file share site. Include the file name in your question so that we know which upload to reference.

Proprietary models can be posted as a private question visible only to FlexSim U.S. support staff. You can also contact your local FlexSim distributor for phone or email help.

0 Likes 0 ·
Jacob W2 avatar image Jacob W2 ♦ commented ·

Hi @Robson T, was Marco G8'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 unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

·
Marco G8 avatar image
0 Likes"
Marco G8 answered

Instead of a user command, you could use a Parameter and reference it on the send to port picklist. In the screenshot example, if the parameter is equal to 1, the box will go to the processor, if it is equal to 2, it will go to the sink. 1663267468717.png

If your intention is to make so the box gets stuck in the queue, you could use the same parameters and delete the queue's second output port (the one that goes to the sink).


1663267468717.png (50.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.

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.