Accessing System Memory through C#

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ronald de Feijter

    Accessing System Memory through C#

    In a mechatronic system I can control some motors and
    servos by setting values between 0 and 255 at specific
    memory addresses. My problem is how to access these memory
    addresses within C#. I know I can access memory locations
    by using pointers in unsafe code. But I only know how to
    assign a pointer to the address of a declared variable (by
    using the & operator), not to a specific address.

    Does anybody have a suggestion?
  • bob holder

    #2
    Re: Accessing System Memory through C#


    "Ronald de Feijter" <anonymous@disc ussions.microso ft.com> wrote in message
    news:0a1901c3d9 23$74e58ef0$a50 1280a@phx.gbl.. .[color=blue]
    > In a mechatronic system I can control some motors and
    > servos by setting values between 0 and 255 at specific
    > memory addresses. My problem is how to access these memory
    > addresses within C#. I know I can access memory locations
    > by using pointers in unsafe code. But I only know how to
    > assign a pointer to the address of a declared variable (by
    > using the & operator), not to a specific address.
    >
    > Does anybody have a suggestion?[/color]

    You will need a device driver to perform the actual io to the motor/servo
    device. Your c# app will then communicate through the driver's defined api.
    Addresses in usermode (where c# apps live) cannot access physical memory
    directly.

    bob


    Comment

    Working...