- No category
advertisement
Statements to Exchange CPU Data: EXNEXT
The EXNEXT statement process the next Controlled data exchange that is ready. EXNEXT can provide master-like protocol behavior. EXSTAT must always be called after EXNEXT, except when EXNEXT returns 0. If EXNEXT returns 0, no exchange is ready for execution, so
EXSTAT should not be called.
▪
▪
▪
▪
▪
▪
Data exchanges that will be handled by EXNEXT statements in the SPL script must be set up in the port configuration to have an Exchange Type of Controlled. Controlled Exchanges can be configured for the following types of Operation:
Read Continuous
Read Continuous Bit-Control
Read Single Bit-Control
Write Continuous
Write Continuous Bit-Control
Write Single Bit-Control
Bit-controlled exchanges must be triggered by the PLC CPU application program to be ready for reading or writing by the SPL script. The Read Continuous and Write Continuous exchanges are always ready for reading or writing by the SPL script.
When the EXNEXT statement is encountered in the SPL script, the module evaluates the configured Controlled Exchanges in numerical order. It executes the first Controlled Exchange that is ready. The next time an EXNEXT occurs in the SPL script, the module starts its evaluation with the next exchange after the one that was just performed. Because the exchanges are evaluated in order, starting with the least recently-evaluated exchange, each exchange is processed if it is ready. That means a read or write continuous exchange will not dominate the SPL script's processing time. In the example below, EXNEXT first executes
Exchange 1, which has an operation type of Write Continuous. The next time EXNEXT is encountered in the SPL script, it first evaluates exchange 2, but it is not ready (its CPU control bit is not set). EXNEXT skips exchanges 3 and 4 because their Exchange Type is Validated. It then executes exchange 5. The next occurrence of EXNEXT would execute exchange 6 if it is still ready.
EXNEXT Exchange 1: Commanded, Write Continuous
Exchange 2: Commanded, Read Single Bit-Control
Exchange 3: Validated, Read
Exchange 4: Validated, Read
Exchange 5: Commanded, Read Continuous
Exchange 6: Commanded, Write Continuous Bit-Control
Exchange 7: Validated, Read/Write
Exchange 8: Validated, Write
9
GFK-2460E Chapter 9 Serial Protocol Language (SPL) 9-21
9
The module sets the ERROR global variable if an error occurs during the execution of
EXNEXT. If ERROR=0 (no error) after EXNEXT is executed, various EXCHANGE collection values are populated.
Syntax:
EXNEXT
Example:
EXCHANGE.buffer = ArrayVar.0 !any data to be read or written will begin here.
EXNEXT
!if EXCHANGE.exnum is non-zero then an exchange was triggered.
!if ERROR = 0 then no error occurred.
As shown above, the global variable element EXCHANGE.buffer must be assigned to an array variable element before the SPL script calls EXNEXT.
▪
▪
If the triggered exchange is a write exchange, the array specified by EXCHANGE.buffer is filled with data from the CPU.
If the triggered exchange is a read exchange, the SPL script must fill values into the array elements specified by EXCHANGE.buffer before calling EXSTAT.
EXNEXT sets the EXCHANGE.exnum variable to the exchange number (1-64) that was executed. If no exchange is executed, EXCHANGE.exnum is set to zero instead.
Global Variables for EXNEXT
The EXCHANGE global variables marked with S below must be assigned correct values before executing an EXNEXT command, or the data will not be transferred. In the table, S = must be set before call, R = Returned when function completes
.exnum R Exchange number triggered or validated
.id
R Exchange Target ID
.type R Exchange Target Type
.rw R Command is read (0) or write (1)
.buffer S Name of declared data array
.addr
R Target
.length
R Length of data in bytes.
0-255
0-255
0-254
0 or 1
Valid variable name
0-1024
9-22 PACSystems* RX3iSerial Communications Modules – June 2010 GFK-2460E
advertisement
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Related manuals
advertisement
Table of contents
- 152 Serial Communications Module DNP V3.0 Master Device Profile
- 154 Serial Communications Module DNP V3.0 Master Implementation Table
- 159 Implementing DNP3 Master Functions
- 163 Reading Static Data from an Outstation
- 165 Reading IIN Data from an Outstation
- 166 Reading Change Event Data of Any Class from an Outstation
- 167 Reading Class 1, 2, 3 Data from an Outstation
- 178 Writing Binary or Analog Output Data to an Outstation: Direct Operate
- 179 Writing Output Data to an Outstation: Select then Operate
- 180 Writing Analog Input Deadband Data to an Outstation
- 181 Reading Time and Date from an Outstation
- 182 Writing Time and Date to an Outstation
- 183 Sending a Cold Restart Command to an Outstation
- 184 Clearing the Device Restart IIN Bit in an Outstation
- 185 Enabling or Disabling Unsolicited Responses in an Outstation
- 187 Serial Communications Module DNP V3.0 Slave Device Profile
- 189 Serial Communications Module DNP V3.0 Slave Implementation Table
- 194 Serial Communications Module DNP3 Slave Point Lists
- 198 Implementing DNP3 Slave Functions
- 210 Configuring a Port for SPL
- 210 Creating an SPL Script
- 211 Operation of the SPL Script
- 212 Exchanging Status and Control Data with the PLC CPU
- 215 Reserved Symbols
- 215 Syntax rules and requirements
- 216 SPL Statements
- 217 Global Variables
- 218 Variable Names
- 218 Variable Reference and Assignment
- 219 Integer Variables
- 220 Array Variables
- 221 Script Control Statements: GOTO
- 222 Script Control Statements: FOR – TO – NEXT
- 223 Script Control Statements: IF - THEN - <ELSE> – ENDIF
- 224 Script Control Statements: GOSUB – RETURN
- 225 Script Control Statements: STOP
- 226 Functional Errors
- 226 Fatal Errors
- 229 Statements to Exchange CPU Data: EXNEXT
- 231 Statements to Exchange CPU Data: EXSTAT
- 234 Statements to Exchange CPU Data: EXREAD
- 235 Statements to Exchange CPU Data: EXWRITE
- 237 SPL Statements for Exchanging Serial Port Data: GETB
- 238 SPL Statements for Exchanging Serial Port Data: PUTB
- 239 Global Variable for Serial Communications: SERIAL
- 240 Optional Global Variables for Serial Communications
- 241 Checksum Statements: BCC
- 241 Checksum Statements: CRC
- 242 Precedence of Operators
- 243 Logical Operators: AND
- 243 Logical Operators: OR
- 244 Logical Operators: XOR
- 244 Logical Operators: MOD
- 245 ASCII Conversion Statements: ASCTOVAL
- 246 ASCII Conversion Statements: VALTOASC
- 247 Time Statements: TIMER
- 247 Time Statements: ELAPSED
- 248 Debugging the SPL Script
- 250 Control SPL Script Execution from the Command Line Interface Port