Re: Problem with 4Dscript
Posted: Friday 26 October, 2012 - 14:31
Hello David,
To achieve what I said you can do the following:
In your model, open the Atom Editor (shift + F5). Go to your source atom under O Model. There you can add an attribute, under "Attributes". Let's call this new attribute "counter".
"counter" needs to be set at 0 each time the model is reset. Go to "Events", and under "Reset" add the line:
'att([counter], c) := 0'.
Now you can, in your source in the model, add the following exit trigger;
do(
Label([productnr],i) := Att([counter],c),
Inc(Att([counter],c))
)
So now for each product that is generated via the source the 'counter' increases 1. This 'counter' is stored in each product under the label [productnr]. Using this label, you can separate the first product from the rest.
In the scara robot, you can for example under the 'pick selection rule' place a condition on this ([productnr]) label.
Let me know if this helps.
Regards,
Vincent.
To achieve what I said you can do the following:
In your model, open the Atom Editor (shift + F5). Go to your source atom under O Model. There you can add an attribute, under "Attributes". Let's call this new attribute "counter".
"counter" needs to be set at 0 each time the model is reset. Go to "Events", and under "Reset" add the line:
'att([counter], c) := 0'.
Now you can, in your source in the model, add the following exit trigger;
do(
Label([productnr],i) := Att([counter],c),
Inc(Att([counter],c))
)
So now for each product that is generated via the source the 'counter' increases 1. This 'counter' is stored in each product under the label [productnr]. Using this label, you can separate the first product from the rest.
In the scara robot, you can for example under the 'pick selection rule' place a condition on this ([productnr]) label.
Let me know if this helps.
Regards,
Vincent.