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  2008  2009  <20102011  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  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: streamDevice hex format input
From: Gorka Ronda <[email protected]>
To: "[email protected]" <[email protected]>
Date: Mon, 13 Sep 2010 15:42:31 +0200

Hi all,

 

I’m using streamDevice, attempting to communicate with a device sending and receiving in hex format. I achieve to make right the sending, but I have problems with the receiving. I write the following in the protocol file:

 

##################################################################

cmd1 = \xC0\x01\xFE\x00\x00\x00\x00\x00\x00%<xor>;

c1 {

    out "\$cmd1";

#    in "\xA0\x55\xAA\x5F";

#    in 0xA0 0x55 0xAA 0x5F

#    in "%s";

    in "%*4r";

}

###################################################################

 

 

Like you could see I try different options for input, but any of those and others I try work for me. I like to have an input in hex like, 0xA0 0x55 0xAA 0x5F or A0 55 AA 5F in my soft IOC. Instead, I have the following, which could be ASCII:

 

##############################################################

epics> 2010/09/13 15:20:08.440 /dev/ttyS0 read 1

\240

2010/09/13 15:20:08.442 /dev/ttyS0 read 3

U\252_

###############################################################

 

 

What I have to write exactly for the input?

 

This is the record I use for that command. What type of record should I use?

 

##########################################################

record(bi, "$(P)$(R)C1")

{

    field(DESC, "Comando 1")

    field(DTYP, "stream")

    field(INP,  "@devwbc6600.proto c1 $(PORT) $(A)")

}

##############################################################

 

 

This is the st.cmd file:

 

###############################################################################

cd ${TOP}

## Register all support components

dbLoadDatabase "dbd/wbc6600test.dbd"

wbc6600test_registerRecordDeviceDriver pdbbase

 

###############################################################################

# Set up ASYN ports

# drvAsynSerialPortConfigure port ipInfo priority noAutoconnect noProcessEos

drvAsynSerialPortConfigure("L0","$(TTY)",0,0,0)

asynSetOption("L0", -1, "baud", "115200")

asynSetOption("L0", -1, "bits", "8")

asynSetOption("L0", -1, "parity", "none")

asynSetOption("L0", -1, "stop", "1")

asynSetOption("L0", -1, "clocal", "Y")

asynSetOption("L0", -1, "crtscts", "N")

asynOctetSetInputEos("L0", -1, "\n")

asynOctetSetOutputEos("L0", -1, "\n")

asynSetTraceIOMask("L0",-1,0x2) #0x7 para todos los mensajes

asynSetTraceMask("L0",-1,0x9) #0x1f para todos los mensajes

 

###############################################################################

## Load record instances

dbLoadRecords("db/devwbc6600.db","P=$(P),R=$(R),PORT=L0,A=0")

dbLoadRecords("db/asynRecord.db","P=$(P)$(R),R=asyn,PORT=L0,ADDR=-1,OMAX=0,IMAX=0")

###############################################################################

## Start EPICS

cd ${TOP}/iocBoot/${IOC}

iocInit

######################################################################

 

 

Thanks in advance,

 

Gorka

 


Replies:
RE: streamDevice hex format input Tian, Yuke

Navigate by Date:
Prev: Can devices supported in areaDetector include Jai and Imperx?(links to the data sheets ) 孟欣东
Next: RE: streamDevice hex format input Tian, Yuke
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: Can devices supported in areaDetector include Jai and Imperx?(links to the data sheets ) tom.cobb
Next: RE: streamDevice hex format input Tian, Yuke
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 15 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·