Under review

Undefined Qcode variable without error

Pierre Fagrell 2 weeks ago in IQANdesign updated by Gustav Widén (System support) 5 days ago 5

IQANdesign 6.00

I have a function group that I have copied from an MC42 to MD4.

Everything looks ok and project check shows no errors but simulator behaves weird so I start to investigate.

As soon as I click on the digital channel "reset 10k pulses mx" it turns red and I notice one variable in the Qcode is undefined:

Now if I do a project check I also get the error message "Undefined Reference"

Under review

Do you have another channel with the exact same name that is also in scope?

What you describe, with the error not showing until you click on the channel sounds a lot like the behavior when there is a duplicate name.

If you make a change that creates another channel with identical name that is also in scope (e.g. by making the channel with the same name public scope), you will have this situation.

The old Qcode expression will be intact and refer to the original channel, but when you click on it IQANdesign goes through it again and can no longer resolve the expression.   

But if this is the issue here, I would have expected a different error message. If it is the problem with duplicate names then the old name should have been in the expression, and the tool tip should have shown "component name not unique"

On a side note, this is an alternative way of implementing what you have that is slightly more efficient:

Hello Gustav

I do not have anything with the same name in scope.

If I start to type in a new variable in this function the following three variables are displayed as alternatives:

  • Mixingscrew new
  • Mixingscrew REAL
  • Mixingscrews Prod. Manual

If I actually check the project source (while the error is still invisible). I can see that it shows Undefined:

To reiterate what I did:

  • I had a project with MD4+MC42
  • Add XC42
  • Copy function group from MC42 to XC42
  • Change some function names in the group to make them more unique while reassigning new inputs from XC42
  • Delete MC42 from project

RE side note: Thanks. There is a lot in this inherited project that can be improved, All suggestions are appreciated, I am working on it slowly :)

Thanks. I tried reproducing in different ways, so far without success. 

-copy or move? (when moving the channels keep their component ID:s)

-do you remember at what point you assigned the DPCNT to the XC42? 

I restored some old versions of the project and I can see that I did copy the function.

Then I renamed these channels because in the original MC42 function there are five channels with the same name "reset 10k pulses".

After that I probably clicked the DPCNT in the copied function and clicked "Replace channel"

If you need I can ofcourse send you the project via email.

Thanks Pierre! I managed to reproduce the bug, the problem came with the Replace channel operation.