question

ernesto daniel AG2 avatar image
0 Likes"
ernesto daniel AG2 asked Jeff Nordgren answered

help with custom code

carrusel-pintura-2.fsm

Hello everyone, I have a problem when I execute a "custom code", in the box " carga ensamble operador 12 patin 2", there are two custom codes in the sub flows, what I would like you to do is that when the custom codes are activated the operator 12, it will change its state from idle to utilize.

thanks.

custom code
· 2
5 |100000

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

Sebastian Hemmann avatar image Sebastian Hemmann commented ·

Hey,

your code is working exactly as you tell it to do.

It is setting your operator12 to the state Utilize, but in the exact same moment you also tell the operator to load another item and this automatically sets the operator to another state!

So could you please explain a little more about what your process is like and what you are trying to do. I think you are going a wrong way, to get the right results actually!

For me it looks as if your operator12 has to load a hand full off parts. And afterwards it should unload this parts. And you now want to say, the whole "load" and "unload" process should be in shown in one state ("utilize")?

3 Likes 3 ·
ernesto daniel AG2 avatar image ernesto daniel AG2 commented ·

Hi @sebastian.hemmann, thanks for your answer.

And as you say in the last line, what I would like is that during the loading and unloading process, both in the forklift and in the queue, the operator's status is shown as "utilize"

0 Likes 0 ·

1 Answer

Jeff Nordgren avatar image
1 Like"
Jeff Nordgren answered
@ernesto daniel AG2

You need to put another Delay block with a very small time value (0.01) just before your Custom Code block. This allows all previous code to be completed before changing the state. See this post for more information.

Thanks.

5 |100000

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