Realease box in processor by change variable

Realease box in processor by change variable

robson_t
Not applicable
186 Views
3 Replies
Message 1 of 4

Realease box in processor by change variable

robson_t
Not applicable

[ FlexSim 22.2.0 ]

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.




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

Jacob_White
Community Manager
Community Manager

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
Message 3 of 4

marco_g8
Not applicable
Accepted solution

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

0 Likes
Message 4 of 4

Jacob_White
Community Manager
Community Manager

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