Simulation Protocol
The following information applies to the Simulation Protocol.
Details on the device address can be found in the Device Properties Information Topic
External Address Format
External Address is an ascii string which exactly references an item of data within the PLC. It can be entered at configure time as a text string, and will be validated by the system before use. For this protocol the External Address has the following format:
N - Dec number 0 - 9
Type |
Offset |
RU |
NN |
RD |
NN |
SW |
NN |
SQ |
NN |
RN |
NN |
CX |
NN |
CP |
NN |
CN |
NN |
CB |
NN |
CW |
NN |
CD |
NN |
Offset Format
The software also allows an item of data within the PLC to be referenced by means of a table selection and an offset. The following table shows the offset and table formats for the simulation:
Table |
External Address Type |
Type |
Offset Format |
Offset Range |
Privilege
|
Description |
RU |
RU |
Word |
NN |
00-49 |
RW |
Ramp Up |
RD |
RD |
Word |
NN |
00-49 |
RW |
Ramp Down |
SW |
SW |
Word |
NN |
00-49 |
RW |
Sine Wave |
SQ |
SQ |
Word |
NN |
00-49 |
RW |
Square Wave |
RN |
RN |
Word |
NN |
00-49 |
RW |
Random |
CX |
CX |
Bit |
NN |
00-49 |
RW |
Bit Counter |
CP |
CP |
Packed Bit |
NN |
00-49 |
RW |
Packed Bit Counter |
CN |
CN |
Nibble |
NN |
00-49 |
RW |
Nibble Counter |
CB |
CB |
Byte |
NN |
00-49 |
RW |
Byte Counter |
CW |
CW |
Word |
NN |
00-49 |
RW |
Word Counter |
CD |
CD |
dWord |
NN |
00-49 |
RW |
dWord Counter |
Property Pages
No property pages exist for this protocol
Protocol Compatibility
The bit type tables ‘CX’ and ‘CP’ will support the configuration of point types bigger than a bit. If a publication point is configured for example, 16 bits will be read from the table to fill the point. From the users perspective these two tables are exactly the same, the difference between ‘bit’ and ‘packed bit’ data types is in the way the protocol returns information to the application level.
The nibble, byte, word and dword type tables all support the configuration of smaller or bigger point types. All larger point types will read the required number of data units to fill the point. Smaller type points will scale down the data to fit it into the point. Bit type points allow the selection of a bit offset to reference the required bit from the data unit. In the case of bit selection points, drive outs will perform a read/modify/write operation as the protocol does not support a bit set operation in this case.
Each of the tables have 50 simulated values, which will vary in different ways depending on the simulation type. Driving out to these values will cause the simulation to shift and continue from the new value. For example a counter simulation counting 1, 2, 3, 4…etc, driving out a value of 100 will cause the simulation to continue 101, 102, 103…etc.
A simulated value is changed every time a read operation is performed. If more than one point is configured that makes use of the same simulated address, then the expected simulated results may not be received.
The following shows mathematically how the simulated results are achieved for each table:
N = Offset
X = New Value
T = Tick number
A = Angle in radians
Simulation |
Formula |
Ramp Up |
X = T * (N + 1) where T = 0 10 |
Ramp Down |
X = T * (N + 1) where T = 10 0 |
Sine Wave |
X = sin(A) * (N + 1) where A = 0 2p increasing in steps of 0.1 radians |
Square Wave |
X = 0 then X = 10 * (N + 1) |
Random |
X = RAND(65535) where RAND is a random function, values 0-65535 |
Bit Counter |
X = X + 1, 0<= X <= 1 |
Packed Bit Counter |
X = X + 1, 0<= X <= 1 |
Nibble Counter |
X = X + 1, 0<= X <= 12 |
Byte Counter |
X = X + 1, 0<= X <= 255 |
Word Counter |
X = X + 1, 0<= X <= 65535 |
dword Counter |
X = X + 1, 0<= X <= 4294967295 |
All simulations repeat continually after completion.
Port Settings
No physical connection is required, the protocol is a simulation.
Wiring Information
No physical connection is required, the protocol is a simulation.
Examples
|
Example 1 |
|
|
|
|
Random simulation, first value |
RN00 |
|
Example 2 |
|
|
|
|
Ramp up from 0 to 200 in steps of 10 |
RU19 |
|
Example 3 |
|
|
|
|
Square wave from 0 to 50 |
SQ04 |