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.
- Sysmac Studio Version 1.60
- NX102-9000 Ver 1.50 or higher compatible controller
git clone
this repository or download the zip.- Reference "UUIDv4Lib.slr" in your project.
Also check "UUIDv4LibExample.smc2".
git clone
this repository or download the zip.- Open "UUIDv4LibExample.smc2" in Sysmac Studio.
- Check "POU/Program/README".
- Build the project.
- Execute on simulator or actual machine.
"UUIDv4LibExample.smc2" includes "UUIDv4Lib.slr".
UIDv4Lib provides version 4 UUID 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. It may be replaced with a random number generator using a hash function in the future.
CASE iState OF
0:
iUUIDv4(Execute:=TRUE,
// xxxxxxxx-xxxx-4xxx-[8-9,a-b]xxx-xxxxxxxxxxxx
Out=>iUUID);
Inc(iState);
END_CASE;
I recommend checking the hash value of the acquired Sysmac Studio project.
file | sha256 |
---|---|
UUIDv4Lib.slr | 8ec7dc51a359f16fd036db89d6b747c865a6099a523366086311153d5a9a5de1 |
UUIDv4LibExample.scm2 | 004f1d4160c56f1e6147117a9ec7c141bfaa52051c2bcb35d56087b7304b8608 |