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.
- Sysmac Studio Version 1.60
- NX102-9000 Ver 1.50 or higher compatible controller
git clone
this repository or download the zip.- Reference "ULIDLib.slr" in your project.
Also check "ULIDLibExample.smc2".
git clone
this repository or download the zip.- Open "ULIDLibExample.smc2" in Sysmac Studio.
- Check "POU/Program/README".
- Build the project.
- Execute on simulator or actual machine.
"ULIDLibExample.smc2" includes "ULIDLib.slr".
ULIDLib provides ULID generation FB, but please keep the following in mind.
- 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.
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;
I recommend checking the hash value of the acquired Sysmac Studio project.
file | sha256 |
---|---|
ULIDLib.slr | 3a03e8d6e5df406dc1d4c4b002f483d2f0c886c726ac26c32746b9fa632316e3 |
ULIDLibExample.scm2 | 0e12a4dbc194378d22ff3471d9a2f2dcfb594bb5014295229e12f33b495446c1 |