PE Error, naming adc pins..

In order to make my programs more readable, I like to assign names/symbols for variables and I/O ports/pins (20X2 and PE 5.5.0).
So, Instead of:
readadc10 C.7,w3 (which works fine as expected))
I tried this:
symbol adpin = C.7
symbol advalue = w3
…..
readadc10 adpin,advalue

But that produces : 'Error: Valid ADC channels are 1-11 only!'
Furthermore, redefining adpin to B.0 gives: 'Error: ADC channel 0 does not exist!' .
While 'readadc10 B.0,advalue' - works as expected.
However, PE accepts adinp defined as B.7 , - which is somewhat peculiar…
(while readadc10 B.7,advalue correctly gives 'Error: Pin B.7 has no ADC channel!')
The rest of the adc input pins seem ok. Well, no big deal, just thought you'd like to know if this is a PE bug.
 
Thanks for a swift answer .... And even in the manual! Shame on me, - I have used adc pins a lot without noticing this. Funny, though, that my way of defining adc-pins works with most of them..
 

Technical

Technical Support
Staff member
It's a common mistake on X2 parts, so the PE silently 'auto-corrects' the pin numbers it recognises to the corresponding ADC channel during the program parsing. However it can't 'autocorrect' symbols.
 
Top