Simulation vs Production Code

By necessity there are a few differences between working with simulation in Pictorus and working with a physical device (Production).

Simulation Components

Pictorus makes a clear distinction between Simulation code and Production code, so users can easily understand which sections of their diagram will be compiled and run on production hardware and which sections are purely for simulating inputs to the production algorithm.

At the top level of an application, any Component can be marked as a Simulation Component from its settings panel. By doing so, we've indicated to the code generator to trim this Component from code generation when the user selects a true hardware target. However, in Simulation mode (the platform default), the Component does get included, and users can experiment with synthetic inputs:

You'll notice that attempting to connect any other Block or Component to an Input Block is forbidden:

It's important to note that Simulation Components can only be added to the top level of an application. This is intended to encourage good interface design, and to discourage simulations from being nested deep within production code.

Simulation Computation Limits

The Pictorus beta imposes some limits on the computation that can be done in simulation mode. The total number of iterations (i.e TimeStep*Sim Time) that the simulation will compute is 1e8 or 100 million. Additionally the maximum Sim Time is 1e5 or 100,000. These limits are in place to prevent the simulation from running indefinitely, and to ensure that the user can't accidentally create a simulation that will take an unreasonable amount of time to run. If these limits are blocking your work feel free to reach out to us.