Is there a label restriction


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    May 2006
    Posts
    36

    Default Is there a label restriction

    Is there a label restriction that exists? I am working with the PIC16F687 and am getting errors that telling me that ID XXX is not a label. When I look in the code explorer thing, I am finding that the ID I am trying to use, e.g. XXX is showing up but I am still getting an error. I have made sure I do not have spelling errors. I have changed it to other labels but I am still having the problem. I am using PICBASIC Pro 2.46 and I just downloaded and installed the patch. I currently am trying to use 45 labels in my program. Thanks for your help.

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Unless you're using a reserved word, there's no label limit/restriction. Just make sure it's a label problem and not something else.

    Yeah sometime the error messages have nothing to do with the REAL problem....

    post your code here, we could spot it for you.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    May 2006
    Posts
    36


    Did you find this post helpful? Yes | No

    Default

    Here is part of my code. This is for communication from one micro to another. I can't seem to find it. Thanks.

    INITIATE_COMM VAR PORTA.2

    SETUP_SERIAL_RECEIVE:
    PAUSe 10
    GOSUB SERIAL_REQUEST
    TRISC = %01000000
    PAUSE 10
    LISTEN_RECEIVE:
    BUTTON INITIATE_COMM, 1, 255, 0, C7, 0, RX -line 258, ID not Label
    PAUSE 10
    GOTO LISTEN_RECEIVE

    SERIAL_REQUEST:
    ' request variable values
    OUTPUT_DATA_REQUEST = 1 ' request other chip to communicate
    BUTTON INITIATE_COMM, 1, 255, 0, C7, 1, RETURN -line 265, bad exp
    PAUSE 10
    GOTO SERIAL_REQUEST

    RX:
    OUTPUT_DATA_REQUEST = 0 ' turn off pin to send data
    PAUSE 10
    SERIN2 SERIAL_INPUT, 600, [WAIT("A"), BIN MODE] - line 272, bad exp

    SETUP_SERIAL_TRANSMIT:
    PAUSe 10
    GOSUB SERIAL_REQUEST
    TRISC = %01000000
    PAUSE 10
    LISTEN_XMIT:
    BUTTON INITIATE_COMM, 1, 255, 0, C7, 0, TRANSMIT_DATA - line 280, bad ex
    PAUSE 10
    GOTO LISTEN_XMIT -line 282, ID not a label

    TRANSMIT_DATA:
    PAUSE 10

    -------
    Errors
    ERROR Line 258: ID RX is not a label. (16F687 Controller w LCD v01.pbp)
    ERROR Line 265: Bad expression. (16F687 Controller w LCD v01.pbp)
    ERROR Line 272: Bad expression. (16F687 Controller w LCD v01.pbp)
    ERROR Line 280: Bad expression. (16F687 Controller w LCD v01.pbp)
    ERROR Line 282: ID LISTEN_XMIT is not a LABEL. (16F687 Controller w LCD v01.pbp)

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    it will be hard without the whole variable definition but...
    Code:
    BUTTON INITIATE_COMM, 1, 255, 0, C7, 0, RX -line 258, ID not Label
    how you defined C7 and RX?

    Code:
    BUTTON INITIATE_COMM, 1, 255, 0, C7, 1, RETURN -line 265, bad exp
    RETURN is a reserved word.. you MUST use a label name where to jump. On this label you will use a return.

    Code:
    SERIN2 SERIAL_INPUT, 600, [WAIT("A"), BIN MODE] - line 272, bad exp
    Shouldn't be a problem... and you know that 600 is not 600 bauds right?
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    Join Date
    May 2006
    Posts
    36


    Did you find this post helpful? Yes | No

    Default

    C7 VAR BYTE
    Rx should be used as label and not used anywhere else.

    I thought maybe I could use RETURN because I am doing a gosub to to jump into sub routine and then I want to exit that and return to what i was doing.

    ---------------
    I decided not to try use the one piece of code as a sub-routine and fixed this by just with putting the code in twice. The problem disappeared. My program is huge and I was trying to be extra efficient. I think i am going to have to just go with a micro that has a larger memory. I am using a LCD with this application communicating serially. The code seems to be piling up quickly.

  6. #6
    Join Date
    May 2006
    Posts
    36


    Did you find this post helpful? Yes | No

    Default

    I compiled my code for the 16F687 and saw that it came up to 2042 words and I am still not done writing. I thought I would migrate up to the 16F689 and the code size jumps to 2571 words. Is this because it now needs to go back and forth between memory pages.

Similar Threads

  1. PBP projects for R/C models
    By malc-c in forum Code Examples
    Replies: 771
    Last Post: - 21st October 2016, 12:56
  2. Instant Interrupts - Revisited
    By Darrel Taylor in forum Code Examples
    Replies: 772
    Last Post: - 17th February 2016, 22:14
  3. I2C optional label question
    By F1CHF in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 13th July 2009, 17:17
  4. Can a line label be aliased to a VAR?
    By LinkMTech in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 22nd December 2008, 22:29
  5. 18F452 "Unknown Processor" errors
    By schwinn_rider in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 27th April 2006, 03:56

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts