vcTransportNode

Defines a logical place where product instances can be transported to and from. Each transport node has to be assigned a component container, but can also be connected to a vcMotionPath as a sensor. When connected as a sensor, the node will grab arriving products from the path to its component container and can similarly place leaving components to the connected path.

Inherits: vcBehaviour

Type constant: VC_TRANSPORTNODE

 

Properties

Name Type Access Description
TransportSystem vcTransportSystem R The associated transport system.
TransportLinks List of vcTransportLink R The transportLinks coming into, and going out from, this node.
ProcessExecutor vcProcessExecutor R

The associated process executor.

This property is read only; it’s value can be changed by setting the TransportNode property on a ProcessExecutor.

(Deprecated) Should not assume 1 to 1 mapping between process executors and transport nodes and thus this property may get removed.

ComponentContainer vcContainer RW

The component container this node monitors for arriving products.

Using other than vcComponentContainer may cause issues.

VisualPositionFrame vcFrameFeature RW Defines visualization position of the node. The frame feature must be in the same component as this transport node behavior.
VisualPosition vcMatrix R Visualization position of this node in world coordinates.
DefaultProductPositionFrame vcFrameFeature RW The default position for products.
DefaultResourcePositionFrame vcFrameFeature RW The default position for resources.
Frame vcFrameFeature RW

Only used when connected to a path as sensor.

Defines the Frame feature referenced as the sensor's physical location.

ResetAt Enumeration RW

Only used when connected to a path as sensor.

Defines the mode for resetting the sensor.

See Path Constants for more information.

TriggerAt Enumeration RW

Only used when connected to a path as sensor.

Defines the mode for triggering the sensor.

See Path Constants for more information.

Methods

Name Return Type Parameters Description
createTransportTarget vcTransportTarget vcProduct product

Creates a new transport target object for this node and assigns it for the given product instance.

The target is created with the default values of this transport node.

Replaces any existing transport target assigned to the given product in this node.

Note that the node automatically deletes any transport targets when they are no longer needed.

getTransportTarget vcTransportTarget vcProduct product

Gets transport target in this node assigned for a given product instance.

Returns None if a target is not defined.

Note that the node automatically deletes any transport targets when they are no longer needed.

deleteTransportTarget None vcProduct product

Deletes a transport target assigned for a given product instance.

Note that the default transport target is used if a product instance doesn’t have a specific target defined.

beginTransportOut None vcProduct product

Begin the process of transporting the given product through its transport solution.

Note that transport is asynchronous i.e. the product won’t leave immediately.

Events

Name Parameters Description
OnProductArriving vcProduct product, vcTransportLink link, vcEventReturnData eventData

This event is raised when a product instance arrives to this node.

Link is the link that the product arrived to this node from.

The listener should check that eventData.Handled is False before performing any operations on this product, and should set eventData.Handled to True (it was False originally) if the listener accepted this product and handled it.

If no Python listeners set Handled to True, the product will be handled by internal logic, which includes allowing process statements to receive it.

OnProductLeaving vcProduct product, vcTransportLink link

This event is raised when the product leaves in this transport node.

Link is the link that the product left towards and can be None if the product doesn’t have a transport solution or the solution doesn’t have a transport link going out from this transport node.

OnTransportTargetRequested vcProduct product, vcTransportTarget target This event is raised when a transport target is requested for the product. In practice, this happens each time that a transport controller or resource is transporting a product instance and needs a target for the product instance.   See an example below.

Examples

Example. Change machine's material to red when it gets a product.

# When product leaves change material back to white.
from vcScript import *
app = getApplication()
mat_red = app.findMaterial('red')
mat_white = app.findMaterial('white')
comp = getComponent()
process = comp.findBehavioursByType(VC_PROCESSEXECUTOR)[0]
tnode = process.TransportNode
def OnReset():
  comp.Material = mat_white
def product_in(product, link, event_data):
  comp.Material = mat_red
def product_out(product, link):
  comp.Material = mat_white
tnode.OnProductArriving = product_in
tnode.OnProductLeaving = product_out

Example. Assign new target location for the requested product.

from vcScript import *

comp = getComponent()
tnode = comp.findBehavioursByType(VC_TRANSPORTNODE)[0]
bModifyTarget = False

def targetRequested(product, target):
 global bModifyTarget
 print "targetRequested"
 prodPosM = target.ProductPosition
 prodPos = prodPosM.P
 print "original target: {:.1f} {:.1f} {:.1f}".format(prodPos.X, prodPos.Y, prodPos.Z)
 if bModifyTarget:
  prodPosM.translateRel(0, 0, 500)
  target.ProductPosition = prodPosM
  print "new target: {:.1f} {:.1f} {:.1f}".format(prodPosM.P.X, prodPosM.P.Y, prodPosM.P.Z)
 bModifyTarget = not bModifyTarget

tnode.OnTransportTargetRequested = targetRequested