Name | Type | Description |
Name | String | Gets the product name. By default this will be ProductX where X is the next incremental product number. |
Identified | Boolean | Gets/Sets the identified indicator |
Identifier | String | Gets/Sets the identifier |
ScreeningData | Array of Integer | Gets the screening data associated with this instance, last value is the most current (See X Ray Machine for values, also see Examples below). |
Text | String | Gets/Sets the text displayed above the product |
Scheduler | Object | Gets the product scheduler associated with creating this object |
DestinationData | Array of Integer | Gets a destination data associated with this instance, last value is the most current |
Width | Number | Width of the product item ( in the units chosen when the project was created (metres or feet)) |
Length | Number | Length of the product item ( in the units chosen when the project was created (metres or feet)) |
Height | Number | Height of the product item ( in the units chosen when the project was created (metres or feet)) |
Direction | Number | Rotation of the product item (degrees) |
Shape (V5) | String | Gets/Sets the name of the Product Shape or '' if set to the default of a cube |
Color | String | New in V7.0. Gets/Sets the name of the color of the equipment |
Visible | Boolean | New in V7.0. Gets/Sets the visibility of the equipment |
With Release version 5.0 of Sym3 the MoveProduct function now supports optional X, Y and Z properties as well as Direction, Tilt and Roll (depending upon the target).
With Release version 5.0 of Sym3 the Product used in the simulation can be changed from a simple cube to an imported model. This supports a texture in the same manner as User Equipment.
OnIdentifiedStateChange
Invoked when the product ‘Identified’ property value changes
Callback Signature
void xxxxxxxxxxxxxxxxx (sender: object);
Name | Type | Description |
sender | Object | The object associated with the changed property |
OnProductCreate
Invoked when the product is created (may be from a Product Schedule, Product Generator, Scripting or by the User).
Note: This event does not support multiple subscription. Previous subscription will be lost if subscribed twice.
Callback Signature
void xxxxxxxxxxxxxxxxx (product: Product, source: object);
Note: This event is subscribed to via the SubscribeAll global function. As product components are transient, using the ‘Subscribe’ method will result in an error.
The Source object is a new parameter available from Sym3 V5.3 on and will be either the Product Generator object or null for Product Schedule, Script and User sources.
Name | Type | Description |
product | Product | The product object created |
source | Object | The source object that created the product (or null) |
OnProductDelete
Invoked when the product is deleted.
Note: This event does not support multiple subscription. Previous subscription will be lost if subscribed twice.
Callback Signature
void xxxxxxxxxxxxxxxxx (product: Product);
Note: This event is subscribed to via the SubscribeAll global function. As product components are transient using the ‘Subscribe’ method will result in an error.
Name | Type | Description |
product | Product | The product object deleted |
OnScreeningDataChange
Invoked when the product screening data has changed.
Callback Signature
void xxxxxxxxxxxxxxxxx (product: Product);
Name | Type | Description |
product | Product | The product object associated with the update |
OnDestinationDataChange
Invoked when the product destination data has changed.
Callback Signature
void xxxxxxxxxxxxxxxxx (product: Product);
Name | Type | Description |
product | Product | The product object associated with the update |
void DeleteProduct(product: Product);
Called to delete a product component.
Parameters
Name | Type | Description |
product | Product | The product object to delete |
Return Value – Void
New in V5.2. Call this function to delete all products in the project (including product in Product Schedule queues). This performs the same function as Delete All Product on the Simulation ribbon.
Return Value – Integer value for the number of products deleted.
Product CreateProduct(identifier: string);
Called to create a new instance of product.
Parameters
Name | Type | Description |
identifier | String | OPTIONAL: product's identifier |
Return Value – An instance of the product type, or null on error
With Sym3 version 5, there are variants of MoveProduct depending upon the target and the parameters passed.
Move product to Transporter or Product Schedule
void MoveProduct(product: Product, target: string, distance: number);
Called to move product from one transporter to another. Requires 3 parameters.
Parameters
Name | Type | Description |
product | Product | The object to move. If move to product schedule, this can be a new product object created by 'CreateProduct' and a product will be created in the Product Schedule. |
target | String | The name of the destination transporter or product schedule. If this is an empty string the product is moved to ‘limbo’, it will have no parent and will not be visible within the simulation. When moved to a product schedule, the product.Scheduler property will be set to the product schedule it moved to. If product.Scheduler is NULL then it means it failed to move. (ie exceeded max queue size) |
distance | Number | The distance along the transfer path of the transporter that the product will be inserted |
Return Value – Void (or the schedule object, if moved to a Product Schedule)
Move product to a Rack
void MoveProduct(product: Product, target: string, indexX: integer, indexY: integer);
void MoveProduct(product: Product, target: string, indexX: integer, indexY: integer, offsetX: double, offsetY: double, offsetZ: double, direction: double, tilt: double, roll: double);
Called to move product into the cell of a Rack. Requires 4 parameters.
Parameters
Name | Type | Description |
product | Product | The object to move. If move to product schedule, this can be a new product object created by 'CreateProduct' and a product will be created in the Product Schedule. |
target | String | The name of the destination Rack. |
indexX | integer | The column cell (zero based) to place Product into |
indexY | integer | The row cell (zero based) to place Product into |
offsetX | double | OPTIONAL: X position of product inside the cell. Default = 0.0 and is center of cell |
offsetY | double | OPTIONAL: Y position of product inside the cell. Default = 0.0 and is center of cell |
offsetZ | double | OPTIONAL: Z position of product inside the cell. Default = 0.0 and is bottom of cell |
direction | double | OPTIONAL: Direction (in degree) of product inside the cell. Default = 0.0 |
tilt | double | OPTIONAL: Tilt (in degree) of product inside the cell. Default = 0.0 |
Roll | double | OPTIONAL: Roll (in degree) of product inside the cell. Default = 0.0 |
Return Value – Void
Move Product to a Product container
void MoveProduct(product: Product, target: string, X: double, Y: double, Z: double, direction: double, tilt: double, roll: double);
Called to move product to a Product container or another Product. Requires 3 to 8 parameters
Parameters
Name | Type | Description |
product | Product | The object to move. If move to product schedule, this can be a new product object created by 'CreateProduct' and a product will be created in the Product Schedule. |
target | String | The name of the product container or parent Product. |
X | double | The X position to place the Product at |
Y | double | The Y position to place the Product at |
Z | double | The Z position to place the Product at |
Direction | double | The direction in degrees for the Product |
Tilt | double | The Tilt in degrees for the Product |
Roll | double | The Roll in degrees for the Product |
Return Value – Void
When moving a Product on a Product, unless specified the 'child' product will be displayed on top , in the centre of the 'parent' product. New parameters allow this to be controlled.
Examples for all forms:
MoveProduct(childProduct, parentProduct.Name, 0); // Place of top, centre of parentProduct MoveProduct(childProduct, rack.Name, 2, 1); // Place in grid 2,1 of the specified Rack MoveProduct(childProduct, products[cells[1]].Name, -0.15, 0.20, 0.10); // Place at X,Y,Z coordinates on array of Product MoveProduct(childProduct, parentProduct.Name, 1.0, -21.0, 0.0, 45, 30, 20); // Place at X,Y,Z coordinates on Parent Product specifying a Direction, Tilt and Roll
Attempting to place Product on equipment other than a ProductSchedule, another product or a Rack produces the message;
"Destination is not a Transporter, Product Schedule, Product container nor Rack"
A Product container can be a Product or an Array of products.
Note: If you create Equipment with a macro and use MoveProduct in the script you may get the message "Fail to find destination". Save and reload the project to resolve this.
Reading child products of a Product container
The GetChildren function is used to retrieve any product that was moved to the product container and returns an array of products. If the container has no children then null is returned
Product GetChildren()
Example: Loads two products onto the first placed on a conveyor then reads the children on each product
var Product0 = CreateProduct("Cart0"); // Create Product0 where Cart1 is the identifier var Product1 = CreateProduct("Cart1"); var Product2 = CreateProduct("Cart2"); MoveProduct(Product0, "Conveyor1", 0); // Place on Conveyor1 MoveProduct(Product1, Product0.Name, 0, -0.25); // Place as first child of Product0 MoveProduct(Product2, Product0.Name, 0, +0.25); // Place as second child of Product0 LogDebug("Children of Product0"); HandleProducts(Product0.GetChildren()); // Display the children of Product0 LogDebug("Children of Product1"); HandleProducts(Product1.GetChildren()); // Display the children of Product1 ... function HandleProducts(aProducts) { if (aProducts != null) { for (var i=0; i < aProducts.length; i++) { LogDebug("Product "+aProducts[i].Identifier); } } }
void SetDestination(value: integer);
Called to set the current destination for the product item
Name | Type | Description |
value | integer | The value to set as the current destination |
Return value - Void
void SetMaxDestinationData(value: integer);
Called to set the limit of destination history items in destination data
Name | Type | Description |
value | integer | The value to limit destination data. Default is 0 which means no limit |
Return value - Void
void ClearDestination();
Called to clear destination data
Return value - Void
void SetScreeningResult(value: integer);
Called to set the current screening result for the product item
Name | Type | Description |
value | integer | The value to set as the current result |
Return value - Void
Example:
Reading the current screening result
var screeningResult = 0; var array = product.ScreeningData; if (array.length > 0) { // get the result from the results array screeningResult = array[array.length - 1]; }
void SetMaxScreeningResults(value: integer);
Called to set the limit of screening history items in screening results
Name | Type | Description |
value | integer | The value to limit screening results. Default is 0 which means no limit |
Return value - Void
void ClearScreeningResults();
Called to clear screening results
Return value - Void
void GetProductPosition(product: Product);
Called to get the current position (Absolute) of a product component. (we don't support sorters)
Name | Type | Description |
product | Product | The product object |
Return Value – Array of Number (X, Y, Z) Positions
var pos =GetProductPosition(product); LogDebug("Product at " + "X: " + pos[0] + " Y: " + pos[1] + " Z: " + pos[2]);
With Version 5.0 of Sym3 the Product can use an imported Product Shape defined in the system Poperties for the project. The shape can also be changed with scripting either by using the Shape property or using the SetShape method.
void SetShape(shapeName: string)
Name | Type | Description |
shapeName | String | The shape name to set as the current product shape for this product |
Return value - Void
Can be called to change this product from the current shape to a new shape from the Product Shape list. If the specified shape does not exist there is no error and the original shape is retained. Reading the Shape property returns the new shape name even if it did not exist. A shape set in the system properties becomes the default shape so a read of Shape returns an empty string.
Example:
product.SetShape("Car"); LogDebug("Shape=" + product.Shape);
double GetLateralOffset();
Called to get the current lateral offset for the product item
Return value - Double
Example:
LogDebug("Lateral Offset =" + product.GetLateralOffset());
void SetLateralOffset(offset: double);
Called to set the lateral offset for the product item
Name | Type | Description |
offset | Double | The new lateral offset value |
Return value - Void
Example:
product.SetLateralOffset(0.2); LogDebug("Lateral Offset =" + product.GetLateralOffset());