CVB.Net 14.0
IRegPort Interface Reference

Enables direct memory access on the device. More...

Inherits IDeviceInterface.

Inherited by RegPort.

Public Member Functions

int Read (long address)
 Reads a four-byte integer from the device. More...
 
void Read (long address, IntPtr bufferPointer, long bufferLength)
 Reads bufferLength bytes from the address into the memory at bufferPointer . More...
 
void Read (long address, byte[] buffer)
 Reads memory into the given buffer . More...
 
void Write (long address, int value)
 Writes the value to address . More...
 
void Write (long address, IntPtr bufferPointer, long bufferLength)
 Writes the contents of the buffer at bufferPointer to the given address . More...
 
void Write (long address, byte[] buffer)
 Write the contents of buffer to the given address . More...
 

Additional Inherited Members

- Properties inherited from IDeviceInterface
Device Parent [get]
 The Device this interface works on.
 

Detailed Description

Enables direct memory access on the device.

Member Function Documentation

◆ Read() [1/3]

int Read ( long  address)

Reads a four-byte integer from the device.

Here you do not need to take device endianness into account.

Parameters
addressAddress to read four bytes from.
Returns
Read four-byte integer.

◆ Read() [2/3]

void Read ( long  address,
byte[]  buffer 
)

Reads memory into the given buffer .

Some transport layers have constraints in how many bytes can be read (i.e. max size and granularity). Also here device endianness needs to be taken into account if non-byte data is retrieved.

Parameters
addressAddress to read from.
bufferArray to save data into.

◆ Read() [3/3]

void Read ( long  address,
IntPtr  bufferPointer,
long  bufferLength 
)

Reads bufferLength bytes from the address into the memory at bufferPointer .

Some transport layers have constraints in how many bytes can be read (i.e. max size and granularity). Also here device endianness needs to be taken into account if non-byte data is retrieved.

Parameters
addressAddress to read from.
bufferPointerPointer to write read data to.
bufferLengthSize of the memory chunk at bufferPointer .

◆ Write() [1/3]

void Write ( long  address,
byte[]  buffer 
)

Write the contents of buffer to the given address .

Some transport layers have constraints in how many bytes can be written (i.e. max size and granularity). Also here device endianness needs to be taken into account if non-byte data is retrieved.

Parameters
addressAddress to write to.
bufferValues to write to device.

◆ Write() [2/3]

void Write ( long  address,
int  value 
)

Writes the value to address .

Parameters
addressAddress to write to.
valueValue to write to device.

◆ Write() [3/3]

void Write ( long  address,
IntPtr  bufferPointer,
long  bufferLength 
)

Writes the contents of the buffer at bufferPointer to the given address .

Some transport layers have constraints in how many bytes can be written (i.e. max size and granularity). Also here device endianness needs to be taken into account if non-byte data is retrieved.

Parameters
addressAddress to write to.
bufferPointerMemory buffer to write to device.
bufferLengthNumber of bytes to write from bufferPointer .