Zen's suggestion is similar to Matt Pearson's suggestion. The asynMotorController and asynMotorAxis classes which you would need to implement for a motor record driver are subclasses asynPortDriver.
There are a couple of quite simple motor drivers that can be used as examples:
corvette:~/devel/motor/motorApp>wc AcsSrc/MCB4BDriver.cpp
336 1284 11797 AcsSrc/MCB4BDriver.cpp
corvette:~/devel/motor/motorApp>wc ACRSrc/ACRMotorDriver.cpp
504 2037 18433 ACRSrc/ACRMotorDriver.cpp
These are only 336 and 504 lines of code respectively.
Mark
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Zenon Szalata
Sent: Friday, June 21, 2013 10:59 AM
To: [email protected]
Subject: Re: help setting up XY table control with EPICS StreamerClass
Hi Christian,
If you are a C or C++ programmer, why not consider asynPortDriver class,
which is part of the asyn package, to implement all your decision
making, testing, calculating, etc.
It has device support built in, so that with a handful of EPICS data
base records you could implement what you need. Personally, I have
moved away from stream device in favor of asynPortDriver approach,
because I find it rather difficult to implement complicated logic in
data base records, which is so much easier done in the C code.
My two cents,
Zen
On 06/21/13 02:07, Christian Pauly wrote:
> No, only one motor can move at a time.
> But i thought it is "bad style" to do this synchronous with such large
> delays ? ( I had to define huge timeouts in the protocol to get it work...)
>
> But i have a second problem with this approach:
> I need some record, which tells me if the motors are running or not at
> the moment. I need this information to control data taking during
> XY-scans only while the motors are off.
>
> Only solution i could find so far is a record like this:
> record(calc, "XY:motoron")
> {
> field(SCAN, "1 second")
> field(DESC, "Detect motor activity")
> field(INPA, "XY:moveu.PACT")
> field(INPB, "XY:moved.PACT")
> field(INPC, "XY:movel.PACT")
> field(INPD, "XY:mover.PACT")
> field(CALC, "A||B||C||D")
> }
>
> But this only works, if i define the record as regular scanning, so
> there might be some time delay when the motors are running already, but
> the next scan cycle is not startet yet. I want to work with short delays
> between the motor moves of only few seconds for data taking.
>
> If i make the record SCAN passive it does not work. the record always
> returns 0, independant if the motors are moving or not. Maybe this is
> connected to the PACT field, which can not be monitored ?
>
>
> For a synchronous approach i thougt i make dfanout records for the four
> motor moves, which first set motoron.VAL to 1, and then forward to the
> actual move command, without waiting for the OK confirmation in the
> protocol.
>
> Then i would have another in-record, with "SCAN II-Intr", which waits
> for an "OK" message. Every time the OK comes, this record would reset
> motoron.VAL to 0... but how can i do this ???
> I guess i somehow have to compare the input text with the string "OK" ???
>
> Any help appreciated !
>
> Christian
>
>
>
>
>
> On 06/20/2013 06:53 PM, Eric Norum wrote:
>> Can the table accept commands while a previous command is active? If not, what is wrong with just waiting for the OK?
>>
>> On Jun 20, 2013, at 9:05 AM, Christian Pauly<[email protected]> wrote:
>>
>>> Hi
>>> I am trying to set up EPICS control for a XY-scanning table.
>>> Control of the motor controller for the two stepper motors via RS232 is rather simple, and already implemented via StreamerClass:
>>>
>>> The controller understands 4 simple commands:
>>> u100/r
>>> d100/r
>>> l100/r
>>> r100/r to move the motors up/down/left/right by 100 steps.
>>>
>>> In return, AFTER FINISHING the move (which can take up to 10sec), the controller returns a "OK/r/n"
>>>
>>> So far i was using a protokoll like this:
>>> move {
>>> out "\$1%d\r";
>>> in "OK\r\n";
>>> }
>>>
>>> and 4 EPICS records for moving like this:
>>> record(longout, "XY:movel")
>>> {
>>> field(DESC, "Move XY-Table left")
>>> field(DTYP, "stream")
>>> field(OUT, "@devXYtableSupport.proto move(l) $(PORT) $(A)")
>>> field(FLNK, "XY:posX.PROC")
>>> }
>>>
>>> However, due to the long move-times, this is not ideal. As i understand from the documentation, one should rather implement an asynchronous control.
>>>
>>> Best would be, to have a separate boolan record "motorsmoving" which is set to "TRUE" every time i send a move command to the controller, and which is set back to "FALSE" once the controller sends back the "OK".
>>>
>>> Any advice how to proceed ???
>>> I am fighting for days now...
>>>
>>> Thanks for any help !
>>>
>>> Christian
>>>
- References:
- Re: help setting up XY table control with EPICS StreamerClass Christian Pauly
- Re: help setting up XY table control with EPICS StreamerClass Zenon Szalata
- Navigate by Date:
- Prev:
Multiple PCI-PCI Bridges Ned Arnold
- Next:
RE: Using all the cores available on modern processors Mark Rivers
- 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: help setting up XY table control with EPICS StreamerClass Zenon Szalata
- Next:
Re: help setting up XY table control with EPICS StreamerClass Christian Pauly
- 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
|