Skip to content

UUID Version 4 implements in Sysmac Studio.

License

Notifications You must be signed in to change notification settings

kmu2030/UUIDv4Lib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UUIDv4Lib

UUIDv4Lib provides version 4 UUID generation FB for Sysmac Studio. OMRON's Sysmac Studio is required to view and execute the code. For UUID, please refer to RFC 9562.

Environment

  • Sysmac Studio Version 1.60
  • NX102-9000 Ver 1.50 or higher compatible controller

How to use "UUIDv4Lib.slr"

  1. git clone this repository or download the zip.
  2. Reference "UUIDv4Lib.slr" in your project.

Also check "UUIDv4LibExample.smc2".

How to use "UUIDv4LibExample.smc2"

  1. git clone this repository or download the zip.
  2. Open "UUIDv4LibExample.smc2" in Sysmac Studio.
  3. Check "POU/Program/README".
  4. Build the project.
  5. Execute on simulator or actual machine.

"UUIDv4LibExample.smc2" includes "UUIDv4Lib.slr".

Explanation

UIDv4Lib provides version 4 UUID generation FB, but please keep the following in mind.

  1. Uses built-in Rand instruction for random number generation
    An unseeded Rand instruction is used to generate random numbers, but the Rand instruction is most likely not a CSPRNG. It may be replaced with a random number generator using a hash function in the future.

Generating UUID

CASE iState OF
  0:		
    iUUIDv4(Execute:=TRUE,
            // xxxxxxxx-xxxx-4xxx-[8-9,a-b]xxx-xxxxxxxxxxxx
            Out=>iUUID);

    Inc(iState);
END_CASE;

File hash

I recommend checking the hash value of the acquired Sysmac Studio project.

file sha256
UUIDv4Lib.slr 8ec7dc51a359f16fd036db89d6b747c865a6099a523366086311153d5a9a5de1
UUIDv4LibExample.scm2 004f1d4160c56f1e6147117a9ec7c141bfaa52051c2bcb35d56087b7304b8608

Releases

No releases published