Error Messages

If you have problems in using the Visual Basic extension we suggest you read this section. It contains some hints to get you around common problems.

+== Expected

“Expected :=”

This Visual Basic error message means you have placed brackets around the parameters of a call to a “Sub”.

Remove the brackets.

Syntax Issues

Brackets in calls to procedures in Simul8 are one of the most common forms of syntax problem when using Visual Basic.

In Simul8 help the VISUAL BASIC declaration of each Simul8 procedure is provided.

If the procedure is of the form:

  Function AttribValue (attname As String) As Single

i.e. with the word FUNCTION at the start then it must be used in the following way in Visual Basic:

X = AttribValue(“My label”)

i.e. you must say “variable name equals function name” and the parameters of the function must be in brackets.

If the procedure is of the form:

  Sub AdjustRoutePercent (ByVal fromname$)

i.e. with the word SUB at the start then it must be used in the following way in Visual Basic:

  AdjustRoutePercent "Work Center 1"

i.e. you must start the line with the name of the procedure and NOT use brackets around the parameter names.

Can't Find Visual Basic

This message usually appears for one of these reasons:

You are not running Visual Basic or you have load loaded your Visual Basic project (and pressed the Visual Basic RUN button). (Usually you can fix this immediately and just click the RETRY button).

You have forgotten to set the form's “Link Mode” to “Source”.

Your form's “Link Topic” is not the same as specified in the Simul8 Extensions / Visual Basic dialog box.

Your form is not on the screen (it does not actually need to be visible but is does need to be “Loaded” - if it is not your main form have you said “Form.Load” somewhere in your Visual Basic program before the point where Simul8 tries to work with it?).

You have made your Visual Basic project into a .EXE and the ????.EXE file is not on the disk (in the place where you told Simul8 to look for it).

Cannot add Work Items at this time

VB is not allowed to add one of the first three Work Items in the entire simulation.

This enables Simul8 to handle memory much more efficiently than would otherwise be possible.

Solution: Create a Storage Bin that is not connected to any other object and set its “START UP” conditions so that it contains three Work Items of any type. This will ensure that the simulation always contains three Work Items before VB is every asked to adjust the simulation.