Accessing parameters in a VAR block as longs
ciphernet
Posts: 24
Hi all,
Get a bit of trouble getting this code to work... What am I doing wrong???
I defined a DAT block with LONG values (approx 300 longs) and I get a constant error message: "Size overwrite must be smaller"
(Motor and mot·are defined·as LONG vars in the var section of my SPIN program)
In SPIN:
Motor:=MOTOR_MODE_VALUES.LONG[noparse][[/noparse]mot]
DAT
MOTOR_MODE_VALUES
·LONG·· 0095,0195,0295
·LONG·· 0395,0495,0595
·LONG·· 0695,0795,0895
·etc..
What am I doing wrong???
Jan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·Give me some slack, please.. I have programmed SX controllers for five years but the prop just blows my mind :-)
Get a bit of trouble getting this code to work... What am I doing wrong???
I defined a DAT block with LONG values (approx 300 longs) and I get a constant error message: "Size overwrite must be smaller"
(Motor and mot·are defined·as LONG vars in the var section of my SPIN program)
In SPIN:
Motor:=MOTOR_MODE_VALUES.LONG[noparse][[/noparse]mot]
DAT
MOTOR_MODE_VALUES
·LONG·· 0095,0195,0295
·LONG·· 0395,0495,0595
·LONG·· 0695,0795,0895
·etc..
What am I doing wrong???
Jan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·Give me some slack, please.. I have programmed SX controllers for five years but the prop just blows my mind :-)
Comments
I have tried that and I am checking the result on my Scopemeter. It seems like nothing happens, but I will have to check my code again. At least I get no error messages anymore.
Thanks for your reply. Your knowledge·about the prop is amazing.. :-)
Jan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·Give me some slack, please.. I have programmed SX controllers for five years but the prop just blows my mind :-)
The code you was using implies that the variable is an array. But it is declared in DAT section, so you can only access it as address.
Thomas
Post Edited (Kaio) : 7/9/2007 1:57:24 PM GMT
Jan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·Give me some slack, please.. I have programmed SX controllers for five years but the prop just blows my mind :-)