Table of Contents

Table of Contents

FloWorks products

FloWorks products

How FloWorks uses (or does not use) products

All FloWorks objects have a product type defined. FloWorks has made a deliberate choice not to transfer product types automatically from one object to the next: products only affects the product stored in or flowing through the object. This gives you, as a modeller, a great deal of flexibility. For example, you can quickly build a model in which product types are split, mixed or blended, without having to tell FloWorks anything about the densities and component mixes of your products. Of course, if you do require that level of detail, the full integration of FloWorks with all FlexSim features including Process Flow allows you to include such refinements yourself.

The product type usually changes the color of the fluids in or flowing through the object, but as explained above, the color may change instantly upon entering a next object. There are a few exceptions to this rule:

  • While collecting ingredients, the flow mixer will keep the product types from the previous objects. After mixing, however, the mixer changes the product type of its contents to the final product as defined on the FlowMixer.
  • The conveyor reads the product type from the input ports, and displays its contents as stacked layers. However, upon reaching the end of the conveyor, the outflow will get the product type of the topmost layer - considering the contents as a stack of bulk of which only the product on top remains visible.
  • The flow pipe has an option of passing its product type downstream. You can explicitly enable this in the "product out change" trigger, when using multiple connected flow pipes to model a network of multi-product pipelines.

Numeric vs. named products

FloWorks products can either be simple numbers, that you can use in any way that makes sense in your particular model; or they can be predefined products with fixed names and colors from a table that you need to fill before (or while) you create the model. The next two sections describe these two options in more detail.

Numeric product types

When you start a new FloWorks model, product identifiers are by default positive integer numbers: FloWorks objects can have product 1, 2, 3, etc. As soon as you create the first FloWorks object in the model, a Color Palette that defines the color for each product is automatically added to the Toolbox. For more information on how to change the default color assignments, please see the documentation for the Color Palette tool.

Product Table editor

User-defined product types

It is possible to define a custom set of products and their colors, instead of the default numeric product IDs. You can toggle to Product Table mode in one of the following two ways:

  1. By clicking the Product Table button () to the right of the Product Type field in the properties panel of any FloWorks object.
    Create or Edit Product Table
    Once you have created the product table you can open it again by double clicking it in the Toolbox.
  2. By clicking the green "plus" button in the Toolbox and selecting FloWorks, then "Product Table".
  3. Both of these options bring up the Products Table Editor. See the Product Editor Reference Page for more details on how to use it.

    Product Table editor

The product property

When accessing FloWorks objects through FlexScript coding, you should use the FlowObject class (see the class reference for more information). This class has a property product, which can be used to request or change the current product. Note that most FloWorks objects do not automatically change their product on reset, so if you change the product of an object during the run it will not change back to its initial product when you reset the model.

The type of the product property is a Variant that can take the following values:

  • When using numeric product IDs the product will always be a number. If the product is not applicable, for example because you are requesting the outflow product of an empty conveyor, the number zero will be returned. For example:
    FlowObject source = model.find("FlowSource1");
    source.product = 3;
    // Returns a Variant with numeric value 3
    return source.product;
  • When using a user-defined product table the product will usually be a string with the product name. For example, assuming you have defined a product called "My Product":

    FlowObject source = model.find("FlowSource1");
    source.product = "My Product";
    // Returns a Variant with string value "My Product"
    return source.product;

If you are using a user-defined product table and you know the internal product ID, you can still use that in the product setter, for example you can replace the second line in the example above by source.product = 1. If "My Product" corresponds to product ID 1, the last line will still return a Variant containing the string value "My Product". However, if no product in the table has internal ID 1, the last line will return a Variant with numeric value 1 and the product will be colored according to the "All other products" color defined in the product table.

In case the product is not applicable, for example because you are requesting the outflow product of an empty conveyor, the empty variant nullvar will be returned.

Converting using GetFlowProductId

When using a user-defined product table, if necessary you can use the function GetFlowProductId(string productName) to find the numeric product ID corresponding to the named product. This function will return the number zero (0) if the product name is not a valid name in the table.