Skip to content

ULID implements in Sysmac Studio.

License

Notifications You must be signed in to change notification settings

kmu2030/ULIDLib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ULIDLib

ULIDLib provides ULID generation FB for Sysmac Studio. OMRON's Sysmac Studio is required to view and execute the code. For ULID, please refer to Universally Unique Lexicographically Sortable Identifier.

Environment

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

How to use "ULIDLib.slr"

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

Also check "ULIDLibExample.smc2".

How to use "ULIDLibExample.smc2"

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

"ULIDLibExample.smc2" includes "ULIDLib.slr".

Explanation

ULIDLib provides ULID 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.

Generating ULID

CASE iState OF
  0:		
    iULIDGen(Execute:=TRUE,
             // Japan
             UtcOffset:=TIME#+9h,
             // 1733800332500ms
             Timestamp:=DT#2024-12-10-12:12:12.500_000_000,
             // 01JEQ8V36Mxxxxxxxxxxxxxxxx
             Out=>iULID);

    Inc(iState);
END_CASE;

File hash

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

file sha256
ULIDLib.slr 3a03e8d6e5df406dc1d4c4b002f483d2f0c886c726ac26c32746b9fa632316e3
ULIDLibExample.scm2 0e12a4dbc194378d22ff3471d9a2f2dcfb594bb5014295229e12f33b495446c1