• Hello we are using PICOCOM4. We have problems with RTS/CTS COM1 Port.


    To test the hardware we have configured them as IO and with this it is correct we can read CTS pin and we can wittre RTS (and in the other end of RS232 it works fine). The problem is when we use c# program and we try to use RTS/CTS signals it doesnt work properly. We see that the serial driver in PICOCOM4 used is pc4_serial_MS.dll. This works correctly?


    We use WinCE with Kernel XIPNKPC4_CORE_CF35_131209


    Thanks a lot,

  • Hello,
    as i see from WWW, you cannot access DCB from .NET. I think you have to import "SetCommState" function by pinvoke in .NET importieren.
    Following may help:
    http://stackoverflow.com/quest…058/c-serialport-settings
    http://social.msdn.microsoft.c…14-4819-8B50-7CAA3FAF5F54


    Note:
    1. You have to set RS485=1 in the corresponding serial's driver regsitry key
    2. You have to pass DCB::dcb.fRtsControl = RTS_CONTROL_TOGGLE by "SetCommState.

    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.

  • Hello, sorry I suppose that I don't explain correctly. The problem that we have is hardwaree problem or serial driver in the kernel that works with hardware.


    We are testing COM1 in PICOCOM4, and the problem is in the RTS/CTS Signal. About your notes "You have to set RS485=1 in the corresponding serial's driver regsitry key", I read the "PicoCOM_DeviceDriver_WCE600_eng" but it explain that this is only for COM2, is this correct?


    We are trying to see that all pins work properly in our hardware. To test Serial port now we are using a program in c++ to test the RTS signal and it still doesn’t work correctly with the PICOCOM4. The RTS signal doesn’t change and the CTS always reads as set.


    We tried the same program in a NETDCU8 and everything worked ok.


    Pleae can you test if RTS/CTS is working in PICOCOM4 with Kernel XIPNKPC4_CORE_CF35_131209


    You can download the program in https://www.dropbox.com/s/xcbhc5j8fz3tumk/sertest.exe



    Thanks a lot


    Next you can see the source code.


    int _tmain(int argc, TCHAR *argv[])
    {
    printf("Select com port to open:\n");


    TCHAR chPort[_MAX_PATH];


    _getws(chPort);


    wcscpy( chPort, chPort );


    HANDLE g_hCOM = CreateFile( chPort, GENERIC_READ|GENERIC_WRITE,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL );
    if( g_hCOM == INVALID_HANDLE_VALUE )
    {


    ERRORMSG(1,(_T("CreateFile(%s) failed\r\n"),chPort));
    return(FALSE);
    }


    DCB dcb;


    dcb.DCBlength = sizeof( dcb );
    GetCommState( g_hCOM, &dcb );


    dcb.ByteSize = 8;
    dcb.Parity = NOPARITY;
    dcb.StopBits = ONESTOPBIT;
    dcb.BaudRate = CBR_19200;
    dcb.fOutxCtsFlow = 0;
    dcb.EvtChar = 0x0A;



    dcb.ByteSize = 7;
    dcb.fParity = 1;
    dcb.Parity = EVENPARITY;


    SetCommState( g_hCOM, &dcb );



    // Specify a set of events to be monitored for the port.
    SetCommMask (g_hCOM, EV_RXCHAR | EV_CTS | EV_DSR | EV_RLSD | EV_RING);



    DWORD status;
    bool sCTS,sDSR;


    if (g_hCOM == INVALID_HANDLE_VALUE)
    {
    printf("Cannot open %s\n", argv[1]);
    return -1;
    }


    printf("Press the following keys:\n");
    printf("1: Set RTS\n");
    printf("2: Clear RTS\n");
    printf("3: Read CTS\n");
    printf("q: End Program\n");


    do
    {
    ch = getchar();
    switch (ch)
    {
    case '1': if (EscapeCommFunction(g_hCOM,SETRTS) == 0)
    printf ("Error Setting RTS\n");
    break;
    case '2': if (EscapeCommFunction(g_hCOM,CLRRTS) == 0)
    printf ("Error Clearing RTS\n");
    break;
    case '3': if (GetCommModemStatus(g_hCOM,&status))
    {
    sCTS = MS_CTS_ON & status;
    printf("CTS: %d\n",sCTS);
    }
    }
    } while (ch != 'q');


    CloseHandle( g_hCOM );


    return 0;
    }

  • Hello,
    right DD docu says "Enable RS485 mode. This is only applicable for COM2.". So COM1 is not useable as RS485!
    Do you really need COM1? I can check if it is possibel.

    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.

  • Hello,
    ok sorry you already outlined this obove. RTS/CTS is also not supported at the time, we have to rework the driver for this.

    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.

  • Dear, did you Know when f&s can have the WINCE kernel with serial driver for PICOCOM4 with the RTS/CTS on COM1?


    Now we are waiting to receive PICOCOMA5-V1-CE to test it in our hadrware. Will be available the RTS/CTS for COM 1 in Windows CE Kernel?


    Thanks a lot,

  • Hello,

    Quote

    did you Know when f&s can have the WINCE kernel with serial driver for PICOCOM4 with the RTS/CTS on COM1?

    We have no fix date for this. We insert this issue in our roadmap (refer ID 0002156), but at the time we are very busy.


    Quote

    Now we are waiting to receive PICOCOMA5-V1-CE to test it in our hadrware. Will be available the RTS/CTS for COM 1 in Windows CE Kernel?

    Yes, following is possible and i test it with RS485:
    1. Two port: RS232 with RTS/CTS or RS485 (COM1:, COM2:)
    2. Three ports: 1xRS232 with RTS/CTS or RS485 (COM1:) und 2xRS232 without RTS/CTS/RS485 (COM2:, COM3:)

    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.

  • Hello I read the roadmap,


    - 0002156: [Serial Driver/Interface] COM2 does not work with RTS/CTS - new


    This is not correct. I don't Know if com2 rts/cts works, but i'm sure that RTS/CTS for com1 doesn't work.


    Thanks a lot,

  • We assume the problem is resolves using kernel V1.16 which contains serial driver V1.3.
    I checked it with your test programm refered above, everything works fine. Thanks.


    For COM1/2 - you have to set UseRTSCTS to 1 (>1). Else the Driver will not use the lines and they are free for other puposes.


    PS: We will update the PC4 download area today.

    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.

    Edited 2 times, last by fs-support_ZU ().