EPICS Controls Argonne National Laboratory

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  2015  2016  2017  2018  2019  2020  <20212022  2023  2024  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  <20212022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Modbus TCP and NEG power vacuum pump controller
From: Mark Rivers via Tech-talk <tech-talk at aps.anl.gov>
To: "Baily, Scott A" <sbaily at lanl.gov>
Cc: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Sat, 24 Apr 2021 12:02:43 +0000
Hi Scott,


A couple of suggestions.


Do they say anything about the "slave address"?  Some devices I've seen use 1 instead of 0.


So you could try changing your command to this:


drvModbusAsynConfigure("NEGmb","NEG",1,3,0x1140,0x40,0,2000,"SAES")

You could also try using a small number of registers (e.g. 16) in the read operation to see if that helps:

drvModbusAsynConfigure("NEGmb","NEG",0,3,0x1140,0x10,0,2000,"SAES")

Mark

________________________________
From: Mark Rivers
Sent: Friday, April 23, 2021 9:26 PM
To: Baily, Scott A
Cc: tech-talk at aps.anl.gov
Subject: Re: Modbus TCP and NEG power vacuum pump controller


Hi Scott,


I see you are following the recommendation in R3-2 to set the noProcessEos flag=0 in drvAsynIPPortConfigure().  I have found that there is a minor bug in that case which prevents the driver from printing an error message if the device returns a Modbus exception.  I have fixed that on the master branch.


Your device is returning this, which is a Modbus exception:

00 12 00 00 00 03 00 83 02


The 83 means this is a Modbus exception on the function code 3 request, and 02 means it is exception type 2, which is

ILLEGAL DATA ADDRESS.

This means that you are not using the correct address in your request.

I don't see what you are doing wrong, it looks OK to me.

Mark


________________________________
From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Baily, Scott A via Tech-talk <tech-talk at aps.anl.gov>
Sent: Friday, April 23, 2021 7:01 PM
To: tech-talk at aps.anl.gov
Subject: Modbus TCP and NEG power vacuum pump controller


I’m new to Modbus TCP, so I’m not quite sure how to match up the pump controller documentation with the Modbus documentation.



The software user manual says it implements 0x03 and 0x10 functions. It says

“The output address space starts at base address 0x1000, output offset is 0x100.  Considering output numbered from 0 to available output number minus one a output register address is given by:

Registeraddress = baseaddress + outputoffset * outputnumber + registeroffset

e.g. output 2 VOUT register is 0x1000 + 0x100 * 1 + 0x49 = 0x1149”

It also says:

Each output has a unique address space starting at output base address, with the output status registers from 0x40 to 0x80.



The register I’m interested in is read only, and with an offset of 0x4a (instead of 0x49).



I configured it as follows:

drvAsynIPPortConfigure("NEG","172.20.39.175:502",0,0,0)

modbusInterposeConfig("NEG",0,5000,10)

drvModbusAsynConfigure("NEGmb","NEG",0,3,0x1140,0x40,0,2000,"SAES")



database:

record(ai, "TESTnegI") {

    field(DTYP,"asynInt32")

    field(INP,"@asynMask(NEGmb 0xa 16)MODBUS_DATA")

    field(LINR,"LINEAR")

    field(EGUL,"0")

    field(EGUF,"655.36")

    field(HOPR,"655.36")

    field(LOPR,"0")

    field(SCAN,"1 second")

}



How should I be configuring this?  I realize I/O Intr would be a better SCAN choice, but at this point I’m more concerned with getting the read to work.

Thank you,

Scott



Debug information follows:



asynReport shows:

modbus port: NEGmb

    initialized:        true

    asynOctet server:   NEG

    modbusSlave:        0

    modbusFunction:     3

    modbusStartAddress: 010500

    modbusLength:       0100

    absoluteAddressing: false

    dataType:           0 (INT16)

    plcType:

    I/O errors:         13

    Read OK:            0

    Write OK:           0

    pollDelay:          2.000000

    Time for last I/O   0 msec

    Max. I/O time:      0 msec

    Time per hist. bin: 1 msec

Port: NEGmb

  Timestamp: <undefined>

  Input EOS[0]:

  Output EOS[0]:

Parameter list 0

Number of parameters is: 12

Parameter 0 type=asynInt32, name=MODBUS_DATA, value is undefined

Parameter 1 type=asynInt32, name=MODBUS_READ, value is undefined

Parameter 2 type=asynUInt32Digital, name=ENABLE_HISTOGRAM, value is undefined

Parameter 3 type=asynInt32, name=READ_HISTOGRAM, value is undefined

Parameter 4 type=asynInt32, name=HISTOGRAM_BIN_TIME, value is undefined

Parameter 5 type=asynInt32Array, name=HISTOGRAM_TIME_AXIS, value is undefined

Parameter 6 type=asynFloat64, name=POLL_DELAY, value is undefined

Parameter 7 type=asynInt32, name=READ_OK, value=0, status=0

Parameter 8 type=asynInt32, name=WRITE_OK, value=0, status=0

Parameter 9 type=asynInt32, name=IO_ERRORS, value=13, status=0

Parameter 10 type=asynInt32, name=LAST_IO_TIME, value=0, status=0

Parameter 11 type=asynInt32, name=MAX_IO_TIME, value=0, status=0



This is what the asynTrace shows:



2021/04/23 17:42:57.539 172.20.39.175:502 write 12



00 11 00 00 00 06 00 03 11 40 00 40

2021/04/23 17:43:05.545 172.20.39.175:502 write 12



00 12 00 00 00 06 00 03 11 40 00 40

2021/04/23 17:43:05.546 172.20.39.175:502 read 9



00 12 00 00 00 03 00 83 02



References:
Modbus TCP and NEG power vacuum pump controller Baily, Scott A via Tech-talk
Re: Modbus TCP and NEG power vacuum pump controller Mark Rivers via Tech-talk

Navigate by Date:
Prev: Re: Modbus TCP and NEG power vacuum pump controller Mark Rivers via Tech-talk
Next: RE: RPM packages for EPICS Abdalla Ahmad 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  <20212022  2023  2024 
Navigate by Thread:
Prev: Re: Modbus TCP and NEG power vacuum pump controller Mark Rivers via Tech-talk
Next: Purpose of the asynDrvUserMask interface Abdalla Ahmad 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  <20212022  2023  2024 
ANJ, 25 Apr 2021 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·