Hi,
In case anyone has tried to use a visual tool to control e.g. the maximum amount of flowitems in a certain processing area in the model you might be familiar with this already. I tried closing the input of the visual tool (looks like a processor) that my processors are in to control the amount of flowitems in the visual tool. However, the flowitems get into the visual tool anyhow if you do not close the input to all the processors inside the visual tool that are connected to the input of the visual tool. The workaround given to me by support is presented below. See also the attached model where two processors are inside a visual tool that looks like a processor.
Axel
Quote:
Unfortunately, this is a bug with the visual tool object since the input ports for these objects are structured a little differently than the other Fixed Resources. I am going to let the developers know so it can be looked at and hopefully fixed in a future release of the software. Until then, I would say the easiest thing to do is close the input ports of all objects connected to the visual tool through their input ports. This can easily be done using a for loop and a User Command.
I am attaching your model to this email with those changes made as an example. If you want to use the same code, it should work to copy it to a different model. I created two User Commands called closevisualtoolinput() and openvisualtoolinput() and made it so the OnEntry and OnExit triggers of your Processors call these User Commands. The commands themselves are pretty straightforward and I have included comments to help explain what the code is doing. The logic can all be done on one line of code, but I have included a multi-line comment that breaks each part of that line up into different variables to help organize the code a bit better. In other words, the multi-line comment could be uncommented and the one line of code for the insideObject variable removed to achieve the same functionality.
|