Shop OBEX P1 Docs P2 Docs Learn Events
What is the function of Pgm_ID: in the SX/B template? — Parallax Forums

What is the function of Pgm_ID: in the SX/B template?

John KauffmanJohn Kauffman Posts: 653
edited 2006-03-15 00:46 in General Discussion
What is the function of Pgm_ID: in the SX/B template?
·
The SX/B template (downloaded from Parallax & copied below) includes a line to create a table in the program that holds a string and a zero (following).
·
Pgm_ID:
· DATA· "SX/B Template", 0
·
That line is not used in the SX/B examples (Dice, Keypad, etc.). I am guessing that it is a standardized place to hold the name of the program. I’m guessing the second datum in the table might be the version number. So when I save version 2 of my program I would change the command to be:
·
Pgm_ID:
· DATA· "MyProgramName", 2
·
Questions:
ð······ Are above assumptions correct?
ð······ When I remove this line there seems to be no effect. Is it optional?
ð······ Is there a convention that when a programmer wants to check the name or version of the running program it will look at this specific table?
·
Thanks.

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-03-14 23:28
    Some of the programs we write will report a firmware version when "asked" -- this is usually stored as a z-string in the manner demonstrated by Pgm_ID.··Note that the zero terminator is by design; the string-transmitting routine uses this to mark the end of that string.

    If this function isn't part of your program you can delete the string.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • BeanBean Posts: 8,129
    edited 2006-03-15 00:35
    John,
    There is an ID command. That allows upto an 8 character string to be stored in the SX chip. This is used to determine what version of firmare is in a SX chip. If from the IDE you choose RUN->DEVICE then click the READ button the ID field will be set to the ID when the SX was programmed. This is very important when you choose to PROTECT the code in the SX, because the ID can always be read whether the device is protected or not.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012

    "SX-Video OSD module" Now available from Parallax for only·$49.95
    http://www.parallax.com/detail.asp?product_id=30015

    Product web site: www.sxvm.com

    "Wise men know when they're right. The wisest also·know when they're wrong."
    ·
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-03-15 00:46
    To show you what Bean is talking about, I've attached our program for the RC-4 module that we have in our EFX line.· As Bean points out, the ID information can be read from a loaded hex file; this is what we send to our board vendor for programming the chips.· The ID string in a DATA statement is sent back to the host when requested.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
Sign In or Register to comment.