FloWorks Commands
FloWorks
Description
Deprecated.
This command has been deprecated. Instead, you should use flowObject.product = newProduct;
Example
ChangeFlowProduct( current, 2 );
Description
Changes the speed of a task executer travelling an network edge.
Example
ChangeTeEdgeSpeed( taskExecuter, 0, 1 )
Description
Deprecated.
This command has been deprecated. Instead, you should use flowObject.input.ports.close();
Note that some objects, such as the Flow Mixer, may use commands like this to manage their flow, it is safer to use flowObject.output.close(); than flowObject.output.ports.close();.
Example
treenode tank = node( "FlowTank1", model() );
CloseAllFlowIp( tank );
Description
Deprecated.
This command has been deprecated. Instead, you should use flowObject.output.ports.close();
Note that some objects, such as the Flow Mixer, may use commands like this to manage their flow, it is safer to use flowObject.output.close(); than flowObject.output.ports.close();.
Example
treenode tank = node( "FlowTank1", model() );
CloseAllFlowOp( tank );
Description
Deprecated.
This command has been deprecated. Instead, you should use flowObject.input.close();
Note that some objects, such as the Flow Mixer, may use commands like this to manage their flow, it is safer to use flowObject.output.close(); than flowObject.output.ports.close();.
Example
treenode tank = node( "FlowTank1", model() );
CloseFlowInput( tank );
Description
Deprecated.
This command has been deprecated. Instead, you should use flowObject.input.ports[portNumber].open();
Note that some objects, such as the Flow Mixer, may use commands like this to manage their flow, it is safer to use flowObject.output.close(); than flowObject.output.ports.close();.
Example
treenode tank = node( "FlowTank1", model() );
// Close the last input port
CloseFlowIp( tank, nrip( tank ) );
Description
Deprecated.
This command has been deprecated. Instead, you should use flowObject.output.ports[portNumber].close();
Note that some objects, such as the Flow Mixer, may use commands like this to manage their flow, it is safer to use flowObject.output.close(); than flowObject.output.ports.close();.
Example
treenode tank = node( "FlowTank1", model() );
// Close the last output port
CloseFlowOp( tank, nrop( tank ) );
Description
Deprecated.
This command has been deprecated. Instead, you should use flowObject.output.close();
Note that some objects, such as the Flow Mixer, may use commands like this to manage their flow, it is safer to use flowObject.output.close(); than flowObject.output.ports.close();.
Example
treenode tank = node( "FlowTank1", model() );
CloseFlowOutput( tank );
ConnectFlowObjectToOtherObject
(treenode FromFlowObject, treenode ToFlowObject[, int isActiveConnection])
Description
Deprecated.
This command has been deprecated. Instead, you should use flowObject.connect( model.find( "OtherFlowObject" ) );
Example
treenode from = node( "FlowSource1", model() );
treenode to = node( "FlowTank2", model() );
// Create a connection from the source to the tank
// and automatically start the flow, if possible.
ConnectFlowObjectToOtherObject( from, to );
Description
Deprecated.
This command has been deprecated. Instead, you should use flowObject.flowControl = model.find("FlowControl1");
Example
ConnectToFlowControl( flowcontrol, current );
Description
Disconnects a flow object from its control and all incoming and outgoing objects.
Example
DisconnectFlowObject( current );
Description
Deprecated.
This command has been deprecated. Instead, you should use flowObject.flowControl = nullvar;
Example
DisconnectFromFlowControl( current );
Description
Ends an impact factor event, which temporarily decreased or increased the maximum flow of a FloWorks object.
The impact factor event applies a multiplicative factor to the maximum flow rate, which can completely stop or reduce the flow because of a failure mode; but by setting a factor larger than 1 this function can also be used to model increased productivity due to e.g. seasonal fluctuations.
This function is called automatically from the "up" trigger of a FloWorks Impact Event, you usually only need to call it manually if you explicitly used the StartImpactFactorEvent command.
Note that multiple events may be active on a flow object at any time, and multiple flow objects may be impacted by an event, so you may need to call this command more than once.
Example
EndImpactFactorEvent( FlowObject, MTBF_Object );
Description
For developer use only.
Example
FlowDrawGanttChart( view )
GetEarliestStartForSequence
(treenode/string workabilityObject, int/string sequence[, double offset])
Description
Calculates the earliest possible start time for a sequence on a workability object,
at or after the current time plus the given offset (defaults to 0).
The workability object can be specified by name, or by a direct reference.
The sequence can be specified by name or by index (starting at 1).
If the workability could not be determined, the function returns -1.
Example
GetEarliestStartForSequence("Weather", 1)
Description
Deprecated.
This command has been deprecated. Instead, you should use double content = flowTank.content;
Example
// Assume vessel is a FloWorks Vessel and get its tank's content.
int vesselTankContent = GetFlowContent( first( vessel ) );
Description
Deprecated.
This command has been deprecated. Instead, you should use Object flowControl = flowObject.flowControl;
Example
GetFlowControl( FluidObject );
Description
Deprecated.
This command has been deprecated. Instead, you should use double inputAmount = flowObject.input.amount;
Example
GetFlowInput( first( vessel ) )
Description
Deprecated.
This command has been deprecated. Instead, you should use double inputRate = flowObject.input.rate;
Example
// Assume vessel is a FloWorks Vessel and get its loading rate.
GetFlowInputRate( first( vessel ) )
Description
Deprecated.
This command has been deprecated. Instead, you should use double inputTriggerAmount = flowObject.input.triggerAmount;
Example
// Delay the input trigger by 100 m3
double newTriggerAmount = GetFlowInputTriggerAmount( involved ) + 100;
SetFlowInputTriggerAmount( involved, newTriggerAmount );
Description
Deprecated.
This command has been deprecated. Instead, you should use double maxContent = flowTank.maxContent;
Example
// Assume vessel is a FloWorks Vessel and get its capacity.
int vesselTankContent = GetFlowMaxContent( first( vessel ) );
Description
Returns the current FloWorks license.
Example
int hasLicense = GetFloworksLicense() == LICENSE_TYPE_STANDARD );
Description
Deprecated.
This command has been deprecated. Instead, you should use double outputAmount = flowObject.output.amount;
Example
GetFlowOutput( first( vessel ) )
Description
Deprecated.
This command has been deprecated. Instead, you should use double outputRate = flowObject.output.rate;
Example
// Assume vessel is a FloWorks Vessel and get its unloading rate.
GetFlowOutputRate( first( vessel ) )
Description
Deprecated.
This command has been deprecated. Instead, you should use double outputTriggerAmount = flowObject.output.triggerAmount;
Example
// Delay the output trigger by 100 m3
double newTriggerAmount = GetFlowOutputTriggerAmount( involved ) + 100;
SetFlowOutputTriggerAmount( involved, newTriggerAmount );
Description
Finds the numeric ID of a product by name.
Example
int productId = GetFlowProductId( "Raw Material XYZ" );
if(productId > 0) {
flowObject.product = productId;
}
Description
Deprecated.
This command has been deprecated. Instead, you should use flowObject.product;
Example
int storedProduct = GetFlowProductType( flowTank );
Description
Deprecated.
This command has been deprecated. Instead, you should use flowObject.stats.utilization;
Example
GetFlowUtilization( current );
Description
Calculates the level value of the level triggered event.
If atTime is passed, the level at the given time is returned, otherwise the current value is calculated.
The event object can be specified by name, or by a direct reference.
If the level cannot be determined, for example because you are reading past the end of a non-repeating table, the flag value -999999 is returned.
Example
GetLevel( "MyLevelTriggeredEvent" )
Description
Returns the precision for displaying floating point numbers, according to FlexSim settings.
It is mostly useful for converting numbers to text using the numtostring command.
Example
int precision = GetNumberPrecision();
pt( "Pi is approximately ");
pt( numtostring( pi(), precision, precision ) );
pr();
Description
Loads a recipe for a specific product from the Products Table into the Flow Mixer recipe table. The mixer's Product Source trigger is used to decide which ports will be pulled from.
Example
if( LoadFlowMixerRecipe( mixer, "Mixed Product" ) )
StartMixerRecipe( mixer );
Description
Deprecated.
This command has been deprecated. Instead, you should use flowObject.output.ports.open();
Note that some objects, such as the Flow Mixer, may use commands like this to manage their flow, it is safer to use flowObject.output.close(); than flowObject.output.ports.close();.
Example
treenode tank = node( "FlowTank1", model() );
OpenAllFlowIp( tank );
Description
Deprecated.
This command has been deprecated. Instead, you should use flowObject.output.ports.open();
Note that some objects, such as the Flow Mixer, may use commands like this to manage their flow, it is safer to use flowObject.output.close(); than flowObject.output.ports.close();.
Example
treenode tank = node( "FlowTank1", model() );
OpenAllFlowIp( tank );
Description
Deprecated.
This command has been deprecated. Instead, you should use flowObject.input.open();
Note that some objects, such as the Flow Mixer, may use commands like this to manage their flow, it is safer to use flowObject.output.close(); than flowObject.output.ports.close();.
Example
treenode tank = node( "FlowTank1", model() );
OpenFlowInput( tank );
Description
Deprecated.
This command has been deprecated. Instead, you should use flowObject.input.ports[portNumber].open();
Note that some objects, such as the Flow Mixer, may use commands like this to manage their flow, it is safer to use flowObject.output.close(); than flowObject.output.ports.close();.
Example
treenode tank = node( "FlowTank1", model() );
// Open the last input port
OpenFlowIp( tank, nrip( tank ) );
Description
Deprecated.
This command has been deprecated. Instead, you should use flowObject.output.ports[portNumber].open();
Note that some objects, such as the Flow Mixer, may use commands like this to manage their flow, it is safer to use flowObject.output.close(); than flowObject.output.ports.close();.
Example
treenode tank = node( "FlowTank1", model() );
// Open the last output port
OpenFlowOp( tank, nrip( tank ) );
Description
Deprecated.
This command has been deprecated. Instead, you should use flowObject.output.open();
Note that some objects, such as the Flow Mixer, may use commands like this to manage their flow, it is safer to use flowObject.output.close(); than flowObject.output.ports.close();.
Example
treenode tank = node( "FlowTank1", model() );
OpenFlowOutput( tank );
Description
Deprecated.
This command has been deprecated. Instead, you should use flowObject.input.ports[portNumber].select();
Note that some objects, such as the Flow Mixer, may use commands like this to manage their flow, it is safer to use flowObject.output.close(); than flowObject.output.ports.close();.
Example
treenode tank = node( "FlowTank1", model() );
// Open the first input port, close all other ports
SelectFlowIp( tank, 1 );
// Open only the first and last input port, close all other input ports
// (Only when the object has more than one input port)
SelectFlowIp( tank, 1, nrip( tank ) );
Description
Deprecated.
This command has been deprecated. Instead, you should use flowObject.output.ports[portNumber].select();
Note that some objects, such as the Flow Mixer, may use commands like this to manage their flow, it is safer to use flowObject.output.close(); than flowObject.output.ports.close();.
Example
treenode tank = node( "FlowTank1", model() );
// Open the first output port, close all other ports
SelectFlowOp( tank, 1 );
// Open only the first and last output port, close all other output ports
// (Only when the object has more than one output port)
SelectFlowOp( tank, 1, nrop( tank ) );
Description
Sets the arrow style variable for the given FloWorks object, and removes or adds the arrows, depending on the given style.
The following arrow styles are supported:
1: IN connections, using preferably a single arrow from OUT to IN.
2: IN connections, using preferably a short arrow only connected to IN.
3: OUT connections, using preferably a single arrow from OUT to IN.
4: Both (1) and (3)
5: Both (2) and (3)
6: OUT connections, using preferably a short arrow only connected to OUT.
7: Both (1) and (6)
8: Both (2) and (6)
Example
SetArrowStyle( current, 4 );
Description
Deprecated.
This command has been deprecated. Instead, you should use flowTank.content = newContent;
Example
// Set the content of the vessel tank to 1000 m3.
SetFlowContent( first( vessel ), 1000 )
Description
Sets the speed of the flow conveyor.
Setting the speed to 0 will stop the conveyor and close inputs and outputs.
Setting the speed to a negative value will reverse the direction of the conveyor.
Example
SetFlowConveyorSpeed( conveyor, 1 );
Description
Deprecated.
This command has been deprecated. Instead, you should use flowObject.input.triggerAmount = newTriggerAmount;
Example
SetFlowInputTriggerAmount( current, 50 );
Description
Deprecated.
This command has been deprecated. Instead, you should use flowTank.maxContent = newMaximumContent;
Example
// Set the maximum content of the vessel tank to 1000 m3.
SetFlowMaxContent( first( vessel ), 1000 );
Description
Set the number of trigger levels of a content-holding flow object such as a tank.
After setting the number of trigger levels, you can use the SetFlowTriggerLevel command to set the level at which these triggers fire.
Only use this to initialise the object.
Do not use during runtime.
Example
SetFlowNrOfTriggerLevels( current, 1 );
Description
Deprecated.
This command has been deprecated. Instead, you should use flowObject.output.triggerAmount = newTriggerAmount;
Example
SetFlowOutputTriggerAmount( current, 50 );
Description
Deprecated.
This command has been deprecated. Instead, you should use flowObject.input.maxRate = value; or flowObject.output.maxRate = value;
Example
SetNewFlowRates( flowSource, newOutRate );
SetNewFlowRates( flowSink, newOutRate );
SetNewFlowRates( flowPump, newInOutRate );
SetNewFlowRates( tank, newInRate, newOutRate );
SetNewFlowRates( tank, -1, newOutRate );
Description
Set the trigger level of a content-holding flow object such as a tank.
Only use this to initialise the object.
Do not use during runtime.
Example
// Change the first trigger level to fire at 60% of maximum content.
SetFlowTriggerLevel( current, 1, 60 );
SetInflowRatioValue
( treenode flowObject, int portnumber, double newValue, bool recalculateSystem )
Description
Deprecated.
This command has been deprecated. Instead, you should use flowObject.input.ports[portNumber].ratio = newValue;
Example
// Set the ratio of input port 2 to 33%, and recalculate.
SetInflowRatioValue( current, 2, 33, true );
Description
Deprecated.
This command has been deprecated. Instead, you should use flowObject.input.maxRate = value; or flowObject.output.maxRate = value;
Example
SetNewFlowRates( flowObject, newInrate, newOutrate );
SetOutflowRatioValue
( treenode flowObject, int portnumber, double newValue, bool recalculateSystem )
Description
Deprecated.
This command has been deprecated. Instead, you should use flowObject.output.ports[portNumber].ratio = newValue;
Example
// Set the ratio of output port 2 to 33%, and recalculate.
SetOutflowRatioValue( current, 2, 33, 1 );
Description
Deprecated.
This command has been deprecated, do not use it.
Example
ShowFluidCTD( c )
Description
Start the next recipe on a flow mixer in non-repeating mode.
Returns 0 if the recipe has started successfully.
Example
StartFlowMixerRecipe( mixer );
StartImpactFactorEvent
( treenode flowObject, treenode eventObject, double impactFactor, int isInputInfluenced, int isOutputInfluenced )
Description
Start an impact factor event, which temporarily decreases or increases the maximum flow of a FloWorks object.
The impact factor event applies a multiplicative factor to the maximum flow rate, which can completely stop or reduce the flow because of a failure mode; but by setting a factor larger than 1 this function can also be used to model increased productivity due to e.g. seasonal fluctuations.
This function is called automatically from the "down" trigger of a FloWorks Impact Event, you do not usually need to call it manually.
Example
StartImpactFactorEvent( FlowObject, MTBF_Object, ImpactFactor, InputInfluenced, OutputInfluenced );
Description
Stops loading of the specified transporter at the given loading point.
This function can only be called if loading duration is set manually (loading time function returned 0).
Otherwise loading will stop automatically after the given time.
Example
StopLoading( loadingPoint, first( loadingPoint ) )