1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 <2022> 2023 2024 2025 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 <2022> 2023 2024 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: Configuring serial communication with Lakeshore 331 via Moxa |
From: | "Wlodek, Jakub via Tech-talk" <tech-talk at aps.anl.gov> |
To: | Mark Rivers <rivers at cars.uchicago.edu> |
Cc: | "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov> |
Date: | Thu, 3 Feb 2022 14:56:16 +0000 |
Hi all,
Thanks to everyone so much for the help! I was able to get it communicating OK - I had switched the option to 7 bits in the IOC startup, but had forgotten to set that on the Moxa. Setting the data bits to 7 there got the messages coming back as expected. I
did run into some additional issues, with a few of the scalcout records, I was getting CALC and LINK alarms until I changed instances of:
field(CALC, "SSCANF(AA,'%s')[2,10]")
field(CALC, "AA[2,10]")
and similar. Once I made the above changes to the database the alarms went away. If these are logical, I'll make a PR with those changes.
Thanks again!
Jakub
From: Mark Rivers <rivers at cars.uchicago.edu>
Sent: Wednesday, February 2, 2022 12:47 PM To: Wlodek, Jakub <jwlodek at bnl.gov> Cc: tech-talk at aps.anl.gov <tech-talk at aps.anl.gov> Subject: RE: Configuring serial communication with Lakeshore 331 via Moxa Hi Jakub,
You had: drvAsynIPPortConfigure("LAKE1", "SOMEIP:SOMEPORT") asynSetOption("LAKE1", -1, "baud", "9600") asynSetOption("LAKE1", -1, "bits", "8") asynSetOption("LAKE1", -1, "parity", "odd") asynSetOption("LAKE1", -1, "stop", "1")
That won’t work because you have not enabled the RFC 2217 protocol, so the asynSetOption() commands have not effect. Most Moxa terminal servers support the RFC 2217 protocol, but first you need to enable that on the Moxa box. Then you need to change your drvAsynIPPortConfigure command to this:
drvAsynIPPortConfigure("LAKE1", "SOMEIP:SOMEPORT COM"
See the documentation here: https://epics-modules.github.io/master/asyn/R4-42/asynDriver.html#drvAsynIPPort
Also, the Lakeshore manual (https://www.lakeshore.com/docs/default-source/product-downloads/331_manual.pdf?sfvrsn=5ed3bf08_1) says the data format is this: 1 Start, 7 Data, 1 Parity, 1 Stop
So you need to change “bits” from 8 to 7.
The behavior you are seeing is probably because you have not actually enabled off parity and the correct number of data bits.
You should set asynTraceMask on the IP port to ERROR|DRIVER and asynTraceIOMask to ESCAPE. Then post the output when you send a few commands, telling us what the expected response is.
Mark
From: Tech-talk <tech-talk-bounces at aps.anl.gov>
On Behalf Of Wlodek, Jakub via Tech-talk
Hi all,
I've been working to get an IOC up and running for a lakeshore 331 TC we have here at NSLS2, using the support for it I found in the ip module on github: https://github.com/epics-modules/ip/blob/master/ipApp/Db/LakeShore331.db
To start, I have the IOC just creating the asyn port pointing at the TCP Server on the appropriate port on the moxa, and I load the asynRecord database, so I can test sending/receiving commands using the asynOctet interface. I configured the serial connection on the moxa, asyn, and the device to 9600 baud, 8 data bits, and one stop bit, and I can see that I am communicating with the device on some level, however, the responses I am seeing don't seem correct; they are full for unexpected characters, and don't match the format listed in the manual. I am guessing there is still something I missed in the configuration of the serial connection.
Current IOC startup:
[jwlodek@xf06bm-ioc2 ioclakeshore331]$ more st.cmd
Also, while every command I send gets some (different) response, I seem to get a timeout error for the asynOctet interface, indicating something is not quite right:
Has someone configured such a device that has run into a similar issue? Or alternatively, does anyone know what could the cause be?
Thanks for the help! Jakub
|