DLL topic:Simulation do not stop when Initialize return 0

Report your bugs here.

Moderators: Frank, paul, Hiwot, Chris, peter

Post Reply
Posts: 11
Joined: Thu Aug 24, 2006 2:09 pm

DLL topic:Simulation do not stop when Initialize return 0

Post by tomapedersen » Fri Sep 08, 2006 12:31 pm

I have written a DLL which I'm using in 20Sim. I thought simulation should not start if Initialize returned 0, so just for fun I let the Initialize return 0. When I press start, the simulation runs, I do not get feedback that there are errors in the initiale phase. Then I tried to return 1 from "myFunction" (normally returns 0 if successful), and the simulation stops and the Message Log shows: Error occured in user dll-function "myFunction". This should also happen when Initialize returns 0.


Posts: 23
Joined: Wed Sep 28, 2005 9:32 am
Location: Controllab Products B.V.

Post by Frank » Wed Jan 24, 2007 5:51 pm

You are right. The return type of the initialize function is not checked. It will be fixed in the new build of 20-sim. The return value of 0 will be interpreted as succes, just as the "normal" functions. Another return value will be interpreted as error. The idea behind this method was that different return values could indicate different kind of errors. Unfortunately we never expanded this functionality to make a list of error codes. But for backward compatibility reasons it is difficult to change this definition.

member 20-sim development team

Post Reply