Help with STR ArrayVar\n\c with SerIn2


Closed Thread
Results 1 to 20 of 20
  1. #1
    leinske's Avatar
    leinske Guest

    Question Help with STR ArrayVar\n\c with SerIn2

    Hello evrybody, i would compile this line of code:

    SerIn2 GPSin,baudGPS,Timeout,GPS,[wait("$ECBWC"),wait(","),wait(","),DEC2 latdeg,DEC2 latmin,wait(","),NS,wait(","),DEC3 londeg,DEC2 lonmin,wait(","),EO,wait(","),truecourse,wait(",") ,wait(","),magcourse,wait(","),wait(","),dist,wait ("."),DEC2 distten,skip 3,wpid,skip 1,STR wp\2]

    when compiling with PBpro 2.43 I got this compile error :

    ERROR: Macro SERIN2STR?WL not found in macro file.

    can anybody help me with this error code ???? or post me this macro ?????

    thanks very much

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Hi leinske,

    You aren't missing any macros. It's just that STR can't work with WORD variables. It only works with array's.

    I believe you have "wp" defined as a WORD.
    <br>
    DT

  3. #3
    leinske's Avatar
    leinske Guest


    Did you find this post helpful? Yes | No

    Smile Thank's

    Thanks Darrel for the rapid answer, indeed my variable wp was a WORD array, sorry i had misreading the manual they says explicitly that the arrays must be a BYTE , change made to BYTE and compiling OK

    Leinske

  4. #4
    Almightyrastus's Avatar
    Almightyrastus Guest


    Did you find this post helpful? Yes | No

    Default

    Having the same dort of problems here too with STR and serin2

    my line of code is:

    SERIN2 PORTB.1, 188, 3000, RXERROR, [WAIT ("GPRMC"), skip 1, STR TIME\11\",", STR WARN\1, skip 1, STR LAT\10\",", STR NS\1, skip1, STR LONG\11\",", STR EW\1, skip 1, STR SPD\6\",", STR DIR\6\",", STR DATE\6]

    I have all the variables used set as:

    LAT VAR BYTE (10)

    and so on (with some being (1) or other values, nothing being used is defined as a word, the error message I keep getting is:

    *** Must be a BYTE ARRAY variable for STR! ***

    any help would be great

  5. #5
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    The only thing I see wrong is the skip1 in-between NS and LONG. Should have a space in there. But that won't cause the described error.

    It does compile without error if I create all the variables and fix the skip.
    Code:
    TIME  var BYTE[11]
    WARN  var BYTE
    LAT   var BYTE[10]
    NS    var BYTE
    LONG  var BYTE[11]
    EW    var BYTE
    SPD   var BYTE[6]
    DIR   var BYTE[6]
    DATE  var BYTE[6]
    
    SERIN2 PORTB.1, 188, 3000, RXERROR, [WAIT ("GPRMC"), skip 1, STR TIME\11\",", STR WARN\1, skip 1, STR LAT\10\",", STR NS\1, skip 1, STR LONG\11\",", STR EW\1, skip 1, STR SPD\6\",", STR DIR\6\",", STR DATE\6]
    
    RXERROR:
    <br>
    DT

  6. #6
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Change skip1 to skip 1.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  7. #7
    Almightyrastus's Avatar
    Almightyrastus Guest


    Did you find this post helpful? Yes | No

    Default

    Ok thanks, I fixed the skip 1 bit and recompiled, still no luck, still getting the same error on both lines that contain the STR command (there is another one just after this to save some more stuff).

  8. #8
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Can you post the variable declarations?

    Must be something there that your missing.

    The above example compiles fine. Is there anything different?
    <br>
    DT

  9. #9
    Almightyrastus's Avatar
    Almightyrastus Guest


    Did you find this post helpful? Yes | No

    Default

    '**********
    'Define variables
    '**********

    MENU var BYTE 'Menu variable
    TIME var BYTE(11) 'Time variable
    WARN var BYTE 'Warning variable
    LAT var BYTE(10) 'Latitude variable
    LONG var BYTE(11) 'Longitude variable
    NS var BYTE 'North/South variable
    EW var BYTE 'East/West variable
    SPD var BYTE(6) 'Speed variable
    DIR var BYTE(6) 'Direction variable
    DATE var BYTE(6) 'Date variable
    ALT var BYTE(5) 'Altitude in m variable
    ALTU var BYTE 'Altitude units
    HDOP var BYTE(5) 'Horizontal dilution of precision
    SAT var BYTE(2) 'Satellites used
    METRE var WORD 'Height in meters variable
    AFEET var WORD 'Height in feet variable
    TEMP var BYTE 'Temp. for altitude conversion
    MULT var WORD 'Multiplier for altitude conversion
    ALTVAR var BYTE 'Set number for times round loop
    ALTF var BYTE(5) 'Altitude in feet storage

    '**********
    'setup interrupts
    '**********

    OPTION_REG = $7f 'Enable PORTB pull-ups and rising edge trigger
    INTCON = $90 'Enable INTE (port b, pin 0) interrupt
    MENU = "0" 'Clear the menu variable
    ON INTERRUPT GOTO INT 'Define interrupt handler

    '***********
    'Startup Screen
    '***********

    PAUSE 100 'Allow LCD to power up for 750ms

    LCDOUT $FE, 1 'Clear screen and display information
    LCDOUT "GPS Display"

    PAUSE 500 'Startup screen pause time


    '**********
    'Main program
    '**********

    'First collect data from GPRMC and GPGGA strings

    RXLOOP:

    SERIN2 PORTB.1, 188, 3000, RXERROR, [WAIT ("GPRMC"), skip 1, STR TIME\11\",", STR WARN\1, skip 1, STR LAT\10\",", STR NS\1, skip 1, STR LONG\11\",", STR EW\1, skip 1, STR SPD\6\",", STR DIR\6\",", STR DATE\6]

    SERIN2 PORTB.1, 188, 3000, RXERROR, [WAIT ("GPGGA"), skip 39, STR SAT\2, skip 1, STR HDOP\5\",", STR ALT\6\",", STR ALTU\1]



    There you go, there is plenty more after that but that is the bits that are giving me the first set of troubles.

    /*edit*/ it is laid out better than that, much the same as the example you gave

  10. #10
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Hmmm, very odd. That also compiles without error here.

    Just added these labels.

    RXERROR:
    INT:

    Do you have any more SERIN2's in the program?

    Are you trying to create a Variable, Constant or Label named STR anywhere in the program?

    Added: What version of PBP do you have?

    DT
    Last edited by Darrel Taylor; - 11th May 2006 at 22:51. Reason: Version

  11. #11
    Almightyrastus's Avatar
    Almightyrastus Guest


    Did you find this post helpful? Yes | No

    Default

    I have just tried compiling only that code from above with adding in the 2 extra labels and I get the same errors as before. I am using proton compiler 2.1.3 to do this.

    I have to admit I am more than a bit new at doing all this so would there be any settings I have may have overlooked when starting out?

    I know the code I have is meant to work on a 16F628 as I have seen the end result from a previous application

  12. #12
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Ah, there we go. Wrong language.

    The program you have is written for PicBasic Pro from meLabs

    The compiler you have is Proton+ from Crownhill Associates.
    <br>
    DT

  13. #13
    Almightyrastus's Avatar
    Almightyrastus Guest


    Did you find this post helpful? Yes | No

    Default

    Ahh right that would explain a lot then, like I said I am kinda new to this hehe.

    I just hope I can get access to the compiler through uni and fast or I am stuffed to put it politely

    Thanks for your help

  14. #14
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    If it's an emergency or something, you might try
    http://www.compilespot.com/

    Pay by the month kind of deal. But might get you going while waiting for the compiler to be shipped.
    <br>
    DT
    DT

  15. #15
    Almightyrastus's Avatar
    Almightyrastus Guest


    Did you find this post helpful? Yes | No

    Default

    Thankyou so much, this may just save my skin (not to mention degree)

  16. #16
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Well, I'm not sure how much good I did by showing how you could compile someone else's program for your final project.

    But I guess now, you will at least have seen the compiler, once or twice.
    <br>

  17. #17
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    I just figured out what UNI was referring to. (warez)

    Sometimes my ignorance is astounding!

    Doh!

  18. #18
    Almightyrastus's Avatar
    Almightyrastus Guest


    Did you find this post helpful? Yes | No

    Default

    The code was written by a previous student for his final year project, I have to modify it to have extra functionality in the form of a waypoint indicator showing distance and direction back to a stored point.

    Uni was referring to university, nothing to do with warez

  19. #19
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    See how Astounding it is.

    Sorry about that!

    Sounds like a pretty tough first project with PBP.
    Best of Luck.

    DT

  20. #20
    Almightyrastus's Avatar
    Almightyrastus Guest


    Did you find this post helpful? Yes | No

    Default

    No worries, thankyou so much for all your help, I just need to program the chip now and hope everything all works as planned.

Similar Threads

  1. GPS $GPRMC to PIC16F684. Need help with SERIN2
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 27th November 2009, 09:47
  2. Getting SERIN2 to work?
    By BobPigford in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 22nd July 2009, 20:10
  3. SLOW Serin2 and Serout2
    By dragons_fire in forum General
    Replies: 3
    Last Post: - 26th June 2009, 02:38
  4. SERIN2 digit parsing
    By skimask in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 7th January 2007, 23:15
  5. Serin2 and STR Modifier
    By _Ian in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 22nd June 2005, 16:25

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