question

Bryan Suharik avatar image
0 Likes"
Bryan Suharik asked Bryan Suharik commented

Pull Requirement Depends on Downstream States help?

Hello,

I have a queue that flows to a seperator which seperates the flow item to 3 processors. I want the seperator to only pull flow items if all of the downstream processors are free, i.e. Idle.

I don't see any errors, but am unclear on how the pullrequirement activates. This code is on the "pullrequirement" node of the variables node of the separator object.

Is it correct to equate the getstatenum to STATE_IDLE? I've tried setting this line to getnodenum and referring to the node value in idle state which is 1.00, but this didn't work.

if(getstatenum(node("MT Repair 1",model())) == STATE_IDLE && getstatenum(node("ET Repair 1",model())) == STATE_IDLE && getnodenum(node("QC Check 1",model())) == STATE_IDLE)

{

return 1;

}

Thanks in advance for your help!! VERSION 6

codepull requirement
· 1
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 ·

Which Version do you mean Flexsim 6.x.y or Flexsim Version 16.0.6?

0 Likes 0 ·

1 Answer

·
Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Bryan Suharik commented

What you are trying to achieve has nothing to do with the pull requirement. If you want that the pull requirement start testing the available items to pull you should open the output of the object connected to the input ports of the separator otherwise close their output. You could open or close the input of the separator depending on the availability or state of the following processors, too. Without process flow you have to check this condition in the OnExit triggers of each processor.

The pull requirement isn't a infinite repeating function like you could build it in process flow. If the function had tested all available items once, the pull requirement stops the testing.

The pull requirement is a function to look for a suitable item to pull depending on features connected to the item only.

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

You can set an area where you let only enter one item, then you close the input of the separator and set a label to a number value which represent the number of separated items. In the objects at the end of area you decrement this label value until the value is equal to the last item to leave the area. Then you open the input of the separator again.

0 Likes 0 ·
Bryan Suharik avatar image Bryan Suharik commented ·

@Jörg Vogel Thanks Jorg, I think opening and closing the ports of the separator from onentry and exit triggers would suffice. I tried the following code on the exittrigger of the Separator:

closeinput(current);

and then i put the following code on the exit trigger of the last processor:

openinput(node("Bay 1",model()));

Bay 1 is the name of the Separator.

I tried replacing those commands with stopinput and resume input, but that didn't work.

Any suggestions?

Thanks

0 Likes 0 ·
Bryan Suharik avatar image Bryan Suharik Bryan Suharik commented ·
@Jörg Vogel

I got it! Best to use the on message trigger i learned. I guess the hard code of the objects overrides the commands otherwise.

on the last processor exit :

sendmessage(node("/Bay 1",model()),current);

on the Separator:

openinput(current);

Thanks for the discussion!

1 Like 1 ·

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.