Setting a counter to hexadecimal data
To set the value of a counter to hexadecimal data in a save or user area, you can code CNTR=(X,loc,leng) on the SET statement. With this operand, WSim places 1 - 4 bytes of data into the counter without translating the data.
You can code the following values on this operand:
- X
- Specifies that the data in the save or user area is hexadecimal data.
- loc
- Specifies the location of the data, including the save or user
area and the offset, if any. If the specified location does not exist, WSim logs
message ITP468I and does not set the counter's value. You code one of the following values for loc:
- B±value
- Specifies that the data is at an offset from the start of the data in the device buffer, excluding headers, (+value) or back from the end of the data in the buffer (-value) for nondisplay devices. For display devices, B-value specifies that the data is located at an offset back from the end of the data in the screen image buffer. value is an integer 0 - 32766 or the name of a valid counter.
- C±value
- Specifies that the data is at an offset from the current cursor position (+value) or back from the current cursor position (-value). Code this value only for display devices. value is an integer 0 - 32766 or the name of a valid counter.
- N±value
- Specifies that the data is at an offset from the start (+value) or the back from the end (-value) of the network user area. value is an integer 0 - 32766 or the name of a valid counter.
- Ns+value
- Specifies that the data is located at offset value from the start of network save area s. s is an integer 1 - 4095. value is an integer from 0 to 32766 or the name of a valid counter.
- (row,col)
- Specifies the row and column location of the data. row and col may be integers 1 - 255 or the names of valid counters.
- s+value
- Specifies that the data is at offset value from the start of save area s. s is an integer 1 - 4095. value is an integer from 0 to 32766 or the name of a valid counter.
- U±value
- Specifies that the data is at an offset from the start (+value) or back from the end (-value) of the device user area. value is an integer 0 - 32766 or the name of a valid counter.
Note: If you specify a counter as the offset value, WSim evaluates that counter when it processes the SET statement and uses the counter's value as the offset. If the value is greater than 31999 for save and user areas or greater than 32766 for all other locations, WSim logs message ITP468 indicating that the value is invalid as an offset and that the counter's value was not set. - leng
- Specifies the length of the data. leng is 1 - 4, indicating that the data is 1 - 4 bytes in length. If you specify 2 or more and fewer bytes of data exists at the specified location, WSim sets the value to only the existing bytes of data.
DATASAVE AREA=N+0,TEXT=('08C4C5E5C9C3C5F0F1')
You
can set a counter's value equal to the first byte by coding the SET
statement as shown in the following example: SET5 SET DC1=(X,N+0,1) WSim sets the value of device counter 1 to the
* hexadecimal data located in the network user
* area at a 0 offset and 1 byte in length.