Book a Demo

Author Topic: ReferencError variable is not defined  (Read 4954 times)

blabla

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
ReferencError variable is not defined
« on: April 03, 2015, 01:23:03 am »
Hello,

this is my first time I work with UML and EA. I'm sorry for stupid questions. I'm using the new EA 12 version.
I want to do a simple State diagramm with a transition.
I define a variable with right klick on state->features and properties->set Run state. The name of the variable typ int is "a". At the entry the first state should set the value of "a" to 1. The transition to the next state ist [a==1].

at the simulation execution a error occur

ReferenceError:a is not defined


picture: http://www.pic-upload.de/view-26596068/Error.jpg.html

May be someone can help me. Thanks for every help  ;)

[timestamp=1427985079]
« Last Edit: April 03, 2015, 01:42:46 am by blablabla »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: ReferencError variable is not defined
« Reply #1 on: April 15, 2015, 08:33:54 am »
Not sure why you're getting the error. It seems like the entry behavior is being executed in a different scope to the condition. (Alternately, you may need to define the variable first before you use it)

I would try changing "a" to "sim.a". This allows it to be treated as a global variable within the simulation and be displayed in the debug locals window.
« Last Edit: April 15, 2015, 08:36:08 am by simonm »