MoveRequest error

All topics on coding 4Dscript in Enterprise Dynamics.
Post Reply
a.jorge
Posts: 7
Joined: Tuesday 22 May, 2012 - 09:23

MoveRequest error

Post by a.jorge »

hello,
I have got a problem with function " move request" .when i use this function to move product from a multiservice the model runs correctly for a few products then i get this error :

4DScript:error at "Case":Access violation at address 00785BE6 in module 'ed.exe'. Read of address 35343969

when i push "OK" the model continues .(after a while the error appears again an so on..)

why is this error appearing and how could i fix it?
MarvinH
Posts: 93
Joined: Tuesday 25 January, 2011 - 11:07
Contact:

Re: MoveRequest error

Post by MarvinH »

Hello!

The MoveRequest function should not generate access violations. Are you using default atom code, or did you modify atoms (e.g. put a MoveRequest in a Entry or Exit trigger) yourself? As you indicate that:
a.jorge wrote: the model runs correctly for a few products then i get this error :

4DScript:error at "Case":Access violation at address 00785BE6 in module 'ed.exe'. Read of address 35343969
it is hard to determine where these errors are caused. Maybe you could upload (part of) your model in which this situation occurs such that I can have a look at it.

Kind regards,

Marvin
a.jorge
Posts: 7
Joined: Tuesday 22 May, 2012 - 09:23

Re: MoveRequest error

Post by a.jorge »

Thank you for the replay,

I uploaded part of my model in which i get the error.

the error in this simple model appears less often ,and even sometimes it appears after 72 hours sim.(not real elapsed time) time (for the first time) .
therefore ,you may need to run it for a relatively long time to face the error.



Jorge
Attachments
moverequestError.mod
(24.63 KiB) Downloaded 289 times
MarvinH
Posts: 93
Joined: Tuesday 25 January, 2011 - 11:07
Contact:

Re: MoveRequest error

Post by MarvinH »

Hello Jorge!

Thanks for your model.

In the Assembler, you are overruling the default behavior of the MultiService atom. Instead of sending a product from the MultiService when it has completed its cycle time, you are pulling the atom out of the MultiService when a product entered the Assembler. This is possible, however there are some events scheduled for the product at the MultiService already by the MultiService atom. So after you pulled out the product, at the end of the cycle time of the MultiService, the product was already pulled out and destroyed. This caused the access violation.

In order to run the model without errors, please use the following (modified) Entry Trigger on the assembler:

Code: Select all

Do(
 Var([atmI], vbAtom),
 
 { * Product to be pulled out from the MultiService * }
 atmI := First(Out(2,c)),
 
 { * Destroy the events for this product at the MultiService * }
 DestroyEventsOfAtom(Out(2,c), 0, atmI),
 
 { * Open the output channel of the MultiService * }
 OpenOC(2, Out(2,c)),
 
 { * Pull out the product * }
 MoveRequest(atmI,2)
)
Hopes this fixes the errors in your original model as well!

Kind regards,

Marvin
a.jorge
Posts: 7
Joined: Tuesday 22 May, 2012 - 09:23

Re: MoveRequest error

Post by a.jorge »

Thank you very much Marvin.
It worked in both sample and main models.

Sincerely,
Jorge
Post Reply