memioWrite (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

All

Firmware version:

1.00 / 1.00.00


memioWrite 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 write the value in.

 

value : DINT

Value that is to be written to the specified memory location.

 

Returns:

None.

 

Declaration:

FUNCTION memioWrite;
VAR_INPUT
  index : INT; // index to write to (1..4096)
  value : DINT;// Value to write
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;