Sign In

Don't have a Xilinx account yet?

  • Choose to receive important news and product information
  • Gain access to special content
  • Personalize your web experience on Xilinx.com

Create Account

Username

Password

Forgot your password?
XClose Panel
Xilinx Home
Reply
Regular Visitor
batindeko
Posts: 35
Registered: ‎02-20-2012
0

Error in MCode Block

[ Edited ]

Hallo everybody,

I would like to see the behaviour of some variables and counters inside my MCode Block. So what i did, I put these signals or variables as Inputs of my MCode Block after the simulation the following errors happen:

 Error("control_module.m"): line 4:12 The persistent declaration must precede any use of the variable samples_counter. Error("control_module.m"): line 5:12 The persistent declaration must precede any use of the variable signals_counter. 

Any suggestions are welcome

Thanks in advance

Cheers,

Olivier

Regular Visitor
batindeko
Posts: 35
Registered: ‎02-20-2012
0

Re: Error in MCode Block

[ Edited ]

here is an extract of my code

Expert Contributor
eilert
Posts: 2,060
Registered: ‎08-14-2007
0

Re: Error in MCode Block

Hi,

as the error message said, you can't use some variable name before the persistent declaration, and the function parameter list is such a forbidden use.

I think you should use the debbugging methods offered by Matlab.

(Actually I have no experience with that)

 

Alternatively, you could use some other names in the parameter list, and then assign the persistent variables to these names in the code. (Q&D-Solution)

 

Have a nice simulation

  Eilert

Regular Visitor
batindeko
Posts: 35
Registered: ‎02-20-2012
0

Re: Error in MCode Block

Thank a lot for your contribution. it give me already some ideas.

Cheers,

Olivier