I have created code that can be quickly added to a complex model to calculate touch time (only where operators are required). The only time it doesn't seem to work is when you are using the label on an item to calculate your setup and/or process time (which we do in some of our models).
Explanation of model:
A "touchtime" label is set on the item creation in the source. All of the processors, combiners, and separators are added to the "Processors" group. The process flow has an event triggered source that is triggered anytime an item exits one of the objects in the "Processors" group, and adds the item name and processor name to labels on the token. The custom code is well commented, but it adds the setup and/or process times to the "touchtime" label on the 3D item.
There are four different examples (finish queues for Type A, B, C, D):
- Type A - uses a distribution (works)
- Type B - on entry to processor sets "itemSetupTime" label, then uses that label to identify the setup time. (doesn't work)
- Type C - splits the touch time across the units in the tote (works)
- Type D - no touch time (works)
Explanation of problem:
On lines 22 and 28 of the custom code in the process flow, the custom code is executing the code in the processor's setup time and process time. Because it is not the processor that is executing the code, the "current" and "item" variables are not set correctly. (Note - I realize that if it executes a distribution, it will pull a different value from the distribution than the actual 3D model did. This is not ideal, but is acceptable.)
Question:
Is there a way around this? Is it possible in process flow to access the actual value that was returned in the processor's setup/process code? This would be better all around as it would solve my problem and make the label touch time reflect that specific item's actual touch time. I could have separate event triggered sources for the setup and process times if separate triggers are needed.
For this to be useful for us, we need to avoid making any changes to the processors/the processor's code since there are large numbers of processors in our models. Ideally all of the code will be in process flow that can be applied to all of the items in the group "Processors".