<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>Ticket search results</title><link>https://forge.codesys.com/tol/iec-snippets/snippets/</link><description>You searched for labels:"Random"</description><language>en</language><lastBuildDate>Sun, 17 May 2020 08:41:37 -0000</lastBuildDate><item><title>RandomUINT() //Random Number Generator</title><link>https://forge.codesys.com/tol/iec-snippets/snippets/4/</link><description>~~~ST
FUNCTION RandomUDINT : UDINT
VAR
	bMarlonRando : UDINT;
	mbs : CmpCrypto.CmpCrypto_Interfaces.RtsByteString := (ui32Len := 4, ui32MaxLen := 4, pByData := ADR(bMarlonRando));
	Result : CmpCrypto.CmpCrypto_Implementation.CmpCrypto_Interfaces.SysTypes.RTS_IEC_RESULT;
END_VAR
~~~

~~~ST
//Requires CmpCrypto library
//Requires device vendor to have included Crypto component in Runtime
Result := CmpCrypto.CryptoGenerateRandomNumber(ui32NumOfRandomBytes:= 4, pRandom:= ADR(mbs));
RandomUDINT := bMarlonRando;
~~~</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">i-campbell</dc:creator><pubDate>Sun, 17 May 2020 08:41:37 -0000</pubDate><guid isPermaLink="false">https://forge.codesys.com/tol/iec-snippets/snippets/4/</guid></item></channel></rss>