You should also enable asynTrace on the underlying RS-485 port so you can see all the communications. The fact that you don’t receive any response suggests that you could have a wiring problem in addition
to software problems.
Mark
From: Tech-talk <tech-talk-bounces at aps.anl.gov>
On Behalf Of LONG FENG via Tech-talk
Sent: Monday, October 28, 2024 8:27 PM
To: tech-talk at aps.anl.gov
Subject: streamDevice configuration issues with serial ports
Hi all,
I have a sensor that communicates via RS485 with the Modbus RTU protocol. I want to use streamDevice to read the sensor values, but I've found that there is no data transmission between the system and the sensor, and the following
issues have occurred:
epics> 2024/10/28 21:00:05.370941 SI Sensor:Data: No reply within 10000 ms to "<01><04><00><00><00><06>p<08><0d><0a>"
2024/10/28 21:00:20.484243 SI Sensor:Data: No reply within 10000 ms to "<01><04><00><00><00><06>p<08><0d><0a>"
2024/10/28 21:00:35.322913 SI Sensor:Data: No reply within 10000 ms to "<01><04><00><00><00><06>p<08><0d><0a>"
2024/10/28 21:00:50.427348 SI Sensor:Data: No reply within 10000 ms to "<01><04><00><00><00><06>p<08><0d><0a>"
My protocol(RS485Test.proto) file is written like this:
Terminator = CR LF;
InTerminator = CR LF;
ReplyTimeout = 10000;
ReadTimeout = 10000;
getData
{
out "\x01\x04\x00\x00\x00\x06\x70\x08";
in "%r";
}
record(ai, "Sensor:Data")
{
field(DTYP, "stream")
field(INP, "@RS485Test.proto getData SI")
field(SCAN, "5 second")
}
#!../../bin/linux-x86_64/dataProcessing
< envPaths
dbLoadDatabase("../../dbd/dataProcessing.dbd",0,0)
dataProcessing_registerRecordDeviceDriver pdbbase
epicsEnvSet ("STREAM_PROTOCOL_PATH", "/home/training/examples/dataProcessingApp/Db")
drvAsynSerialPortConfigure("SI", "/dev/ttyS3")
asynSetOption("SI", 0, "baud", "9600")
asynSetOption("SI", 0, "bits", "8")
asynSetOption("SI", 0, "parity", "none")
asynSetOption("SI", 0, "stop", "1")
asynSetOption("SI", 0, "clocal", "Y")
asynSetOption("SI", 0, "crtscts", "N")
## Load record instances
dbLoadRecords("../../db/RS485Test.db")
iocInit()
Is there anything wrong with these?
|