Experimental Physics and Industrial Control System
|
Thanks for the idea!
I will test it and then let you know the result.
With gratitude, Vitalii
Hi Vitalii,
I think I see a way you can do this, though I have not tested it.
- Set the underlying asyn TCP driver to have disconnectOnReadTimeout=Y.
- Create one Modbus port that only does the authentication with a dedicated database for that.
- Load an asyn record on the TCP driver port and on each of the Modbus asyn ports.
- Set the Modbus asyn ports to have autoConnect=0. That way they will only connect when explicitly commanded to.
- Have one calcout record that monitors the CNCT field of the TCP port asyn record
- When CNCT makes a transition from 0 to 1 (i.e. a connect event) then it triggers processing of a seq record that does the following:
- Set CNCT of the Modbus authentication port asyn record to 1. It will then connect.
- Process the authentication records.
- Set the CNCT fields of the remaining Modbus port asyn records to 1. Normal I/O will then start.
- When CNCT makes a transition from 1 to 0 (i.e. a disconnect event) then it triggers processing of a seq record that does the following:
- Set CNCT of all the Modbus ports asyn records including the authentication port to 0
Mark
The problem is not in the sequence, but rather how to *trigger* it upon
connect. I.e.:
1. Perform Modbus reads and writes *immediately* after connect() success.
2. *Before* any other I/O takes place.
3. Repeat it upon further reconnects (also before any other I/O).
Looking at https://epics-modules.github.io/modbus/ I
can't find any way to
achieve this.
You can try writing a record for each authorization step with passive scan (or no SCAN) and then each record process the next with FLNK, with this you
can only process the first record and the rest are processed sequentially. We do have a similar situation where a Modbus device requires setting a password for administrator access, we made a record that just writes a value to a certain address and we have
admin access to the device.
Best Regards,
Abdalla Al-Dalleh
Control Engineer
SESAME
From: Tech-talk <[email protected]>
On Behalf Of ??????? ??????? via Tech-talk
Sent: Tuesday, November 18, 2025 6:33 AM
To: [email protected]
Subject: Modbus-TCP "authorization"
Hi!
I have a Modbus-TCP device which requires a so called "authorization" to
be performed BEFORE any actual I/O can take place; without such an
authorization all register writes and even reads result in exception 2
("illegal data address").
The "authorization" consists of several register reads and writes, in
specific order:
1. Write INT32_LE:0x89ABCDEF to holding registers 0x2100,0x2101
2. Write INT32_LE:0x01234567 to holding registers 0x2102,0x2103
3. Write 0 to holding register 0x2104
4. Read discrete input 0x2200
Is there some mechanism to perform this sequence immediately upon connect?
Looking at "modbus" module documentation, I see nothing relevant.
Thanks in advance!
- References:
- Modbus-TCP "authorization" Виталий Балакин via Tech-talk
- RE: Modbus-TCP "authorization" Abdalla Ahmad via Tech-talk
- Re: Modbus-TCP "authorization" Виталий Балакин via Tech-talk
- RE: Modbus-TCP "authorization" Mark Rivers via Tech-talk
- Navigate by Date:
- Prev:
quadEM R9-6 released Mark Rivers via Tech-talk
- Next:
Further OMS PC78 questions James P. Withrow via Tech-talk
- 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>
2026
- Navigate by Thread:
- Prev:
RE: Modbus-TCP "authorization" Mark Rivers via Tech-talk
- Next:
Streaming from quadEM to HDF5 Graeme Winter via Tech-talk
- 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>
2026
|
|
ANJ, 19 Mar 2026 |
·
Home
·
News
·
About
·
Talk
·
Base
·
Modules
·
Extensions
·
·
Distributions
·
Download
·
Documents
·
Links
·
Licensing
·
|