WSAENOTSOCK 10038 error on polling with Modnet driver

Hi,

we have a problem with connecting Citect with generic modbus device (standalone discrete I / O Module)

through Modnet driver. After Runtime restart we have a error WSAENOTSOCK 10038 error (syslog.IOServer.Cluster_1.IOServer_2 log file).

 After a few minutes connection is restored and system is working fine until next restart.

Connection parameters in .ini file:  MaxPending=2, Block=250, Retry=0, Delay=0, Timeout=1000, PollTime=0, WatchTime=30000.

Modbus Pool with this device works without problem. 

We are using  Version 7.50 Service Pack Patch 13[5].

Log in included file 

citect_logs.txt

Thanks.

  • Hi Marat,
    Can you confirm what OS you are using (if Windows 10, also the version), as well as TCPIP board driver version and Modnet driver version?
    Also upload your citect.ini file for review.
    Thanks
  • In your log, I see the error is from the TCPIP board driver. So, that may be the place to start. The full driver error message is just the Microsoft description for the Winsock error code 10038:

    2019-08-01 14:21:03.125 +05:00 [TRACE] [CORE       ] [0x2d54] [IOServer        ] [(GLOBAL)        ] [DrvDebug()                                        ] [dsp_fmt.cpp                   ] [533 ] Tcpip Driver Error: 10038 (0x2736) Length 214 Socket operation on non-socket. An operation was attempted on something that is not a socket. Either the socket handle parameter did not reference a valid socke t, or for select, a member of an fd_set was not valid.

    That can happen if the software (Citect TCPIP board driver or MODNET driver) closes the Winsock connection, then tries to use that invalid connection. That may be a bug in the Citect driver. I don't know which version of the TCPIP driver is installed, but you may want to install the latest TCPIP driver. It has some recent fixes, but doesn't specify what they all are. I see from the log file you have MODNET v2.09.07.00001. There is an updated MODNET driver available. I don't see a fix for that specific error, but it may be worth trying that also.

  • Hi Olivier,

    OS is Windows 7 Professional Service Pack 1, MODNET v2.09.07.00001. I don't know how to determine a TCPIP board driver version. It's some sort of OS level driver?

    Citect.ini file

    [AddressForwarding]
    LicenseStore = 27010@127.0.0.1
    
    [Alarm]
    IsolationDetectIP1 = 
    IsolationDetectIP2 = 
    SavePeriod = 600
    SavePrimary = C:\ProgramData\Schneider Electric\Vijeo Citect 7.50\User\SuperManchar_Manchar2
    SaveSecondary = 
    ScanTime = 500
    #Set to '[RUN]:wav\alarm.wav' by Disp on 25.07.2018 15:17:10.
    Sound1 = [RUN]:wav\alarm.wav
    #Set to '2000' by Disp on 25.07.2018 15:18:20.
    Sound1Interval = 2000
    #Set to '[RUN]:wav\alarm1.wav' by Disp on 25.07.2018 15:17:25.
    Sound2 = [RUN]:wav\alarm1.wav
    #Set to '2000' by Disp on 25.07.2018 15:18:29.
    Sound2Interval = 2000
    #Set to '[RUN]:wav\BEEPER.wav' by Disp on 25.07.2018 15:17:44.
    Sound3 = [RUN]:wav\BEEPER.wav
    #Set to '2000' by Disp on 25.07.2018 15:18:38.
    Sound3Interval = 2000
    SummaryLength = 1000
    SummaryTimeout = 60
    
    [Alarm.Cluster1.AlarmServer1]
    Clusters = Cluster1
    CPU = 
    Events = 
    StartupCode = AlarmServerStartup()
    
    [Alarm.Cluster_1.Alarm_1_P]
    Clusters = Cluster_1
    CPU = 
    Events = 
    StartupCode = 
    
    [Animator]
    FastDisplay = 1
    FullScreen = 2
    
    [Backup]
    BackupPath = F:\SuperManchar_2019_07_29.ctz
    Compress = 1
    DeleteAll = 1
    Encrypt = 0
    Operation = 0
    Recurse = 1
    RestoreInclude = 0
    SaveCompiled = 1
    SaveInclude = 0
    SaveiniFiles = 1
    
    [Client]
    Clusters = Cluster_1
    ComputerRole = 0
    CPU = 0,1,2,3
    Events = Save2hGas,Save2hOil,SaveDayGas,SaveDayOil
    #Set to '1000000' by Disp on 05.04.2018 18:14:38.
    EvictTimeout = 2000000
    FullLicense = 0
    PartOfTrustedNetwork = 1
    StartupCode = StartUp
    TagReadCachedMode = 3
    WaitForConnectAtStartup = 0
    
    [CtCicode]
    BreakAllThreads = 0
    BreakOnError = 0
    Child Window State = 3
    ForeBreakWarning = 1
    Main Window = 2,3,-1,-1,-1,-1,694,332,1654,945
    SaveBreakpoints = 1
    
    [CTDRAW.genie.default]
    file.both = tab_alarms
    file.normal = 
    file.reference = 
    file.super = 
    page.both = row_02
    page.normal = 
    page.reference = 
    page.super = 
    
    [CTDRAW.library.default]
    file = buttons
    linked = 1
    page = xppressed
    project = 
    
    [CTDRAW.pages]
    page0 = SuperManchar,Main
    page1 = SuperManchar,Diag
    page2 = JenniesAndSymbols,FireSettings
    page3 = SuperManchar_Manchar13,Diag
    
    [CtDraw.RSC]
    BackColor = 0x006095ca
    GridCX = 8
    GridCY = 8
    GridX = 0
    GridY = 0
    GuideHorz = 
    GuideVert = 
    ImportFile = C:\Users\Disp\Desktop\����������\3.png
    ListSystemPages = 1
    OldTools = 1
    SwapFromColorA = 0x00ffffff
    SwapFromColorB = 0x00ffffff
    SwapToColorA = 0xffffffff
    SwapToColorB = 0xffffffff
    
    [CTDRAW.status]
    status = 1
    sTools = 1
    
    [CTDRAW.template.default]
    linked = 1
    page = Normal@-XGA
    resolution = 3
    style = Tab_Style_1
    titlebar = 0
    
    [CTDRAW.toolboxes]
    otools = 1719,151,1
    toolbar = 0,0,0
    tools = 1812,301,1
    
    [CTDRAW.Versions]
    ctDraw = 1
    
    [CTDRAW.windowplacement]
    main = 0,9,-32000,-32000,-1,-1,-8,-8,1924,1048
    zoom = 175,156,384,216,0
    
    [CtEdit]
    ANSIToOEM = 0
    Backup = 
    Bin = C:\Program Files (x86)\Schneider Electric\Vijeo Citect 7.50\Bin
    CICODEEDITOR = ctcicode.exe
    COMPILEENQUIRY = 0
    CompileErrorForm = 1
    Config = C:\ProgramData\Schneider Electric\Vijeo Citect 7.50\Config
    CONFIRMPACKING = 0
    Copy = 
    Data = C:\ProgramData\Schneider Electric\Vijeo Citect 7.50\Data
    DbFiles = 80
    DefaultProtocolID = 1396
    DISABLEUSERFUNCTIONS = 0
    EXTENDED = 1
    IncrementalCompile = 1
    INFORMRECORDCHANGE = 1
    LASTDATABASE = SuperManchar
    LASTDATABASEPATH = C:\ProgramData\Schneider Electric\Vijeo Citect 7.50\User\SuperManchar
    Logs = C:\ProgramData\Schneider Electric\Vijeo Citect 7.50\Logs
    MaxHelpRec = 5000
    PAGESIZE = 59
    PrintFont = Courier New
    PrintPoint = 6
    REPORTEDITOR = write.exe
    Run = C:\ProgramData\Schneider Electric\Vijeo Citect 7.50\User\SuperManchar
    SEARCHDELAY = 3
    SHOWDEL = 0
    SHOWPAGEMENU = 0
    Starter = C:\ProgramData\Schneider Electric\Vijeo Citect 7.50\Starter
    Upgrade = 0
    User = C:\ProgramData\Schneider Electric\Vijeo Citect 7.50\User
    WINDOW = 0,9,-32000,-32000,-1,-1,574,142,1536,963
    
    [CtExplore]
    DefaultTemplateBackgoundColorRGB = 229,229,229
    DefaultTemplateResolution = HD768
    DefaultTemplateStyle = SxW_Style_1
    DefaultTemplateTitleBar = 1
    DISPLAYICON = 26093
    InitSelection = Pages
    SHOWSYSTEMPROJECTS = 1
    SPLITTER = 372,0
    WINDOW = 9,960,0,1920,1040
    
    [CtSetup]
    CustomSetup = 1
    
    [Debug]
    ForeGroundOnError = 1
    Menu = 1
    RemoteDebug = 0
    Shutdown = 1
    StartDebuggerOnError = 0
    
    [DIALOG]
    COMPILE =743,458,1177,753
    
    [DRAW]
    Mode = 7
    
    [Event]
    Server = 1
    
    [Format]
    #Set to '{Date,80}{Time,80}{Tag,120}{Name,120}{Desc, 120}' by Disp on 03.05.2018 10:41:20.
    Alarm = {Date,80}{Time,80}{Tag,120}{Name,120}{Desc, 120}
    #Set to '{Date,80}{Time,80}{Tag,120}{Name,120}{Desc, 120}' by Disp on 03.05.2018 11:38:24.
    Summary = {Date,80}{Time,80}{Tag,120}{Name,120}{Desc, 120}
    
    [General]
    Multiprocess = 1
    
    [Internet]
    Server = 0
    
    [IOServer.Cluster1.IOServer]
    Clusters = Cluster1
    CPU = 
    Events = 
    StartupCode = Startup
    
    [IOServer.Cluster1.IOServer1]
    Clusters = Cluster1
    CPU = 
    Events = 
    StartupCode = 
    
    [IOServer.Cluster_1.IOServer_1]
    Clusters = Cluster_1
    CPU = 
    Events = 
    StartupCode = 
    
    [IOServer.Cluster_1.IOServer_2]
    Clusters = Cluster_1
    CPU = 
    Events = 
    StartupCode = 
    
    [Kernel]
    WINDOWPOSITION =1,114,103,1554,863
    Windows =0
    
    [Kernel.WindowPositions]
    Beeline_Realise = 0,0,0,146,28
    Driver = 0,9,7,77,19
    Example = 0,0,0,146,28
    General = 0,0,0,73,22
    JenniesAndSymbols = 0,0,0,146,28
    Library_Controls = 0,0,0,146,28
    Main =6,0,0,146,28
    Memory = 0,0,0,80,20
    NetBIOS Window - ESC to terminate = 0,0,0,75,15
    perenos = 0,0,0,146,28
    SuperManchar =0,0,0,146,28
    SuperManchar_Manchar = 0,0,0,146,28
    SuperManchar_Manchar1 = 0,0,0,146,28
    SuperManchar_Manchar10 = 0,0,0,146,28
    SuperManchar_Manchar11 = 0,0,0,146,28
    SuperManchar_Manchar12 = 0,0,0,146,28
    SuperManchar_Manchar2 = 0,0,0,146,28
    SuperManchar_Manchar3 = 0,0,0,146,28
    SuperManchar_Manchar4 = 0,0,0,146,28
    SuperManchar_Manchar5 = 0,0,0,146,28
    SuperManchar_Manchar6 = 0,0,0,146,28
    SuperManchar_Manchar7 = 0,0,0,146,28
    SuperManchar_Manchar8 = 0,0,0,146,28
    SuperManchar_Manchar9 = 0,0,0,146,28
    SxW_Style_Include = 0,0,0,146,28
    Table = 0,0,0,80,20
    test_modbus_link = 0,0,0,146,28
    testUserCreate = 0,0,0,146,28
    text = 0,0,0,146,28
    Unit = 0,0,0,75,14
    
    [LAN]
    Node = unknown
    TCPIP = 0
    
    [Language]
    #Set to 'Russian(Russia)' by Disp on 06.09.2018 12:18:50.
    LocalLanguage = Russian(Russia)
    
    ! #CSE:UserItem#
    [Modnet]
    #Set to '1' by Disp on 01.08.2019 14:20:06.
    Debug = 1
    #Set to '* ALL' by Disp on 01.08.2019 14:19:49.
    DebugStr = * ALL
    #Set to '10' by Disp on 01.08.2019 15:57:14.
    Delay = 10
    #Set to '400471' by Disp on 31.07.2019 16:43:12.
    InitVar = 400471
    #Set to '3' by Disp on 31.07.2019 16:43:42.
    InitVarType = 3
    #Set to '0' by Disp on 31.07.2019 16:50:04.
    Polltime = 0
    #Set to '3' by Disp on 01.08.2019 15:37:27.
    Retry = 3
    
    [OID]
    #Set to '1' by Disp on 09.04.2018 10:33:22.
    Reset = 0
    
    [Page]
    Startup = Main
    
    [ProcessAnalyst]
    LanguagePath.Chinese = zh-cn
    LanguagePath.Chinese(Simplified, PRC) = zh-cn
    LanguagePath.English = en
    LanguagePath.French = fr
    LanguagePath.French(France) = fr
    LanguagePath.German = de
    LanguagePath.German(Germany) = de
    LanguagePath.Italian = it
    LanguagePath.Italian(Italy) = it
    LanguagePath.Japanese = ja
    LanguagePath.Japanese(Japan) = ja
    LanguagePath.Korean = ko
    LanguagePath.Korean(Korea) = ko
    LanguagePath.Portuguese = pt
    LanguagePath.Portuguese(Brazil) = pt-br
    LanguagePath.Russian = ru
    LanguagePath.Russian(Russia) = ru
    LanguagePath.Spanish = es
    LanguagePath.Spanish(Spain) = es
    LanguagePath.Swedish = sv
    
    [Recent File List]
    File1 = C:\ProgramData\Schneider Electric\Vijeo Citect 7.50\User\JenniesAndSymbols\Fire_Task.ci
    File2 = C:\ProgramData\Schneider Electric\Vijeo Citect 7.50\User\JenniesAndSymbols\service.ci
    File3 = C:\ProgramData\Schneider Electric\Vijeo Citect 7.50\User\JenniesAndSymbols\SQLDevice.ci
    File4 = C:\ProgramData\Schneider Electric\Vijeo Citect 7.50\User\JenniesAndSymbols\TimeFilter.ci
    File5 = C:\ProgramData\Schneider Electric\Vijeo Citect 7.50\User\Library_Controls\_Internal_AlarmFilterTransfer.ci
    File6 = C:\ProgramData\Schneider Electric\Vijeo Citect 7.50\User\Library_Controls\_Internal_AlarmFilterTable.ci
    
    [Report]
    InhibitEvent = 1
    RunStandby = 0
    Startup = 
    
    [Report.Cluster1.ReportServer1]
    Clusters = Cluster1
    CPU = 
    Events = 
    StartupCode = 
    
    [Report.Cluster_1.Report_1_P]
    Clusters = Cluster_1
    CPU = 
    Events = 
    StartupCode = 
    
    [Server]
    AutoLoginMode = 1
    EWSAllowAnonymousAccess = 0
    
    [SPC]
    AlarmBufferSize = 39
    
    [Trend]
    InhibitEvent = 1
    
    [Trend.Cluster1.TrendServer1]
    Clusters = Cluster1
    CPU = 
    Events = 
    StartupCode = 
    
    [Trend.Cluster_1.Trend_1_P]
    Clusters = Cluster_1
    CPU = 
    Events = 
    StartupCode = 
    
    [Win]
    AltSpace = 1
    Configure = 1
    
    

    Thanks

  • Hi Eric,

    I installed latest versions of TCPIP (TCPIP_4.00.02) and Modnet(2.09.10.000) drivers. It doesn't  solve a problem. We continue to receive a  

    WSAENOTSOCK 10038 error after SCADA restart during a few minutes.

    Thanks.

  • I do see a pattern in your log file: the error seems to occur every 30 seconds, which corresponds to the WatchTime period. Are you communicating from a single Citect node? Or do you have a redundant setup (2 I/O servers)?

    It might be that the Modbus device is closing the TCP channel while Citect is still trying to communicate. You might be able to tell something more after analyzing the connection with WireShark.
  • Hi,

    I have 2 I/O Servers in single node, first server is working with OPC, second with Modnet. I tried a modification with one  I\O server, it doesn't help to solve a problem.I analyze communication with WireShark.  Modnet periodically trying to access register with 7255 address. Device don't have such address in his address space, so  generate error (illegal data address).

    I can't realize what happening with  device polling in this situation and why Modnet is trying to reach this address.

    Screenshots and Wireshark capture file in sharing link 

  • Without having looked at your attachments yet, I can explain why Modnet tries to read other registers than you have configured.
    Modnet (and all other modbus drivers in Citect too) tries to read modbus registers in blocks to increase performance.
    With most brands of PLCs this is no problem because all addresses exist in PLC memory, but with some brands, especially with some RTU brands, only the configured addresses exist in the device, so you get an illegal data address error.

    To prevent Citect reading addresses in blocks, you should prefix all modbus addresses with the capital letter 'G' in your variable tag definitions. Examples: G7254 or G401190.