Cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with ExitforNextEnteringMU

Valued Contributor
Valued Contributor

Hello,

 

I am having a weird issue with an assigned parameter. This is my code:

Temp.png 

I have the first line in because the first section of code doesn't seem to function without it. However, I recently added the elseif statement in line 19, and I think it is causing problems with the first line.

 

The error I am getting is this: Incompatible types of argument1: expecting integer, passed object.

 

I don't understand where an object is being passed.

 

Please help, sorry about how complicated the code is with .succ's, thanks in advance.

21 REPLIES 21

Re: Issue with ExitforNextEnteringMU

Phenom
Phenom

Why do you think line 19 is causing the problems ?

 

it seems you defined the (first) parameter ( exitForNextEnteringMU) as integer

and passed an object  to the method.

 

 

Re: Issue with ExitforNextEnteringMU

Phenom
Phenom

its seems your 1. parameter is defined as integer and you are passing an object to your code

 

Why do you think line 19 causes a problem ?

 

Re: Issue with ExitforNextEnteringMU

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

how do you call this method, what line is red?

Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: Issue with ExitforNextEnteringMU

Valued Contributor
Valued Contributor
Line 1: the line assigning the parameter is the line that is red.

Re: Issue with ExitforNextEnteringMU

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

is it an exitcontrol, sensor-control, observer...?

Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: Issue with ExitforNextEnteringMU

Valued Contributor
Valued Contributor
Exit strategy on a converter
Highlighted

Re: Issue with ExitforNextEnteringMU

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

sorry no idea, the parameter type is right, it is the number of the entrance

 

I get such a failure, iif I return the entrance number

 

 

 

 

Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: Issue with ExitforNextEnteringMU

Valued Contributor
Valued Contributor

Ok let me ask you a related question then. I gave up on the code that I posted earlier after messing with it for quite a while and decied to try to rebuild something else.

 

I have already run into an issue with the new code though.

temp2.png

 

I can't figure out why this isn't working, but I'm hoping it is just a hole in my knowledge of SimTalk. What is wrong with the code that is noted as an error?

 

It reads: If .Models.Reynosa.AB1.numMU + .Models.Reynosa.Line11.numMU + .Models.Reynosa.PSTOP_AB1.numMU < 2

Re: Issue with ExitforNextEnteringMU

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

the failure means, that at the call of the method a parameter is passed (integer), but you dont have defined one

 

insert into the first line

 

param p:integer

Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net