Hi Liang,
There's a few things that do not make sense.
1. You have a longin *input* record that is connected to a protocol that
only writes to the device. Where do you expect this record to get its
value from?
2. Your calcout record is invalid: spaces are not allowed in record names.
3. The input A of your calcout points to itself: every time it
processes, it will multiply the previous value with 20 (according to
your CALC expression) and send it to the hardware. This is probably not
what you intend to do.
Assuming that you have your protocol right, and that the RPS record
should hold your number, you should be thinking along the lines of
record(longout,"RPS") # relative distance
{
field(DESC, "move relative")
field(EGU, "um")
field(FLNK, "RPS_write PP")
}
record(calcout,"RPS_write")
{
field(DTYP,"stream")
field(OUT,"@devKohzuAries.proto RPS $(PORT) $(A)")
field(CALC,"A*20")
field(INPA,"RPS")
}
HTH,
~Ralph
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:
Sorenson SGA DC power supplies Linda.Pratt
- Next:
Re: Defining enums to express state? Ryan Pierce
- 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:
usage of CALC 梁雅翔
- Next:
Re: usage of CALC Dirk Zimoch
- 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
|