Subject: |
Re: device support routines for RS232 |
From: |
"Garrett D. Rinehart" <rinehart> |
To: |
[email protected] |
Cc: |
tech-talk |
Date: |
Mon, 2 Dec 2002 09:43:51 -0600 (CST) |
> Before getting any response(value) from the controller it has to send some
> commands and I hope to use standard records ai/mbbi/stringin/stringout
> instead of writing a new record. How to attach the string command("#aa02cnt")
> in Ai record field to read the pressure?
If you just need to send a command string to get the box to answer you, it's
quite simple. Take this record to read an Omega temperature meter:
record(ai,"Omega") {
field(SCAN,"1 second")
field(DTYP,"Ascii SIO")
field(INP,"@/tyGS/$(IP)/$(PORT) REAL <*X01><X01%f>")
}
The command the Omega meter needs (in the first set of "<>") is "*X01". It's
response (in the second set of "<>") is "X01{float}". I think all you need to do
is substitute your "#aa02cnt" in place of "*X01" in the first "<>". If your box
echos the command as mine does, do the same in the second "<>". If it doesn't,
just put the appropriate format descriptor in there.
ie: field(INP,"@/tyGS/$(IP)/$(PORT) REAL <#aa02cnt><#aa02cnt%f>")
or field(INP,"@/tyGS/$(IP)/$(PORT) REAL <#aa02cnt><%f>")
Note: the "REAL" command is optional... details are within the drvAscii code.
I hope that's of some help to you. You might also find a great deal of help in
the tech-talk archives as I've hashed a lot of this out here with Allan Honey in
the past year.
Garrett Rinehart
Control and Data Acquisition System Manager
Accelerator Operations Group
Intense Pulsed Neutron Source
Argonne National Laboratory
9700 S. Cass Ave
Argonne, IL 60439
(630)252-6561
- Navigate by Date:
- Prev:
RE: device support routines for RS232 Heron, MT (Mark)
- Next:
Re: Channel Access/Linux/R3.13.7 Garrett D. Rinehart
- 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: device support routines for RS232 Heron, MT (Mark)
- Next:
[no subject] Hammonds, John
- 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
|