Shop OBEX P1 Docs P2 Docs Learn Events
Propbasic: Invalid Parameter on HUB variable in 2nd Task (v99) [Solved] — Parallax Forums

Propbasic: Invalid Parameter on HUB variable in 2nd Task (v99) [Solved]

YendorYendor Posts: 288
edited 2010-05-26 14:18 in Propeller 1
Bean,

I took the code and added a hub variable 'myval', and tried to increment the value in my 2nd task.

It comes back as 'invalid parameter'.

Also, for fun, in the Serial_RX task, I added

INC RxHead
INC HPntr

And it comes back with invalid parameter for RxHead.

Am I doing something wrong?

Thanks!


Post Edited (Yendor) : 5/26/2010 2:20:38 PM GMT

Comments

  • Gerry KeelyGerry Keely Posts: 75
    edited 2010-05-26 06:19
    Hi

    Inc applies to cog variables only.the variable RxHead is a hub variable.

    regards



    Gerry
  • BeanBean Posts: 8,129
    edited 2010-05-26 11:37
    Yendor,
    Yeap, Gerry is exactly correct. HUB variables are not directly accessible. You'll need to do:

    RDBYTE rxHead, temp
    INC temp
    WRBYTE rxHead, temp

    Of course you may not need the WRBYTE if the updated value doesn't have to be permanent.

    Bean

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Use BASIC on the Propeller with the speed of assembly language.
    PropBASIC thread http://forums.parallax.com/showthread.php?p=867134

    March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    There are two rules in life:
    · 1) Never divulge all information
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    If you choose not to decide, you still have made a choice. [noparse][[/noparse]RUSH - Freewill]
  • YendorYendor Posts: 288
    edited 2010-05-26 14:18
    Missed that - thanks!
Sign In or Register to comment.