​ ​ ​ ​ Using time of programming as unique ID
Results 1 to 5 of 5

Thread: Using time of programming as unique ID

  1. #1
    Senior Member
    Join Date
    Jan 1970
    Location
    Brisbane, Australia
    Posts
    169

    Default Using time of programming as unique ID

    Folks - Not too long ago there was a thread which spoke about using the time of day when the Picaxe was initially
    programmed with its firmware to create a reasonably unique ID if one wanted to use multiple Picaxes in a network.
    I have searched high and low and haven't been able to find it.
    Is there anybody out there who can recall this.
    As always - any assistance is appreciated.
    Hooter

  2. #2
    Technical Support
    Join Date
    Jan 1970
    Location
    UK
    Posts
    24,346

    Default

    The 'ppp' pre-processor parameter substitutions are what you are probably thinking of ...

    http://www.picaxe.com/BASIC-Commands...s/preprocessor

    You can insert ppp_datetime and others into a SERTXD ...

    Code:
    SerTxd( "Created on ", ppp_datetime, CR, LF )
    And you can also use similar to create a unique ID ...

    Code:
    SerTxd( "Created on ", ppp_datetime, CR, LF )
    w0 = 0
    For b2 = 0 To 18
      ; 0123456789-12345678
      ; 2018-05-29 13:46:50
      LookUp b2,( ppp_datetime ),b3
      w0 = w0 + b3
    Next
    SerTxd( "Unique ID = ", #w0, CR, LF )
    You can also include those within EEPROM or TABLE statements and read the data from there or use that to create a unique ID ...

    Code:
    Eeprom 0, ( ppp_datetime )
    
    SerTxd( "Created on " )
    For b2 = 0 To 18
      Read b2, b3
      SerTxd( b3 )
      w0 = w0 + b3
    Next
    SerTxd( CR, LF, "Unique ID = ", #w0, CR, LF )

  3. #3
    Senior Member
    Join Date
    Jan 1970
    Location
    Brisbane, Australia
    Posts
    169

    Default

    Hippy - Thanks for that. Exactly what I was looking for.
    Cheers

  4. #4
    Senior Member
    Join Date
    Feb 2010
    Location
    Don't Mess With My Texas!
    Posts
    2,559
    Blog Entries
    7

    Default

    Hooter, this thread might help also.

    http://www.picaxeforum.co.uk/showthr...er-to-Hardware

  5. #5
    Senior Member
    Join Date
    Jan 1970
    Location
    Brisbane, Australia
    Posts
    169

    Default

    Thanks Tex - That's the post I was looking for.
    Cheers

Bookmarks

Posting Permissions

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