scilabxcos

How to define global variables in xcos/scicos block diagram simulation?


I want to define global variables in an xcos/scicos signal flow diagram. I tried the block Simulation>set context:

enter image description here enter image description here

But then it does not accept it as a known variable anywhere:

enter image description here

P.S. I tried the block diagram on a different computer and it now works with semicolons. Apparently this was a glitch or a bug!


Solution

  • OK, this is a bit strange but for some reason that semicolon at the end was the issue! So if you just omit the ; and put variables line by line it all works out:

    a = 2
    b = 3
    ...
    

    More elaborate tutorial on how/why using the set context here.