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: RE: Stream Device With Parameters
From: Gorka Ronda <[email protected]>
To: "[email protected]" <[email protected]>
Date: Thu, 16 Sep 2010 18:59:53 +0200
I send the information appended to previous mail but without text format, for future revisions:


1.	INTRODUCTION

The commands are part of the protocol for RS232 communication between the device and a PC. The protocol is based on data frames. Each command the device receives will be a data frame. This data frame contains always the same number of bytes. The peripheral for the serial communication of DSP (SCI) has a 16-byte FIFO buffer. It is capable of receiving up to 16 bytes without the DSP has to perform any operation. Once the 16 bytes received an interrupt is generated, and within this interruption we analyze the 16 bytes of the received frame.In the protocol, the length of the frame is of 10 bytes. 


2.	DESCRIPTION OF THE FRAMES OF COMMUNICATION

The definition of the 10 bytes of the frames of communication is:

Byte 0	Byte 1	Byte 2	Byte 3	Byte 4	Byte 5	Byte 6	Byte 7	Byte 8	Byte 9

Comm.     Index      ~Index           Parameter 1            Parameter 2              Parameter 3           CRC


Byte 0: Command indicator. There should always be 0xC0.
Byte 1: Command index (there are 17 commands).
Byte 2: Complement to 1 of command index.
Byte 3: Upper part of the parameter 1.
Byte 4: Lower part of the parameter 1.
Byte 5: Upper part of the parameter 2.
Byte 6: Lower part of the parameter 2.
Byte 7: Upper part of the parameter 3.
Byte 8: Lower part of the parameter 3.
Byte 9: CRC of the bytes 0 to 8.


3.	COMANDS THAT I WANT TO CALL FROM EPICS, 4 AND 5

Command 4. Request for 16-bit variable

Byte 0	Byte 1	Byte 2	Byte 3	Byte 4	Byte 5	Byte 6	Byte 7	Byte 8	Byte 9
0xC0	0x04	0xFB	        Add HI	Add LO	     x	            x	            x	             x	          CRC

Returns the value of a variable of 16 bits stored in the memory address indicated by add HILO. This command does not distinguish types of variables signed, unsigned... Who makes the call to this command must know which type of variable will s/he read and act upon the data received.
The device must answer:

Byte 0	Byte 1	Byte 2	Byte 3
Val. HI	Val. LO	Val. ~HI	Val. ~LO



Command 5. Request for 32-bit variable.

Byte 0	Byte 1	Byte 2	Byte 3	Byte 4	Byte 5	Byte 6	Byte 7	Byte 8	Byte 9
0xC0	0x05	0xFA	         Add Hi	Add LO	    x	            x	            x	            x	          CRC

Returns the value of a variable of 32 bits stored in the memory address indicated by add HILO. This command does not distinguish types of variables float, signed, unsigned ... Who makes the call to this command must know what type of variable will s/he read and act upon the data received.
The device must answer:


Byte 0	         Byte 1	    Byte 2	        Byte 3
Bits 24-31	     Bits 16-23	  Bits 15-8  	Bits 0-7


________________________________________
De: Gorka Ronda
Enviado el: jueves, 16 de septiembre de 2010 18:37
Para: Dirk Zimoch
CC: [email protected]
Asunto: RE: Stream Device With Parameters

Thanks Dirk,

As you requested, I append to this mail part of the device documentation to know what C4 and C5 (Command 4 and 5) do.

Don't hesitate to ask for more information if you need it.

Gorka

 ________________________________________
De: Dirk Zimoch [[email protected]]
Enviado el: jueves, 16 de septiembre de 2010 15:31
Para: Gorka Ronda
CC: [email protected]
Asunto: Re: Stream Device With Parameters

Typos in my previous mail:

Hi Gorka,

I probably did not understand completely what you wanted. You want to be
able to use *different* lo and hi values each time the record processed?

If that is the case you have to store the values in some record. For
example in an "ao" record. (There you can even scale it from "user
units" in VAL to integers in RVAL. See "ao" documentation.)

So let's now assume the two values are in stored in $(P):$(R):C4:LO.RVAL
and $(P):$(R):C4:HI.RVAL. Then you can use redirection to access these
values. You have to give the record names (or the common prefix) to the
protocol as a parameter like this:

field(INP,  "@devwbc6600.proto c4($(P):$(R):C4) $(PORT) $(A)")

and use the name in $1 for two redirections to fetch LO and HI:

out 0xc0 0x04 0xfb "%(\$1:LO.RVAL)r%(\$1:HI.RVAL)r" 0x00 0x00 0x00 0x00
"%<xor>";

The %r converter just outputs the least significant byte of the
mentioned record field.

It would really help to know what the "C4" command actually does. Can
you give me a link to the device documentation?

Dirk


Replies:
Re: Stream Device With Parameters Dirk Zimoch
References:
[no subject] Gorka Ronda
Re: Stream Device With Parameters Dirk Zimoch
RE: Stream Device With Parameters Gorka Ronda
Re: Stream Device With Parameters Dirk Zimoch
Re: Stream Device With Parameters Dirk Zimoch
RE: Stream Device With Parameters Gorka Ronda

Navigate by Date:
Prev: Re: Testing the new DBE property in EPICS R3-14-11 Ben Franksen
Next: RE: Strange gateway error message Jeff Hill
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: Stream Device With Parameters Gorka Ronda
Next: Re: Stream Device With Parameters Dirk Zimoch
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, 21 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·