4.4. Techniques

4.4.1. Making a simulation independent of Run Interval
4.4.2. On button and Off button - a simple latch
4.4.3. Samplers
4.4.4. Counters
4.4.4.1. Simple counter
4.4.4.2. Preset counter
4.4.4.3. Repetitive counter
4.4.5. Timers
4.4.5.1. Retentive timer
4.4.5.2. On-delay timer
4.4.5.3. Off-delay timer
4.4.5.4. On/off-delay timer
4.4.5.5. Periodic timer
4.4.6. Modelling propagation - a delay line
4.4.7. Random numbers
4.4.7.1. Random number generator
4.4.7.2. Random walk
4.4.8. Feedback Controllers
4.4.8.1. On/off controller
4.4.8.2. Proportional controller
4.4.8.3. PI controller
4.4.8.4. PID controller
4.4.9. Handling Control/Status Flags in Holding/Input registers

The following sections contain techniques to illustrate how to model familiar features such as timers or random number generators in ModSlaveSim. The labels for some techniques may not be immediately familiar to all users, but the concepts behind them should be self-explanatory, and the simulations contain examples of some of them.

In each section, a feature, such as a type of timer or latch, has a template for a program listing in a table. Note that not all registers in a listing are necessary - the value may be computed on the fly as part of another register's statement, rather than stored in an independent register.