Hi there
Had connected a serial port RS422 from one pc using hyper terminal to send text string to another pc(Ignition 7.9.1) via serial port RS422 to RS232 converter.
At first I am able to read all the text string received using the following script(the script is run as a client timer script @ 1ms).
import jarray, traceback
from java.lang import String, Thread
from java.util import Date
import system
import sys
import time
import re
port="COM1"
system.serial.configureSerialPort(\
port="COM1",\
bitRate=system.serial.BIT_RATE_4800,\
dataBits=system.serial.DATA_BITS_8,\
handshake=system.serial.HANDSHAKE_NONE,\
hardwareFlowControl=False,\
parity=system.serial.PARITY_NONE,\
stopBits=system.serial.STOP_BITS_1)
system.serial.openSerialPort(port)
readLinestring = system.serial.readLine(port, 10000, "UTF8")
print readLinestring
But alas, there is a power trip cause by my colleague and when the two pc started again, when the script is run again, there is an error as follows:
“Serialio Library: version 10.2.3: build 9233
Copyright (c) 1996-2015 Serialio.com, All Rights Reserved.
os.name=“Windows 7” os.arch=“x86”
java.lang.UnsatisfiedLinkError: no jspWin in java.library.path: Native library load failed jspWin trying user’s folder
java.lang.UnsatisfiedLinkError: Can’t load library: C:\Users\stmuser\jspWin.dll: Check that native library jspWin is in proper directory
java.lang.UnsatisfiedLinkError: no jspWin in java.library.path: Check that native library jspWin is in proper directory”
And the serial function did not work any more.
I try running the code on a script console and replacing the “system.serial.readLine” with system.serial.readBytesAsString
However, when the content is printed out, it shows all the funny character as follows:
Then I try to use the hyperterminal (on the Ignition pc) to try to receive the message string from the other pc(hyperterminal), the hyperterminal(on the Ignition pc) is receiving all correctly.
Finally I try using Ignition(on the Ignition pc), and running the timer script, it is working again.
The text string that is sent from another pc hyperterminal is as follows
"
$GPMSK,318.0,A,100,M,245
$PGRME,15.0,M,45.0,M,25.0,M1C
$GPXTE,A,A,0.67,L,N*6F
"
Would anyone please kindly enlightened me what is going on or what has happended?
And how could I prevent such error from happening?
Or if such error occurs, how to clear or reset the serial port so that it will work again with Ignition?
Thank you
Best regards