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  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: db question about S7-PLC driver
From: Dirk Zimoch <[email protected]>
To: marco_hair <[email protected]>
Cc: tech-talk <[email protected]>
Date: Thu, 21 Aug 2008 09:12:27 +0200
Hello

record (ao, "$(RECORDNAME)") {
  field (DTYP, "S7plc")
  field (OUT,  "@$(PLCNAME)/$(OFFSET) T=INT32")
  field (LINR, "Linear")
  field (EGUL, "-214748.3647")
  field (EGUF, "214748.3647")
}

214748.3647 = 0x7FFFFFFF / 1000.
When using an INT data type with an ao record, the driver uses the RVAL field. Tell the record to convert VAL to RVAL by setting LINR="Linear" and provide the limits for conversion. Write the min and max float values to EGUL and EGUF and the min and max integer values to the link in L=... and H=...
The defaults for min and max integer are L=-2147483647 and H=2147483647 for a 32 bit signed integer. You can choose other limits if they apply better to your application:


record (ao, "$(RECORDNAME)") {
  field (DTYP, "S7plc")
  field (OUT,  "@$(PLCNAME)/$(OFFSET) T=INT32 L=0 H=9999999")
  field (LINR, "Linear")
  field (EGUL, "0.0")
  field (EGUF, "999.9999")
}


Dirk



marco_hair wrote:
hi,all:

I am using S7 plc driver written by dirk.zimoch. If I want to exchange interger value(1234567) between IOC and PLC using ai/ao record(that's because plc uses interger format data), but in edm's gui, the data format(123.4567) is float type. how can I do this?
1. I can use an additional record such as calc to convert.
2. I can exchange float data directly between ioc and plc if changing plc program.
while I don't want to take these ways, Are there any other ways? such as using linear convert of ai/ao, etc.? is it possible?
Thanks a lot in advance.




------------------------------------------------------------------------
伊利:有梦想,就有下一次飞翔。期待刘翔王者归来。 <http://popme.163.com/link/004758_0820_5283.html>

-- Dr. Dirk Zimoch Paul Scherrer Institut, WBGB/006 5232 Villigen PSI, Switzerland Phone +41 56 310 5182

References:
db question about S7-PLC driver marco_hair

Navigate by Date:
Prev: db question about S7-PLC driver marco_hair
Next: Re: Build Question Benjamin Franksen
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: db question about S7-PLC driver marco_hair
Next: Fwd: Mail delivery failed: returning message to sender Benjamin Franksen
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·