article

Paul Toone avatar image
0 Likes"
Paul Toone posted

BasicFR Advanced Page   

Transport Out Notify - Transport Out Complete - This trigger is fired at two different times. First is when the object is notified that a flowitem is going to exit the object using a transport. This function is referred to as transport out notify. The second time it is fired is when the transport has arrived, finished its load time, and is about to move the flowitem out. This is called transport out complete. A variable is passed into this function telling you which operation is applicable. In this field you can manage things like the nroftransportsout variable, as well as how to screen further output/input to the object.

Access variables for the transport out notify - transport out complete function are as follows:

current: The current object.

notifyoperation: This variable is 1 or 0. 1 means it is a transport out notify operation, 0 means it is a transport out complete operation.

item: This is a reference to the item that is going to leave this object

port: This is the output port number through which the item will exit

transporter: For a transport out complete operation, this is a reference to the transporter that is picking the item up.

nroftransportsoutnode: This is a reference to the object's nroftransportsout variable. The value of this node should be incremented by 1 at a notify operation, and decremented by 1 at a complete operation. You can also query the value of this node to know how many items are waiting for a transport to pick them up.

Transport In Notify - Transport In Complete - This trigger is fired at two different times. First is when the object is notified that a flowitem is going to enter the object using a transport. This function is referred to as transport in notify. The second time it is fired is when the transport has arrived, finished its unload time, and is about to move the flowitem into the object. This is called transport in complete. A variable is passed into this function telling you which operation is applicable. In this field you can manage things like the nroftransportsin variable, as well as how to screen further output/input to the object. For example, you may want to allow more than one flowitem to be in transit to the object at the same time. In such a case, you could call receiveitem when you are notified of an upcoming entry within this field.

Access variables for the transport in notify - transport in complete function are as follows:

current: The current object.

notifyoperation: This variable is 1 or 0. 1 means it is a transport in notify operation, 0 means it is a transport in complete operation.

item: This is a reference to the item that is going to enter this object

port: This is the input port number through which the item will enter

transporter: For a transport in complete operation, this is a reference to the transporter that is dropping the item off.

nroftransportsinnode: This is a reference to the object's nroftransportsin variable. The value of this node should be incremented by 1 at a notify operation, and decremented by 1 at a complete operation. You can also query the value of this node to know how many items are still in transit to this object.

Note on the transport out/in complete function return value: In the notify and complete operations of both transport in and transport out, if the function returns a value of 0, the object will assume that nothing was done and will execute its own default logic. If this function returns a 1, the object will assume the proper variable management was done and will do nothing. If this function returns a -1 and the operation is a complete operation, the object will again assume proper variable management, but in addition, it will notify the transporter that it is not ready to receive the flowitem. The transporter then must wait until it is notified that it can resume its operation. The reason you may need to use this is in case this object has been stopped using stopobject(). If so, you may not want any flowitems coming in or going out. If this is the case, then you will need to save off a reference to the transporter using the savestoppedtransportin() or savestoppedtransportout() function, and then return -1. Then, when it is ok for the transporter to resume its operation (usually from this object's resume object function) you will need to call resumetransportsin() and resumetransportsout() to notify all stopped transports that they may resume their operation.

Pick Offset - Place Offset - This trigger is fired at two different times. First is when a transport object is attempting to place, or unload, a flowitem into this object. This is called place offset. It should return an offset location for the transport to offset to before placing the item. The second time this is called is when a transport is about to pick, or load, an item from this object. This is called pick offset. It should again return an offset location for the transport to offset to before picking the product up.

Access variables for the pick offset - place offset function are as follows:

current: The current object.

pickoperation: This variable is 1 or 0. 1 means it is a pick operation, 0 means it is a place operation.

item: This is a reference to the item that is being picked or placed

otherobject: This is a reference to the object that is picking or placing the item

xvalnode, yvalnode, zvalnode: These parameters are references to nodes whose values should be set in this function, and will represent the offset location returned by this function. For example, if I want the picking/placing object to offset 10 in the x direction, 0 in the y direction, and 5 in the z direction, I would set xvalnode to 10 using the setnodenum() command, yvalnode to 0, and zvalnode to 5.

Note on the pick/place offset return value: If you are implementing your own pick/place logic here, and do not want the default logic to be executed, you must return 1 from this function. If the object gets a return value of 0 from this function, it will assume that nothing was done, and will execute its own default logic.

Stop Object - Resume Object - This trigger is fired at two different times. First is when the stopobject() command is called for this object. Second is when the resumeobject command is called for this object. This field should define a strategy for how the object will "stop", and how it will "resume". This field should also manage data for remembering how many stop requests have been made, what the state of the object was before it was stopped, etc.

Access variables for the stop object - resume object function are as follows:

current: The current object.

stopoperation: This value is either a 1 or 0. 1 means the stopobject() command is being called on this object. 0 means the resumeobject() command is being called on this object.

stopstate: This value is only applicable for a stop operation. It specifies the requested state passed into the stopobject() command.

nrofstopsnode: This is a reference to this object's nrofstops variable. If this is a stop operation, the value of this node should be incremented by 1 within this function. If it is a resume operation, the value of this node should be decremented by 1 within this function. Also, you will get the value of this node to know how many stopobject() commands have been called on this object. When the object is stopped for the first time (the value of the node goes from 0 to 1), you should execute logic specifying how to stop this object. When the object is resumed for the final time (the value of the node goes from 1 to 0), you should execute logic specifying how to resume this object.

timeoflaststopnode: This is a reference to this object's timeoflaststop variable. When this object is stopped for the first time, this node should be set to the current time, so you can know the amount of time the object was stopped when it is finally resumed.

statebeforestopnode: This is a reference to this object's statebeforestopped variable. When this object is stopped for the first time, this node should be set to the object's current state, so that you can know which state to go back to when the object is resumed.

Note on the stop/resume object return value: If you are implementing your own stop/resume logic here, and do not want the default logic to be executed, you must return 1 from this function. If the object gets a return value of 0 from this function, it will assume that nothing was done, and will execute its own default logic.

Advanced Functions - This trigger is fired for several different notifications or functions that are called on the object. For the most part, you will not need to implement any logic for these notifications, but they are nonetheless made accessible to you. The return value of this function should either be a 1 or a 0. If 0, the object will execute the default functionality associated with the given notification. If 1, the object not do any default functionality, but assumes that the function has overridden the default.

The type of notification called for the advanced function is passed in as parval(1), or msgtype. This parameter can be one of several values. These values are listed as follows:

ADV_FUNC_CLASSTYPE: This is a request to get the type of class of the object. The classtype should be returned as an integer with certain bits set high. You can construct this value using the bitwise OR operator | and several classtype macros. For example, a FixedResource's classtype is: CLASSTYPE_FLEXSIMOBJECT > CLASSTYPE_FIXEDRESOURCE.

ADV_FUNC_DRAGCONNECTION: This function is called when a keyboard key is held down, and the user clicks and drags from this object to another object. In this case, the object to which the mouse was dragged is passed in as parnode(2), the ascii value of the key that was clicked is passed in as parval(3), and the classtype value of the object is passed in as parval(4).

ADV_FUNC_CLICK: This function is called when the object is clicked on. Here a reference to the view in which it was clicked is passed in as parnode(2), and the click code is passed in as parval(3). Possible click codes are: DOUBLE_CLICK, LEFT_PRESS, LEFT_RELEASE, RIGHT_PRESS, RIGHT_RELEASE.

ADV_FUNC_KEYEDCLICK: This function is called when a key on the keyboard is held down and the object is clicked on. Here the view is passing as parnode(2), the click code is passed in as parval(3), and the ascii value of the pressed key is passed in as parval(4). Possible click codes are: DOUBLE_CLICK, LEFT_PRESS, LEFT_RELEASE, RIGHT_PRESS, RIGHT_RELEASE.

This Page is Used By

basicfr



flexsim users manual
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Article

Contributors

paul.t contributed to this article

Navigation

FlexSim 2016.1