memioRead (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

All

Firmware version:

1.00 / 1.00.00


memioRead gives direct access to 4096 memory I/O locations. The memory I/O is normally only accessed indirectly by assigning variables in the programs VAR_INPUT/VAR_OUTPUT section to different memory locations by using the Job configuration dialog.

 

 

Input:

index : INT (1..4096)

Index number on the memory IO system to read from.

 

Returns: DINT

Value that is read from the specified memory location.

 

Declaration:

FUNCTION memioRead : DINT;
VAR_INPUT
  index : INT; // index to read from (1..4096)
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
 
// Write the value 4711 to memory location 1
memioWrite(index:=1, value:=4711);
 
// And read the value back again...
debugFmt(message:="Location 1 is \4", v4:=memioRead(index:=1));
 
BEGIN
  ...
END;
 
END_PROGRAM;