Gateway crashing when trying to open serial port

Hi

I’m having an issue with a system that I’m playing around with. I’m trying to read from a serial port via a tag change gateway script, but every time i try to open it the gateway is crashing.
Gateway version 8.1.7 (b2021060314)

Looking at the wrapper log all I can see is :

INFO | jvm 2 | 2021/07/14 19:40:01 | I [p.DesignSession ] [18:40:01]: Socket connected to session. pageId=session-props session-project=Weighing_Room
ERROR | wrapper | 2021/07/14 19:42:02 | JVM exited unexpectedly.
STATUS | wrapper | 2021/07/14 19:42:07 | Reloading Wrapper configuration…
STATUS | wrapper | 2021/07/14 19:42:08 | Launching a JVM…
INFO | jvm 3 | 2021/07/14 19:42:08 | WrapperManager: Initializing…

I have tried using the system.serial. port script strait from the users manual, but it still does the same thing.

with system.serial.port(
** port = “COM3”,**
** bitRate = system.serial.BIT_RATE_9600,**
** dataBits = system.serial.DATA_BITS_8,**
** handshake = system.serial.HANDSHAKE_NONE,**
** hardwareFlowControl = False,**
** parity = system.serial.PARITY_NONE,**
** stopBits = system.serial.STOP_BITS_1) as port:**


** line = port.readLine(60000)**

Any thoughts?

Kev

What OS/version is the Ignition Gateway running on?

Hi Kevin

Server 2016 Standard.
Version 1607
OS Build 14393.4169

Kev

Are there any crash dump files in the Ignition install dir or nearby? Probably named hs_err_pid something…

No crash dump files at all :grimacing:

I thought the with (context manager) syntax for system.serial.port() was broken at the moment. Try without using it as a context manager.

The issues with context manager should have been fixed in 8.1.3, though @ggross is still seeing something weird going on with it.

@kevin.keefe Not sure what’s going on with your crash though. We’re unable to reproduce on Server 2016 here.

Issues I was seeing with the context manager were user error. It looks like it is working as expected in the 8.1.3+.

@kevin.keefe is there anything else within Ignition that might be connecting to the same serial port? Also, is Windows Device Manager showing everything being ok with the COM port?

Garth

Garth

All looks fine with the COM port.
As far as I can see, there is nothing else connecting to that specific serial port.

@Kevin.Herron : I’ll format & reinstall the OS tomorrow to see if anything changes

I’ve just noticed that the serial port monitor that i use is now playing up. Not sure if that is connected

Kev

Anything in Windows’ Event Viewer logs after you restart?

This is whats showning up in the Windows Event Viewer when the issue occurs:

Faulting application name: java.exe, version: 11.48.0.22, time stamp: 0x6069e9a2
Faulting module name: ntdll.dll, version: 10.0.14393.3986, time stamp: 0x5f77fd0d
Exception code: 0xc00000fd
Fault offset: 0x000000000002e7cd
Faulting process id: 0x2f90
Faulting application start time: 0x01d778f4c042846d
Faulting application path: C:\Program Files\Inductive Automation\Ignition\lib\runtime\jre-win\bin\java.exe
Faulting module path: C:\Windows\SYSTEM32\ntdll.dll
Report Id: 9d96e27b-02c2-4044-8b2b-2afbb2b7fb65
Faulting package full name:
Faulting package-relative application ID

I am having a similar issue with Ignition v7.9.16 by accessing the gateway serial port to read modbus data via a usb/RS485 adapter. The serial port is installed in Windows (Server 2019) properly, and a Modbus serial device is created on the gateway. Once I create a tag accessing this device, the gateway crashes. On restarting the gateway from the GCU it restarts and shows running and then crashes immediately and seems to enter a state where it is perpetually trying to do something (don’t know what), the status icon keeps refreshing, but doesn’t come back online. The only way I can restart it is by using the GCU to stop it completely, then manually delete the serial gateway module, then restart the gateway. If I don’t force stop the gateway I can’t delete the serial module as it is being used by java.exe. The serial client module does not have issues and I have used this successfully via the same gateway. This has been observed on multiple gateways so is not hardware specific (although all are similar Dell servers), and affects any type of serial port access on the gateway, modbus, ascii, etc.

Ignition v7.9.x implements serial port support via the jserial library. It is old and poorly maintained. For v8.x, they rewrote their implementation around the jSerial library. Which is well supported and maintained. In this situation, the default answer is “Upgrade Ignition”. Presumably to v8.1, so you’ll still be on a long-term supported version.

However, it so happens that I implemented my Advanced Modbus Driver with the jSerial library, even for v7.9. That might get you out of trouble.