Showing results for 
Search instead for 
Do you mean 
Reply
Solved! Go to solution

Error in methods

hello everyone

 

I got a problem while running a method which i used to create parts in a table file. I am attaching my model please check it and help me.

 

 

6 REPLIES
Solution
Solution
Accepted by topic author gopi
‎12-01-2016 11:22 AM

Re: Error in methods

Hi Gopi,

 

You will fix the creation problem by formating the Column for "MU" from "string" to "object" in your table called "initial_modules".

 

Best Regards

 

Johan

 

Re: Error in methods

Thank you ver much JohanBO. it is working now

 

I have got two more errors in the same models regarding @.name and comparing operators with global variable.

.models.life_3.modules_stock[1,@.name]:=.models.life_3.modules_stock[1,@.name]+1;

and

 if .models.life_3.plant_WH_stock[1,1] >= .models.life_3.Variant_A (here Variant_A is global variable)

 

Could you please run two following methods  in the same model and tell where i am doing wrong.

1)Models-Life_3--Information flow(method)

2)Modes-Life_3--Module_pick(sub frame)---Module_transport(method)

 

Thanks

 

best regards

 

Re: Error in methods

Hi again gopi,

 

If you look at the debugger for the @ (MU) that is causing the problem you can see that it has name PFM. This name does not exist in the table file, hence the problem.

 

ProblemGOPI.png

 

But even if name exist your method will with the line:

 

.models.life_3.modules_stock[1,@.name]:=.models.life_3.modules_stock[1,@.name]+1

 

"string" := "string"+"integer"

 

you probably want change the coulmn from 1 to 2

 

.models.life_3.modules_stock[2,@.name]:=.models.life_3.modules_stock[2,@.name]+1

 

so that it will write "integer" := "integer"+"integer"

 

Johan

 

 

Re: Error in methods

Thank you Johan

 

I am sorry i didn't get it actually.

The name of the MU is Main frame red and it's Attribute id PFM. i think we can enter the only name in the table file not the attribute.

 

my intention is to count the Mu's which are entering into the supermarket, so i can only address it in the table as [1,@.name].

 

I am Sorry if i am wrong, i couldn't able to fix it. could you edit and fix it if possible.

 

Thank you very much again

 

best regards

Solution
Solution
Accepted by topic author gopi
‎12-01-2016 11:22 AM

Re: Error in methods

Hello Gopi,

 

I can't go through and verify the logic in all those lines of code. However it seems like the general problem you got is that the Method seems to be authored to read from Tables with a Column Index.

 

I've fixed this with the 3-4 errors that was poping up. 

 

Best Regards

Johan

 

 

 

 

Re: Error in methods

Thank you very much for your time JohanBo. That's what exactly i wanted.

 

I have one more question that, do you have any examples regarding how can we use RFID in simulation?

If you have any could you share me some examples.

 

Thank you very much once again

 

best regards