9 egd example 2, 1 egd example 2 – adding a status block, Egd example 2 – Horner APG XL4 OCS HE-ETN300 User Manual
Page 52: Egd example 2 – adding a status block
CH.6
SUP0740-07
11/30/2009
Page 52 of 98
# 958
6.9
EGD Example 2
Building upon EGD Example 1, EGD Example 2 will demonstrate how to add Status, Timestamp,
and Filler Blocks to Exchanges in Node 1.
6.9.1
EGD Example 2 – Adding a Status Block
To get a Produced or Consumed Exchange’s Status Word (Section 6.7 [page 40]) into an OCS
register, define a Status Block for the Exchange. To do this for Node 1’s Produced Exchange 1,
for example, perform the following two steps:
1. On the main Cscape screen, select Open from the File menu and open the saved Node 1
user program (EGD Node 1.csp). Then open the Ethernet Module Configuration dialog
(Figure 6.7 [page Figure 6.7– Ethernet Module Configuration - Node 1) and click on the
Config button next to the EGD (Ethernet Global Data) checkbox to open the EGD
Configuration dialog (Figure 6.10 [page 44]).
2. Make sure Exchange 1 is highlighted in the upper window (it should be the only Produced
Exchange in this example) and click on the Add Range button, to define a Status Block for
Produced Exchange 1. Then fill in the parameters, as shown in Figure 6.21 below, and click
OK.
Figure 6.21 – Produced Exchange 1 Status Block Definition – Node 1
In this example, when the status of Node 1’s Produced Exchange changes, its new Status
Word (Section 6.7 [page 40]), will be written into the Node 1 register %R120. Notice that the
Number of Bytes parameter is not configurable and will always be 2 for a Status Block.
At this point, the Produced Exchanges tab in the EGD Configuration dialog should be as
shown in Figure 6.22.