Main Content

Configuring the rand function for PLC Code generation

Simulink® PLC Coder™ generates Structured Text code for MATLAB® Function blocks and Stateflow® charts that use rand functions from the library. The rand function is implemented using a pseudo random number generator that only works with PLC IDEs supporting the uint32 data type. The software has conformance checks to report diagnostics for incompatible targets. Currently, the following targets have been tested for rand function support.

  • CODESYS Version 2.3 or 3.5 (SP4 or later)

  • B&R Automation Studio® 3.0 or 4.0

  • Beckhoff® TwinCAT® 2.11 or 3

  • OMRON® Sysmac® Studio Version 1.04, 1.05, 1.09 or 1.12

  • Bosch Rexroth IndraWorks version 13V12 IDE

  • Generic

  • PLCopen XML