Chapter 7. Programming SRTP Channel CommandsGFK-2224Q January 2017 127If a channel error is indicated (by the Channel Error bit) after the channel is established, the first word of theDCS words contains an error code indicating the cause of the error. The second word of the DCS wordsindicates whether the channel is active or idle.The Detailed Channel Status words are updated in the Ethernet Interface every time the status of the channelchanges. If the channel is operating with a fast repetition period, the status words may change faster than theladder executes the COMMREQ to retrieve them. Therefore, some status values may be missed by the programlogic.The DCS words location is specified in the Retrieve Detailed Channel Status Command. The contents of thesestatus words are defined below.The initial value of the Detailed Channel Status words is all zeroes. DCS words are reset to zero when:▪ The Ethernet Interface is powered up or restarted▪ The CPU transitions from STOP to RUN▪ A channel abort COMMREQ aborts the channelFormat of the Detailed Channel Status Words (DCS Words)Display the DCS status words in hexadecimal form to differentiate the high and low bytes.High Low00 00Minor Error Codes (high byte)Success and Major Error Codes (low byte)0000Channel Active (0001 = channel active,0000 = channel not active)DCS Word in Hex FormatWord 1Word 2Figure 50: Interpreting Detailed Channel Status Words7.3 Programming for Channel CommandsThe COMMREQ function for a Channel command must be initiated by a one-shot. That will prevent theCOMMREQ from being executed each CPU scan, which would overrun the capability of the Ethernet Interfaceand possibly require a manual restart. Checking certain status bits before initiating a COMMREQ function isalso important. In particular, the LAN Interface OK bit should be used as an interlock to prevent execution ofthe COMMREQ when the Ethernet Interface is not operational. After initiating a COMMREQ on a channel, nofurther COMMREQs should be issued to that channel until a non-zero COMMREQ status word has been returnedto the program from the Ethernet Interface.Every ladder program should do the following before initiating a COMMREQ function.1. Initiate the COMMREQ function with a one-shot. This prevents sending the same COMMREQ CommandBlock more than once.2. Include at least the LAN Interface OK bit in the LAN Interface Status Word as an interlock contact forthe COMMREQ function.3. Zero the word location you specify for the COMMREQ status word and FT Outputs of the COMMREQfunction block before the COMMREQ function is initiated.4. Move the command code and parameters for the Channel command into the memory locationspecified in the IN input of the COMMREQ Function Block before the COMMREQ function is initiated.An example ladder program segment on the next page illustrates these points.