Digital I/O cannot open DIO0:

  • I would like to use 8 digital inputs (port 0) and 8 digital outputs (port 1).


    I configured the registry that way:


    OK -> reg enum value \
    00 "DataInit"=hex:ff,00 \
    01 "DataDir"=hex:00,ff \
    02 "UseAsIO"=hex:ff,ff \
    03 "Prefix"=string:DIO \
    04 "Dll"=string:FS_DIGIO.dll \
    05 "Order"=dword:151 \
    06 "Index"=dword:1 \
    07 "Ioctl"=dword:4 \
    08 "Port"=dword:1 \
    09 "FriendlyName"=string:Digital I/O driver \


    But when I try to open the digital I/O handle I get an invalid handle:

    m_hDIO=CreateFile(_T("DIO0:"),GENERIC_READ|GENERIC_WRITE,0,NULL, OPEN_EXISTING,0,NULL);

    This statement always gets an INVALID_HANDLE_VALUE.


    I suggest the digital I/O driver is not running, because I found no process on the armStoneA8 which has loaded the FS_DIGIO.DLL.
    What must I do to get a valid handle for the digital I/O?

  • I think you need to open "DIO1:".
    The device name is generated from the prefix and index:
    <prefix><index>:

    Software developer, F&amp;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.

  • Quote from "peter.schoenenberger"

    I would like to use 8 digital inputs (port 0) and 8 digital outputs (port 1).


    I configured the registry that way:


    [...]
    06 "Index"=dword:1 \
    [...]


    The index shows that you need to open DIO1:. This is OK as you only have one DIO driver instance and they usually are numbered starting at 1. Don't confuse port numbers with device names. If you want to use ports 0 and 1, you have to open the DIO device DIO1: and use SetFilePointer(0) to switch to port 0 or SetFilePointer(1) to switch to port 1.

    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.

  • We have added a comprehensible explanation of the DIO configuration here. Maybe this will give some additional help to understand how everything works.

    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.