memioWriteX (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

All

Firmware version:

1.20 / 1.00.00


memioWriteX works similar to memioWrite but allows access to multiple elements in one highly efficient operation.

The use of memioWriteX is recommended in cases where a range of memory I/O locations must be written sequentially.

 

Also see memioReadX.

 

Input:

index : INT (1..4096)

Memory I/O system Index number where the write operation will start.

 

mem : PTR

Address to read the data that will be written into the memory I/O area.

 

len : INT

Number of 32-bit elements to be written into the memory I/O area.

 

 

Returns: INT

0

Operation successful.

1

Invalid parameters.

2

Index range was out of bounds.

 

 

Declaration:

FUNCTION memioWriteX : INT;
VAR_INPUT
  index : INT; // index to write to (1..4096).
  mem   : PTR; // address to read from.
  len   : DINT; // number of elements to write.
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
VAR
  buffer : ARRAY[1..10] OF DINT;
END_VAR;
 
...
 
// Write the content of the 'buffer' directly into I/O space starting at location 120:
memioWriteX(index:=120, mem:=ADDR(buffer), len:=10);
 
...
 
END_PROGRAM;