Digital I/O ReadFile throw NotSupportedException

  • Hi,


    I tried to read digital input but I always got NotSupportedException
    during ReadFile call (CreateFile / WriteFile works, I can set/clear digital outputs).
    I set registry for input/output pins. (keyboard matrix works, dig. output works, pwm works)


    Is it really not supported? Or I missed something?


    Thanks,
    Zoltan


    kernel: NK10_CF2_090121.bin


  • Hello, i suggest "read" is supported.
    does following work?


    Are the "defines" correct?

    Code
    1. const UInt32 GENERIC_READ= 0x80000000;
    2. const UInt32 GENERIC_WRITE = 0x40000000;

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • Thanks, it works. So my ReadFile signature was the reason.
    BTW it will be helpful if the documentation contains ReadFile sample
    like WriteFile sample in digital i/o section.


    It is normal that I can read only 1 byte on each ReadFile call?
    I tried to read all pins (3 bytes) but the return value and the
    'Read[0]' variable is the same: 1.

  • Quote

    It is normal that I can read only 1 byte on each ReadFile call? ...


    Yes, use "SetFilePionter()" for jump to an other port.

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.