EPICS Home

Experimental Physics and Industrial Control System


 
1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: Modbus TCP communication with PLC IDEC FC5A-D12S1E unable to read Internal Relays
From: Mazanec Tomáš <[email protected]>
To: Mark Rivers <[email protected]>, bohmm <[email protected]>, Tech talk <[email protected]>
Date: Thu, 22 Oct 2015 03:30:00 +0000

Hi Marek

I'd rather to use hex or octal numbers too. Usually, that is what you get from manufacturer's user manual -- a table with hex address pointing to particular modbus registers.

Another hint, are you sure that your BIs start with offset 1. It is usually offset 0 for the first bit.
THen length of modbus read doesn;t have to be 9 as yours st.cmd says .

Cheers,
Tomas

________________________________________
Od: [email protected] [[email protected]] za uživatele Mark Rivers [[email protected]]
Odesláno: 20. října 2015 22:36
Komu: bohmm; Tech talk
Předmět: RE: Modbus TCP communication with PLC IDEC FC5A-D12S1E unable to       read    Internal Relays

Hi Marek,

> asynReport
> BI multiDevice:Yes canBlock:No autoConnect:Yes
>    addr 0 autoConnect Yes enabled Yes connected No exceptionActive No

Do not worry about where it says "connected No".  That is normal.  asynManager has not been informed that each bit has connected which is why it says that, but it is fine.

> and from drvAsynIPPort driver:
> 2015/10/20 16:24:46.868 192.168.1.5:502 write 12
> 00 01 00 00 00 06 01 01 03 e8 00 09

You showed us what was written to the device, but not what was read back.  It is the response that we need to see, because that will tell us what it is reading for the register values.

You are using a Modbus start address of decimal 1000.  Are you sure this is correct?  Could the manufacturer actually mean 1000 in octal or hex?

Mark



________________________________________
From: [email protected] [[email protected]] on behalf of bohmm [[email protected]]
Sent: Tuesday, October 20, 2015 11:51 AM
To: Tech talk
Subject: Modbus TCP communication with PLC IDEC FC5A-D12S1E unable to read      Internal Relays

Hello,
  I have problems in reading internal relay values from an IDEC PLC. The
function code used and the Modbus addresses should be alright, when I
set the internal relays (nine of them) all to high and try to debug
using asynTrace, I got from modbus port driver:



00 00 00 00 00 00 01 00 00 00 01 00 01 00 01 00 00 00
2015/10/20 16:13:13.014 drvModbusAsyn::doModbusIO port BI READ_COILS


and from drvAsynIPPort driver:

2015/10/20 16:24:46.868 192.168.1.5:502 write 12

00 01 00 00 00 06 01 01 03 e8 00 09

The values from the port driver debug output do not match with the
internal relay values and furthermore, when I change one of the internal
relay's value, it is not changed in the modbus port driver debug output.

When I try in iocsh >>asynReport:

BI multiDevice:Yes canBlock:No autoConnect:Yes
     addr 0 autoConnect Yes enabled Yes connected No exceptionActive No
     addr 1 autoConnect Yes enabled Yes connected No exceptionActive No
     addr 2 autoConnect Yes enabled Yes connected No exceptionActive No
     addr 3 autoConnect Yes enabled Yes connected No exceptionActive No
     addr 4 autoConnect Yes enabled Yes connected No exceptionActive No
     addr 5 autoConnect Yes enabled Yes connected No exceptionActive No
     addr 6 autoConnect Yes enabled Yes connected No exceptionActive No
     addr 7 autoConnect Yes enabled Yes connected No exceptionActive No
     addr 8 autoConnect Yes enabled Yes connected No exceptionActive No
modbus port: BI


And iocsh for a "BI" modbus port driver:

epics> asynReport 5, "BI"
BI multiDevice:Yes canBlock:No autoConnect:Yes
     enabled:Yes connected:Yes numberConnects 1
     nDevices 9 nQueued 0 blocked:No
     asynManagerLock:No synchronousLock:No
     exceptionActive:No exceptionUsers 0 exceptionNotifys 0
     interfaceList
         asynCommon pinterface 0x7f2bce127ae0 drvPvt 0xd2bcc0
         asynDrvUser pinterface 0x7f2bce128110 drvPvt 0xd2bcc0
         asynUInt32Digital pinterface 0x7f2bce128140 drvPvt 0xd2bcc0
         asynInt32 pinterface 0x7f2bce128180 drvPvt 0xd2bcc0
         asynFloat64 pinterface 0x7f2bce1281c0 drvPvt 0xd2bcc0
         asynInt32Array pinterface 0x7f2bce1281e0 drvPvt 0xd2bcc0
     addr 0 autoConnect Yes enabled Yes connected No exceptionActive No
     exceptionActive No exceptionUsers 0 exceptionNotifys 0
     blocked No
     addr 1 autoConnect Yes enabled Yes connected No exceptionActive No
     exceptionActive No exceptionUsers 0 exceptionNotifys 0
     blocked No
     addr 2 autoConnect Yes enabled Yes connected No exceptionActive No
     exceptionActive No exceptionUsers 0 exceptionNotifys 0
     blocked No
     addr 3 autoConnect Yes enabled Yes connected No exceptionActive No
     exceptionActive No exceptionUsers 0 exceptionNotifys 0
     blocked No
     addr 4 autoConnect Yes enabled Yes connected No exceptionActive No
     exceptionActive No exceptionUsers 0 exceptionNotifys 0
     blocked No
     addr 5 autoConnect Yes enabled Yes connected No exceptionActive No
     exceptionActive No exceptionUsers 0 exceptionNotifys 0
     blocked No
     addr 6 autoConnect Yes enabled Yes connected No exceptionActive No
     exceptionActive No exceptionUsers 0 exceptionNotifys 0
     blocked No
     addr 7 autoConnect Yes enabled Yes connected No exceptionActive No
     exceptionActive No exceptionUsers 0 exceptionNotifys 0
     blocked No
     addr 8 autoConnect Yes enabled Yes connected No exceptionActive No
     exceptionActive No exceptionUsers 0 exceptionNotifys 0
     blocked No
modbus port: BI
     asynOctet server:   IDEC
     modbusSlave:        1
     modbusFunction:     1
     modbusStartAddress: 01750
     modbusLength:       011
     plcType:            IDEC_PLC_message
     I/O errors:         0
     Read OK:            2146
     Write OK:           0
     pollDelay:          0.100000
     Time for last I/O   1 msec
     Max. I/O time:      7 msec


I guess that the message connected No points to the problem...but here
is where I got stuck.


My st.cmd and .substitution files follow are below.


Best regards

Marek Böhm



################################################################################################################################
My st.cmd:


#!../../bin/linux-x86_64/com_test

## You may have to change com_test to something else
## everywhere it appears in this file

< envPaths

cd ${TOP}

## Register all support components
dbLoadDatabase "dbd/com_test.dbd"
com_test_registerRecordDeviceDriver pdbbase


# Use the following commands for TCP/IP
#drvAsynIPPortConfigure(const char *portName,
#                       const char *hostInfo,
#                       unsigned int priority,
#                       int noAutoConnect,
#                       int noProcessEos);

drvAsynIPPortConfigure("IDEC","192.168.1.5:502",0,0,1)


#modbusInterposeConfig(const char *portName,
#                      modbusLinkType linkType,
#                      int timeoutMsec,
#                      int writeDelayMsec)

modbusInterposeConfig("IDEC",0,5000,0)


# drvModbusAsynConfigure("portName", "tcpPortName", slaveAddress,
modbusFunction, modbusStartAddress, modbusLength, dataType, pollMsec,
"plcType")


#===========BI bits  ,,READ ONLY,, Temp
is:"BInput.substitutions"===========
drvModbusAsynConfigure( "BI"   , "IDEC", 1, 1, 1000, 9, 0, 100,
"IDEC_PLC_message")


#===========BO bits  ,,WRITE ONLY,, Temp
is:"BOut.substitutions"===========
#drvModbusAsynConfigure(   "BO"  , "IDEC", 1, 5, 200, 200, 0, 100,
"IDEC_PLC_message")





cd ${TOP}/iocBoot/${IOC}

## Load record instances
#dbLoadRecords("db/xxx.db","user=swdevHost")
#dbLoadTemplate("BOut.substitutions")
dbLoadTemplate("BInput.substitutions")


## Load record instances
#dbLoadRecords("db/xxx.db","user=swdevHost")
#dbLoadRecords("db/com_test.db","USER=swdevHost")

#cd ${TOP}/iocBoot/${IOC}
iocInit

## Start any sequence programs
#seq sncxxx,"user=swdevHost"

#asynSetTraceIOMask("IDEC",0,4)   # Enable traceIOHex
#asynSetTraceMask("IDEC",0,9)     # Enable traceError and traceIODriver

asynSetTraceIOMask("BI",0,4)   # Enable traceIOHex
asynSetTraceMask("BI",0,9)     # Enable traceError and traceIODriver



################################################################################################################################
My BInput.substitutions:


#============================================================================================
##################################### BI as bits
############################################
#============================================================================================
file "$(MODBUS)/db/bi_bit.template" { pattern
{P      ,        R           ,  PORT , OFFSET,   ZNAM,   ONAM,    SCAN}
##############################################################################################
#######################  10J Amplifire Moving parts Digital Inputs
#########################


{IDEC:,  TEST_IN_0,     BI,     1,      Low,   High,  "I/O Intr"}
{IDEC:,  TEST_IN_1,     BI,     2,      Low,   High,  "I/O Intr"}
{IDEC:,  TEST_IN_2,     BI,     3,      Low,   High,  "I/O Intr"}
{IDEC:,  TEST_IN_3,     BI,     4,      Low,   High,  "I/O Intr"}
{IDEC:,  TEST_IN_4,     BI,     5,      Low,   High,  "I/O Intr"}
{IDEC:,  TEST_IN_5,     BI,     6,      Low,   High,  "I/O Intr"}
{IDEC:,  TEST_IN_6,     BI,     7,      Low,   High,  "I/O Intr"}
{IDEC:,  TEST_IN_7,     BI,     8,      Low,   High,  "I/O Intr"}


                                                                        }

################################################################################################################################
My bi_bit.template:



# bi record template for register inputs
record(bi,"$(P)$(R)") {
     field(DTYP,"asynUInt32Digital")
     field(INP,"@asynMask($(PORT) $(OFFSET) 0x1)")
     field(SCAN,"$(SCAN)")
     field(ZNAM,"$(ZNAM)")
     field(ONAM,"$(ONAM)")
}









--
___________________________________
Ing. Marek Böhm, RP2 Control Engineer

Institute of Physics AS CR, v. v. i.

HiLASE Centre

Za Radnicí 828

252 41 Dolní Břežany

M:    +420 606 259 414

T:    +420 314 007 726

E:      [email protected]

W:    http://www.hilase.cz <http://www.hilase.cz/>

______________________________________________________________________

--
Upozorneni: Neni-li v teto zprave vyslovne uvedeno jinak, neni tato e-mailova zprava navrhem na uzavreni smlouvy ani prijetim pripadneho navrhu na uzavreni smlouvy a nezaklada predsmluvni odpovednost FZU AV CR, v. v. i.
Disclaimer: If not expressly stated otherwise, this e-mail message cannot be considered as a proposal to conclude a contract, neither the acceptance of a proposal to conclude a contract, nor does it create any pre-contractual liability on the part of FZU AV CR, v. v. i.




References:
Modbus TCP communication with PLC IDEC FC5A-D12S1E unable to read Internal Relays bohmm
RE: Modbus TCP communication with PLC IDEC FC5A-D12S1E unable to read Internal Relays Mark Rivers

Navigate by Date:
Prev: RE: Looking at ethercat and EPICS ronaldo.mercado
Next: EPICS S7plc driver & TIA Portal Nick Levchenko
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: Modbus TCP communication with PLC IDEC FC5A-D12S1E unable to read Internal Relays Mark Rivers
Next: EDM display update rate jon
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024