Example Instruction Files
|title||Click to see examples...|
Simple Function Example
The table above shows us function usage with parameters. Because the example is using default values, it is functionally equivalent to the following:
Running this program should yield the following results (assuming repeat is enabled):
- A tag Tag at root named “TagA” will be created.
- Since only a single Time Interval was defined, the program ends quickly. The delta time between the start of the program and the end should be around one Base Rate interval.
- The simulator will use a internal clock to ensure that the value reported is representative of the actual period for the function requested and if history is enabled, a full wave would be graphed.
Advanced Program Example
The program above should yield the following results:
- TagA is initialized with the Sine function.
- TagB (which is located under myFolder in the simulator’s structure) is initialized with a value of 0.
- TagC isn’t defined at the start, but that doesn’t matter; the program creates a TagC initially because it will exist in the device. If this is the first time the program ran, then TagC started with a value of 0. If it is the second time through, it maintains the value at the end of the program until it reaches an interval where something changes.
- Time Interval 1. The program doesn’t state that any changes should be made, so we’re done evaluating this Time Interval.
- Time Interval 2. Again, nothing to do here, so we wait another Base Rate duration.
- Time Interval 3, the value on TagB to 4.
- Time Interval 4. The value of TagC changes to 100. If this program has executed at least once before, then TagC could already have a value of 100, since this is the only entry in the program that changes the value on Tag C. However, it is possible that the user (or something else, such as a binding or script) wrote another value to this tagTag. At this point, our program is setting the value back to 100
- Time Interval 20, TagA switches to the Ramp function. This whole time it has been using the Sine function to generate some moving numbers, but now we’re telling it to use the Ramp function, which change the value (starting with the minimum value for the function) and uses a different method to determine its value.
- Time Interval 30. The value of TagB changes to 55.
- We’re now at the end of the program. If Repeat was enabled, we’ll move back to Time Interval 0 and start the whole process over again. If not, then the program ends for all tagsTags.
The Programmable Device Simulator comes with preloaded programs for Generic, Dairy and SLC simulators, as well as the ability to load from a CSV.
Generic Simulator Program
The Generic Simulator Program provides a variety of tags Tags that offer different data types and value generation styles. For example, there are ramps, sine waves, and random values. Additionally, there is a set of static writable tags Tags whose values will persist while the device is running.
Dairy Simulator Program
The Dairy Simulator Program has a ControlLogix like structure with Compressor, Tank, Motor tags Tags and more. The folders are split into an Overview and Refrigeration section with tags Tags multiple levels deep that mimic a UDT in a ControlLogix device.
The SLC Simulator Program creates a simple device whose address structure mimics a basic SLC structure. These tags Tags are readable and writeable.
Load From CSV
The Load from CSV option allows you to select a CSV file to load a predefined program from. The CSV file must have four columns in a specific order (Time Interval, Browse Path, Value Source, Data Type), with each row representing a different instruction in the program.