Hello Liang,
I would not use a calcout record. Use an ao record and scale the value
using .ASLO. So the VAL field of the ao record can hols user coordinates
(mm) abd the value sent to the device will be VAL/ASLO. Sthus you need
to set ASLO to 0.05 (1/20).
Dirk
On 27.11.2014 15:52, 梁雅翔 wrote:
Hi,
Sorry to bother you, I have some trouble which pullze me some time, could you please give me some advice.
I am trying to control a step motor.
Now I want to set a number(60) to pv(um distance), send the number*20(60*20=1200) to device. I think CALC would be useful. I could not understand CALC well though I have RRM 3-14.
The following code is what I do.
Thanks!
*******devKohzuAries.db
record(longin,"RPS") # send to device
{
field(DESC, "move relativly")
field(DTYP, "stream")
field(INP, "@devKohzuAries.proto RPS $(PORT) $(A)")
field(FLNK,"um distance")
}
record(calcout,"um distance")
{
field(DTYP,"stream")
field(OUT,"@devKohzuAries.proto RPS $(PORT) $(A)")
field(CALC,"A*20")
field(INPA,"um distance.VAL")
}
******** devKohzuAries.proto
RPS{
out "\x02RPS1/5/%d/0";
}
Liang YX
Institute of High Energy Physics
Chinese Academy of Sciences
P. O. Box 918, 100049 Beijing
R. P. China
Tel: 0086-0188235977-603
Email: [email protected]
- References:
- usage of CALC 梁雅翔
- Navigate by Date:
- Prev:
Re: Defining enums to express state? Torsten Bögershausen
- Next:
RE: edm questions Linda.Pratt
- 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
- Navigate by Thread:
- Prev:
Re: usage of CALC Ralph Lange
- Next:
Sorenson SGA DC power supplies Linda.Pratt
- 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
|