Cobranet™ ev-2 – Cirrus Logic EV2 User Manual
Page 39

CobraNet™ EV-2
39
Rev. 2.1
Poke
This command will set the value of the given location in CobraNet memory space to
Example: poke 0x40104 0x1011
[offset] – optionally used with HMI array variables only. Offset into the HMI array. If not present
on an HMI array variable the poke will poke the
Example: poke txBundle 0x111 0x2000
Please note the difference between the “peek
“peek
“peek “
between the CM-1 and CM-2 where the variables are not stored in memory in the same format. An exam-
ple is the rxPriority HMI variable.
On the CM-1:
peek 0x40104
- command
0x101000
- what is returned
peek rxPriority
- command
0x1010
- what is returned
On the CM-2:
peek 0x40104
- command
0x1010
- what is returned
peek rxPriority
- command
0x1010
- what is returned
This difference here is that the “peek 0x40104” command returns the raw value as it is stored in memory,
the “peek rxPriority” command returns the value as it should be represented. In this example the CM-1
returned a different value than the CM-2 for the “peek 0x40104” command but the same value for the
“peek rxPriority” command; this is because the storage format of the variable in memory is different
between the CM-1 and CM-2. The main memory architecture difference between the CM-1 and CM-2 is
that the CM-1 has a 24-bit wide memory bus whereas the CM-2 has a 32-bit wide memory bus. In the
above example the rxPriority HMI variable is an Integer16 data type. On the CM-1 this type of data uses
the middle and upper byte of the 24-bit memory location to store the data whereas the CM-2 stores the data
in the lower two bytes of the 32-bit wide memory location.
In summary, using the HMI variable name will return data in the proper format. Using the address will
return the raw data at the address location.
This also applies to the Poke command. When using the “poke
must pay attention to how the data (i.e. the
using the “poke
dent of how the data is stored. This allows for writing a command line interface script that works on either
the CM-1 or the CM-2.