I am using custom code in the step triggers of two Fluid Mixer objects to refill when the step sequence is completed and the mixer is empty. How can I code to trigger a refill when the mixer content falls below a certain level (e.g. 1000 kg) rather than after the two step cycle (step 1 fill; step 2 mix) and then completely emptying. After the refill is complete, the mixer should revert to step 2 (mixing). Each of the two mixers can hold 3000 kg and are being fed from a common tank connected to both mixers. The two mixers are communicating with each other through the central ports.
Here is my current method:
Before step trigger:
/**Custom Code*/
treenode current = ownerobject(c); int stepnum = parval(1); if (stepnum == 1) { openinput(current); closeinput(centerobject(current,1)); }
After step trigger:
/**Custom Code*/
treenode current = ownerobject(c); int stepnum = parval(1); if (stepnum == 1) { closeinput(current); openinput(centerobject(current,1)); }
Thanks.