Skip to content
Snippets Groups Projects
Commit 84442aa3 authored by Sylvain Dupuy's avatar Sylvain Dupuy
Browse files

initial import

parent 8a978e6e
Branches
Tags
No related merge requests found
Showing
with 4203 additions and 0 deletions
File added
This diff is collapsed.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<Title> Tango Device Server User's Guide </Title>
<META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (X11; I; HP-UX B.10.20 9000/735) [Netscape]">
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#FF0000" ALINK="#FF0000">
<P><!-------TITLE------></P>
<table width="100%" height="20%"><tr>
<td align=LEFT>
<FONT COLOR="#0000FF"><FONT SIZE=+4>Synchrotron </FONT></FONT>
<FONT COLOR="#0000FF"><FONT SIZE=+4>Soleil</FONT></FONT>
<H5>Saint-Aubin - BP 48 91192 GIF-sur-YVETTE CEDEX<BR>
</td><td>
<A href="http://www.synchrotron-soleil.fr/">
<IMG SRC="http://controle/images/logo-150.gif"
ALT="SOLEIL Logo" ALIGN=RIGHT border="0"></A>
</td></tr></table>
<HR WIDTH="100%"></H5>
<Br>
<center>
<h1>
Continuous Anolog Output<Br>
Device Attributes Description
</h1>
<Br>
<b>
Revision: - Author:
</b>
</center>
<Br>
<Table Border=2 Cellpadding=3 CELLSPACING=0 WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<Td COLSPAN=4> <Font Size=+2><Center><b>Scalar Attributes</b></td></Font></Center>
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<Td><Center><b>Attribute name</b></td></Center>
<Td><Center><b>Data Type</b></td></Center>
<Td><Center><b>R/W Type</b></td></Center>
<Td><Center><b>Expert</b></td></Center>
<Tr><Td><b><Center>errorCounter</b><Br>( Errors occuring during the waveform generation. )</Center></Td>
<Td><Center>DEV_DOUBLE</Center></Td><Td><Center>READ</Center></Td><Td><Center>No</Center></Td></Tr>
<Tr><Td><b><Center>useBoardFifo</b><Br>( Set to 1 if data have been loaded in FIFO. Set to 0 if data is continuously tranfered through DMA (possible underrun) )</Center></Td>
<Td><Center>DEV_SHORT</Center></Td><Td><Center>READ</Center></Td><Td><Center>No</Center></Td></Tr>
</Table>
</Center>
<Br><Br><Br><Br><Br>
<Table Border=2 Cellpadding=3 CELLSPACING=0 WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<Td COLSPAN=4> <Font Size=+2><Center><b>Spectrum Attributes</b></td></Font></Center>
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<Td><Center><b>Attribute name</b></td></Center>
<Td><Center><b>Data Type</b></td></Center>
<Td><Center><b>X Data Length</b></td></Center>
<Td><Center><b>Expert</b></td></Center>
<Tr><Td><b><Center>channel0</b></Center></Td>
<Td><Center>DEV_DOUBLE</Center></Td><Td><Center>1000000</Center></Td><Td><Center>No</Center></Td></Tr>
<Tr><Td><b><Center>channel1</b></Center></Td>
<Td><Center>DEV_DOUBLE</Center></Td><Td><Center>100000</Center></Td><Td><Center>No</Center></Td></Tr>
<Tr><Td><b><Center>channel2</b></Center></Td>
<Td><Center>DEV_DOUBLE</Center></Td><Td><Center>100000</Center></Td><Td><Center>No</Center></Td></Tr>
<Tr><Td><b><Center>channel3</b></Center></Td>
<Td><Center>DEV_DOUBLE</Center></Td><Td><Center>100000</Center></Td><Td><Center>No</Center></Td></Tr>
<Tr><Td><b><Center>channel4</b></Center></Td>
<Td><Center>DEV_DOUBLE</Center></Td><Td><Center>100000</Center></Td><Td><Center>No</Center></Td></Tr>
<Tr><Td><b><Center>channel5</b></Center></Td>
<Td><Center>DEV_DOUBLE</Center></Td><Td><Center>100000</Center></Td><Td><Center>No</Center></Td></Tr>
<Tr><Td><b><Center>channel6</b></Center></Td>
<Td><Center>DEV_DOUBLE</Center></Td><Td><Center>100000</Center></Td><Td><Center>No</Center></Td></Tr>
<Tr><Td><b><Center>channel7</b></Center></Td>
<Td><Center>DEV_DOUBLE</Center></Td><Td><Center>100000</Center></Td><Td><Center>No</Center></Td></Tr>
</Table>
</Center>
<Br><Br><Br><Br><Br>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<Title> Tango Device Server User's Guide </Title>
<META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (X11; I; HP-UX B.10.20 9000/735) [Netscape]">
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#FF0000" ALINK="#FF0000">
<P><!-------TITLE------></P>
<Center>
<Br>
<HR WIDTH="100%"></H5>
<H3>(c) SOLEIL : Groupe ICA Contrôle et Acquisitions </H33>
</Center>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<Title> Tango Device Server User's Guide </Title>
<META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (X11; I; HP-UX B.10.20 9000/735) [Netscape]">
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#FF0000" ALINK="#FF0000">
<P><!-------TITLE------></P>
<table width="100%" height="20%"><tr>
<td align=LEFT>
<FONT COLOR="#0000FF"><FONT SIZE=+4>Synchrotron </FONT></FONT>
<FONT COLOR="#0000FF"><FONT SIZE=+4>Soleil</FONT></FONT>
<H5>Saint-Aubin - BP 48 91192 GIF-sur-YVETTE CEDEX<BR>
</td><td>
<A href="http://www.synchrotron-soleil.fr/">
<IMG SRC="http://controle/images/logo-150.gif"
ALT="SOLEIL Logo" ALIGN=RIGHT border="0"></A>
</td></tr></table>
<HR WIDTH="100%"></H5>
<Br>
<center>
<h1>
Continuous Anolog Output<Br>
Device Description
</h1>
<Br>
<b>
Revision: - Author:
</b>
</center>
<Center>
<Br>
<Br>
<Br>
<Br>
<Br>
<Br>
This Page Must Be Filled by <Br>
The Programmer
</Center>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<Title> Tango Device Server User's Guide </Title>
<META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (X11; I; HP-UX B.10.20 9000/735) [Netscape]">
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#FF0000" ALINK="#FF0000">
<P><!-------TITLE------></P>
<Center>
<Br>
<HR WIDTH="100%"></H5>
<H3>(c) SOLEIL : Groupe ICA Contrle et Acquisitions </H33>
</Center>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<Title> Tango Device Server User's Guide </Title>
<META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (X11; I; HP-UX B.10.20 9000/735) [Netscape]">
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#FF0000" ALINK="#FF0000">
<P><!-------TITLE------></P>
<table width="100%" height="20%"><tr>
<td align=LEFT>
<FONT COLOR="#0000FF"><FONT SIZE=+4>Synchrotron </FONT></FONT>
<FONT COLOR="#0000FF"><FONT SIZE=+4>Soleil</FONT></FONT>
<H5>Saint-Aubin - BP 48 91192 GIF-sur-YVETTE CEDEX<BR>
</td><td>
<A href="http://www.synchrotron-soleil.fr/">
<IMG SRC="http://controle/images/logo-150.gif"
ALT="SOLEIL Logo" ALIGN=RIGHT border="0"></A>
</td></tr></table>
<HR WIDTH="100%"></H5>
<Br>
<center>
<h1>
Continuous Anolog Output<Br>
Device Commands Description
</h1>
<Br>
<b>
Revision: - Author:
</b>
</center>
<Br>
<Br>
<Br>
<A NAME="Init"><!-- --></A>
<A NAME="Init"><!-- --></A>
<h2>1 - Init</h2>
<ul>
<Li><Strong>Description: </Strong> This commands re-initialise a device keeping the same network connection.<Br>
After an Init command executed on a device, it is not necessary for client to re-connect to the device.<Br>
This command first calls the device <i> delete_device() </i>method and then execute its <i> init_device()</i> method.<Br>
For C++ device server, all the memory allocated in the <i> nit_device() </i> method must be freed in the <i> delete_device() </i> method.<Br>
The language device desctructor automatically calls the <i> delete_device() </i> method.<Br>&nbsp
<Li><Strong>Argin:<Br>DEV_VOID</Strong>
: none.<Br>&nbsp
<Li><Strong>Argout:<Br>DEV_VOID</Strong>
: none.<Br>&nbsp
<Li><Strong>Command allowed for: </Strong><Ul>
<Li>Tango::UNKNOWN<Li>Tango::STANDBY<Li>Tango::RUNNING</Ul>
<Br>&nbsp
</ul><Br>
<Br>
<A NAME="State"><!-- --></A>
<A NAME="State"><!-- --></A>
<h2>2 - State</h2>
<ul>
<Li><Strong>Description: </Strong> This command gets the device state (stored in its <i>device_state</i> data member) and returns it to the caller.<Br>&nbsp
<Li><Strong>Argin:<Br>DEV_VOID</Strong>
: none.<Br>&nbsp
<Li><Strong>Argout:<Br>DEV_STATE</Strong>
: State Code<Br>&nbsp
<Li><Strong>Command allowed for: </Strong><Ul>
<Li>Tango::UNKNOWN<Li>Tango::STANDBY<Li>Tango::RUNNING</Ul>
<Br>&nbsp
</ul><Br>
<Br>
<A NAME="Status"><!-- --></A>
<A NAME="Status"><!-- --></A>
<h2>3 - Status</h2>
<ul>
<Li><Strong>Description: </Strong> This command gets the device status (stored in its <i>device_status</i> data member) and returns it to the caller.<Br>&nbsp
<Li><Strong>Argin:<Br>DEV_VOID</Strong>
: none.<Br>&nbsp
<Li><Strong>Argout:<Br>CONST_DEV_STRING</Strong>
: Status descrition<Br>&nbsp
<Li><Strong>Command allowed for: </Strong><Ul>
<Li>Tango::UNKNOWN<Li>Tango::STANDBY<Li>Tango::RUNNING</Ul>
<Br>&nbsp
</ul><Br>
<Br>
<A NAME="Start"><!-- --></A>
<A NAME="Start"><!-- --></A>
<h2>4 - Start</h2>
<ul>
<Li><Strong>Description: </Strong> start the generation.<Br>&nbsp
<Li><Strong>Argin:<Br>DEV_VOID</Strong>
: <Br>&nbsp
<Li><Strong>Argout:<Br>DEV_VOID</Strong>
: <Br>&nbsp
<Li><Strong>Command allowed for: </Strong><Ul>
<Li>Tango::UNKNOWN<Li>Tango::STANDBY<Li>Tango::RUNNING</Ul>
<Br>&nbsp
</ul><Br>
<Br>
<A NAME="Stop"><!-- --></A>
<A NAME="Stop"><!-- --></A>
<h2>5 - Stop</h2>
<ul>
<Li><Strong>Description: </Strong> stop the generation.<Br>&nbsp
<Li><Strong>Argin:<Br>DEV_VOID</Strong>
: <Br>&nbsp
<Li><Strong>Argout:<Br>DEV_VOID</Strong>
: <Br>&nbsp
<Li><Strong>Command allowed for: </Strong><Ul>
<Li>Tango::UNKNOWN<Li>Tango::STANDBY<Li>Tango::RUNNING</Ul>
<Br>&nbsp
</ul><Br>
<Br>
<A NAME="SetAOScaledData"><!-- --></A>
<A NAME="SetAOScaledData"><!-- --></A>
<h2>6 - SetAOScaledData</h2>
<ul>
<Li><Strong>Description: </Strong> Give one period of the signal to generated of a specified channel in volts.<Br>&nbsp
<Li><Strong>Argin:<Br>DEVVAR_DOUBLESTRINGARRAY</Strong>
: The channel number (string). The output data in volts (double)<Br>&nbsp
<Li><Strong>Argout:<Br>DEV_VOID</Strong>
: <Br>&nbsp
<Li><Strong>Command allowed for: </Strong><Ul>
<Li>Tango::UNKNOWN<Li>Tango::STANDBY<Li>Tango::RUNNING</Ul>
<Br>&nbsp
</ul><Br>
<Br>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<Title> Tango Device Server User's Guide </Title>
<META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (X11; I; HP-UX B.10.20 9000/735) [Netscape]">
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#FF0000" ALINK="#FF0000">
<P><!-------TITLE------></P>
<Center>
<Br>
<HR WIDTH="100%"></H5>
<H3>(c) SOLEIL : Groupe ICA Contrle et Acquisitions </H33>
</Center>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<Title> Tango Device Server User's Guide </Title>
<META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (X11; I; HP-UX B.10.20 9000/735) [Netscape]">
</HEAD>
<FRAMESET cols="20%,80%">
<FRAME src="DevCommandsList.html" name="DevCommandsList">
<FRAME src="DevCommands.html" name="DevCommands">
</FRAMESET>
<NOFRAMES>
<H2>
Frame Alert</H2>
<P>
This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
<BR>
Link to <A HREF="DevCommands.html">Non-frame version.</A></NOFRAMES>
</HTML>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<HTML><HEAD>
<TITLE>Commands
</TITLE></HEAD>
<BODY BGCOLOR="white">
<FONT size="+1" ID="FrameHeadingFont">
<B>Commands:</B></FONT>
<Br>
<Br>
<Br>
<A Href="DevCommands.html#Init" TARGET="DevCommands"> Init</a><Br>
<A Href="DevCommands.html#State" TARGET="DevCommands"> State</a><Br>
<A Href="DevCommands.html#Status" TARGET="DevCommands"> Status</a><Br>
<A Href="DevCommands.html#Start" TARGET="DevCommands"> Start</a><Br>
<A Href="DevCommands.html#Stop" TARGET="DevCommands"> Stop</a><Br>
<A Href="DevCommands.html#SetAOScaledData" TARGET="DevCommands"> SetAOScaledData</a><Br>
</BODY>
</HTML>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<Title> Tango Device Server User's Guide </Title>
<META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (X11; I; HP-UX B.10.20 9000/735) [Netscape]">
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#FF0000" ALINK="#FF0000">
<P><!-------TITLE------></P>
<table width="100%" height="20%"><tr>
<td align=LEFT>
<FONT COLOR="#0000FF"><FONT SIZE=+4>Synchrotron </FONT></FONT>
<FONT COLOR="#0000FF"><FONT SIZE=+4>Soleil</FONT></FONT>
<H5>Saint-Aubin - BP 48 91192 GIF-sur-YVETTE CEDEX<BR>
</td><td>
<A href="http://www.synchrotron-soleil.fr/">
<IMG SRC="http://controle/images/logo-150.gif"
ALT="SOLEIL Logo" ALIGN=RIGHT border="0"></A>
</td></tr></table>
<HR WIDTH="100%"></H5>
<Br>
<center>
<h1>
Continuous Anolog Output<Br>
Device Commands Description
</h1>
<Br>
<b>
Revision: - Author:
</b>
</center>
<Center>
<Br><Br>
<A Href="DevCommandsFrame.html"> More Details on commands.... </a><Br>
<Br> <Br>
<Table Border=2 Cellpadding=3 CELLSPACING=0 WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<Td COLSPAN=3> <Font Size=+2><Center><b>Device Commands for Operator Level</b></td></Font></Center>
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<Td><Center><b>Command name</b></td></Center>
<Td><Center><b>Argument In</b></td></Center>
<Td><Center><b>Argument Out</b></td></Center>
<Tr><Td>Init</Td>
<Td>DEV_VOID</Td>
<Td>DEV_VOID</Td>
<Tr><Td>State</Td>
<Td>DEV_VOID</Td>
<Td>DEV_STATE</Td>
<Tr><Td>Status</Td>
<Td>DEV_VOID</Td>
<Td>CONST_DEV_STRING</Td>
<Tr><Td>Start</Td>
<Td>DEV_VOID</Td>
<Td>DEV_VOID</Td>
<Tr><Td>Stop</Td>
<Td>DEV_VOID</Td>
<Td>DEV_VOID</Td>
<Tr><Td>SetAOScaledData</Td>
<Td>DEVVAR_DOUBLESTRINGARRAY</Td>
<Td>DEV_VOID</Td>
</Table></Center>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<Title> Tango Device Server User's Guide </Title>
<META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (X11; I; HP-UX B.10.20 9000/735) [Netscape]">
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#FF0000" ALINK="#FF0000">
<P><!-------TITLE------></P>
<Center>
<Br>
<HR WIDTH="100%"></H5>
<H3>(c) SOLEIL : Groupe ICA Contrle et Acquisitions </H33>
</Center>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<Title> Tango Device Server User's Guide </Title>
<META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (X11; I; HP-UX B.10.20 9000/735) [Netscape]">
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#FF0000" ALINK="#FF0000">
<P><!-------TITLE------></P>
<table width="100%" height="20%"><tr>
<td align=LEFT>
<FONT COLOR="#0000FF"><FONT SIZE=+4>Synchrotron </FONT></FONT>
<FONT COLOR="#0000FF"><FONT SIZE=+4>Soleil</FONT></FONT>
<H5>Saint-Aubin - BP 48 91192 GIF-sur-YVETTE CEDEX<BR>
</td><td>
<A href="http://www.synchrotron-soleil.fr/">
<IMG SRC="http://controle/images/logo-150.gif"
ALT="SOLEIL Logo" ALIGN=RIGHT border="0"></A>
</td></tr></table>
<HR WIDTH="100%"></H5>
<Br>
<center>
<h1>
Continuous Anolog Output<Br>
Properties Description
</h1>
<Br>
<b>
Revision: - Author:
</b>
</center>
<Br> <Br> <Br>
<Center>
<Br> <Br> <Br>
<Table Border=2 Cellpadding=3 CELLSPACING=0 WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<Td COLSPAN=3> <Font Size=+2><Center><b>Device Properties</b></td></Font></Center>
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<Td><Center><b>Property name</b></td></Center>
<Td><Center><b>Property type</b></td></Center>
<Td><Center><b>Description</b></td></Center>
<Tr><Td>BoardNum</Td>
<Td>Tango::DEV_USHORT</Td>
<Td>The number of the board in the chassis cPCI.</Td></Tr>
<Tr><Td>Frequency</Td>
<Td>Tango::DEV_DOUBLE</Td>
<Td>The output frequency (the rate the samples are outputed).</Td></Tr>
<Tr><Td>StartTrigger</Td>
<Td>Tango::DEV_SHORT</Td>
<Td>1 if using a start trigger, 0 otherwise.</Td></Tr>
<Tr><Td>StopTrigger</Td>
<Td>Tango::DEV_SHORT</Td>
<Td>1 if using a stop trigger, 0 otherwise.</Td></Tr>
<Tr><Td>StartTriggerSource</Td>
<Td>Tango::DEV_USHORT</Td>
<Td>The start trigger source. Analog trigger DTRIG or ATRIG.</Td></Tr>
<Tr><Td>StopTriggerSource</Td>
<Td>Tango::DEV_USHORT</Td>
<Td>The stop trigger source. anolog trigger ATRIG or pin AFI0 of AFI1.</Td></Tr>
<Tr><Td>ATRIGSelection</Td>
<Td>Tango::DEV_USHORT</Td>
<Td>select the type of analog trigger. Can be BELOW (trigger occurs below ATRIGLevel)
or can be ABOVE (trigger occurs above ATRIGLevel).</Td></Tr>
<Tr><Td>ATRIGLevel</Td>
<Td>Tango::DEV_DOUBLE</Td>
<Td>The analog trigger level in volts.</Td></Tr>
<Tr><Td>DTRIGPolarity</Td>
<Td>Tango::DEV_USHORT</Td>
<Td>The edges on which the trigger are detected. Can be RISING or FALLING.</Td></Tr>
<Tr><Td>AORefA</Td>
<Td>Tango::DEV_DOUBLE</Td>
<Td>The value of the reference voltage gave on pin AORefA.</Td></Tr>
<Tr><Td>AORefB</Td>
<Td>Tango::DEV_DOUBLE</Td>
<Td>The value of the reference voltage gave on pin AORefB.</Td></Tr>
<Tr><Td>Polarity</Td>
<Td>Tango::DEV_USHORT</Td>
<Td>BP for unipolar outputs or UP for bipolar outputs.</Td></Tr>
<Tr><Td>AORefSource</Td>
<Td>Tango::DEV_USHORT</Td>
<Td>Select the internal reference (10.0 volts) with INTERN or the external references
AORefA and AORefB with EXTERN.</Td></Tr>
<Tr><Td>Channel0Enable</Td>
<Td>Tango::DEV_SHORT</Td>
<Td>1 if enable channel 0, 0 otherwise.</Td></Tr>
<Tr><Td>Channel1Enable</Td>
<Td>Tango::DEV_SHORT</Td>
<Td>1 if enable channel 1, 0 otherwise.</Td></Tr>
<Tr><Td>Channel2Enable</Td>
<Td>Tango::DEV_SHORT</Td>
<Td>1 if enable channel 2, 0 otherwise.</Td></Tr>
<Tr><Td>Channel3Enable</Td>
<Td>Tango::DEV_SHORT</Td>
<Td>1 if enable channel 3, 0 otherwise.</Td></Tr>
<Tr><Td>Channel4Enable</Td>
<Td>Tango::DEV_SHORT</Td>
<Td>1 if enable channel 4, 0 otherwise.</Td></Tr>
<Tr><Td>Channel5Enable</Td>
<Td>Tango::DEV_SHORT</Td>
<Td>1 if enable channel 5, 0 otherwise.</Td></Tr>
<Tr><Td>Channel6Enable</Td>
<Td>Tango::DEV_SHORT</Td>
<Td>1 if enable channel 6, 0 otherwise.</Td></Tr>
<Tr><Td>Channel7Enable</Td>
<Td>Tango::DEV_SHORT</Td>
<Td>1 if enable channel 7, 0 otherwise.</Td></Tr>
<Tr><Td>BufferDepth</Td>
<Td>Tango::DEV_USHORT</Td>
<Td>The buffer depth for <b>one channel</b>.</Td></Tr>
<Tr><Td>Channel0Waveform</Td>
<Td>Array of double</Td>
<Td>The waveform for channel 0 (attribute persistency).</Td></Tr>
<Tr><Td>Channel1Waveform</Td>
<Td>Array of double</Td>
<Td>The waveform for channel 1 (attribute persistency).</Td></Tr>
<Tr><Td>Channel2Waveform</Td>
<Td>Array of double</Td>
<Td>The waveform for channel 2 (attribute persistency).</Td></Tr>
<Tr><Td>Channel3Waveform</Td>
<Td>Array of double</Td>
<Td>The waveform for channel 3 (attribute persistency).</Td></Tr>
<Tr><Td>Channel4Waveform</Td>
<Td>Array of double</Td>
<Td>The waveform for channel 4 (attribute persistency).</Td></Tr>
<Tr><Td>Channel5Waveform</Td>
<Td>Array of double</Td>
<Td>The waveform for channel 5 (attribute persistency).</Td></Tr>
<Tr><Td>Channel6Waveform</Td>
<Td>Array of double</Td>
<Td>The waveform for channel 6 (attribute persistency).</Td></Tr>
<Tr><Td>Channel7Waveform</Td>
<Td>Array of double</Td>
<Td>The waveform for channel 7 (attribute persistency).</Td></Tr>
</Table>
<Br><Br><Br>
<Center><b>
There is no Class properties.<Br><Br>
</Center></b>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<Title> Tango Device Server User's Guide </Title>
<META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (X11; I; HP-UX B.10.20 9000/735) [Netscape]">
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#FF0000" ALINK="#FF0000">
<P><!-------TITLE------></P>
<Center>
<Br>
<HR WIDTH="100%"></H5>
<H3>(c) SOLEIL : Groupe ICA Contrle et Acquisitions </H33>
</Center>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<Title> Tango Device Server User's Guide </Title>
<META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (X11; I; HP-UX B.10.20 9000/735) [Netscape]">
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#FF0000" ALINK="#FF0000">
<P><!-------TITLE------></P>
<table width="100%" height="20%"><tr>
<td align=LEFT>
<FONT COLOR="#0000FF"><FONT SIZE=+4>Synchrotron </FONT></FONT>
<FONT COLOR="#0000FF"><FONT SIZE=+4>Soleil</FONT></FONT>
<H5>Saint-Aubin - BP 48 91192 GIF-sur-YVETTE CEDEX<BR>
</td><td>
<A href="http://www.synchrotron-soleil.fr/">
<IMG SRC="http://controle/images/logo-150.gif"
ALT="SOLEIL Logo" ALIGN=RIGHT border="0"></A>
</td></tr></table>
<HR WIDTH="100%"></H5>
<Br>
<center>
<h1>
Continuous Anolog Output<Br>
Device States Description
</h1>
<Br>
<b>
Revision: - Author:
</b>
</center>
<Center>
<Br> <Br> <Br>
<Table Border=2 Cellpadding=3 CELLSPACING=0 WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<Td COLSPAN=2> <Font Size=+2><Center><b>States</b></td></Font></Center>
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<Td><Center><b>Names</b></td></Center>
<Td><Center><b>Descriptions</b></td></Center>
<Tr><Td>UNKNOWN</Td>
<Td></Td></Tr>
<Tr><Td>STANDBY</Td>
<Td></Td></Tr>
<Tr><Td>RUNNING</Td>
<Td></Td></Tr>
</Table>
</Center>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<Title> Tango Device Server User's Guide </Title>
<META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (X11; I; HP-UX B.10.20 9000/735) [Netscape]">
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#FF0000" ALINK="#FF0000">
<P><!-------TITLE------></P>
<Center>
<Br>
<HR WIDTH="100%"></H5>
<H3>(c) SOLEIL : Groupe ICA Contrle et Acquisitions </H33>
</Center>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<Title> Tango Device Server User's Guide </Title>
<META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (X11; I; HP-UX B.10.20 9000/735) [Netscape]">
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#FF0000" ALINK="#FF0000">
<P><!-------TITLE------></P>
<table width="100%" height="20%"><tr>
<td align=LEFT>
<FONT COLOR="#0000FF"><FONT SIZE=+4>Synchrotron </FONT></FONT>
<FONT COLOR="#0000FF"><FONT SIZE=+4>Soleil</FONT></FONT>
<H5>Saint-Aubin - BP 48 91192 GIF-sur-YVETTE CEDEX<BR>
</td><td>
<A href="http://www.synchrotron-soleil.fr/">
<IMG SRC="http://controle/images/logo-150.gif"
ALT="SOLEIL Logo" ALIGN=RIGHT border="0"></A>
</td></tr></table>
<HR WIDTH="100%"></H5>
<Br>
<center>
<h1>
Continuous Anolog Output<Br>
Device Server User's Guide
</h1>
<Br>
<b>
Revision: - Author:
</b>
</center>
<Br>
<Br>
<Br>
<Br>
<Br>
<Br>
<h2>Introduction:</h2>
Perform continuous anolog ouput (waveform generation) on the selected outputs.<Br>
<Br>
<Br>
<h2>Description:</h2>
<ul>
<li> <a href=Description.html> Device description.</a>
<li> <a href=Properties.html> Properties description</a>
<li> <a href=TangoDevStates.html> States description</a>
<li> <a href=DevCommandsFrame.html> Commands description</a>
<li> <a href=Attributes.html> Attributes description</a>
</ul>
<Br>
<Br>
<Br>
<h2>Extented User's guide (available only for complex DeviceServers):</h2>
<ul>
<li> <a href="../DeviceServerUsersGuide.doc"> In French word format.</a>
<li> <a href="../DeviceServerUsersGuide.pdf"> In French PDF format.</a>
<li> <a href="../DeviceServerUsersGuide_en.doc"> In English word format.</a>
<li> <a href="../DeviceServerUsersGuide_en.pdf"> In English PDF format.</a>
</ul>
<Br>
<Br>
<Br>
<h2>Conclusion:</h2>
The device server is ready for distribution application programmers.<Br>
The author will be interested inany feedback which arise from their usage of this device server.
<Br>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<Title> Tango Device Server User's Guide </Title>
<META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (X11; I; HP-UX B.10.20 9000/735) [Netscape]">
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#FF0000" ALINK="#FF0000">
<P><!-------TITLE------></P>
<Center>
<Br>
<HR WIDTH="100%"></H5>
<H3>(c) SOLEIL : Groupe ICA Contrle et Acquisitions </H33>
</Center>
</body>
</html>
from PyTango import*
import sys
import time
import math
try:
#TODO: put the desired device proxy
contAO = DeviceProxy("generic/acq/ContinuousAO")
###############load a sine signal on channel 4####################
#TODO: put the correct BufferDepth (same as in the property of the device)
BufferDepth = 1000
#TODO: put the desired voltage in volts (verify the the input range is coherent with this value)
# The input range is gave by properties Polarity, AORefA, AORefB, AORefSource
max_voltage = 5.0
i = 1
ao_data = [math.sin(0 * 2. * 3.14159 / BufferDepth) * max_voltage]
while i<BufferDepth:
ao_data[i:i] = [math.sin(i * 2. * 3.14159 / BufferDepth) * max_voltage]
i = i + 1
print ao_data
#put ao_data in the argin of the command contAO with the channel number
argin =(ao_data,["4"])
#load the waveform on the device
contAO.SetAOScaledData(argin)
except:
exctype , value = sys.exc_info()[:2]
print "Failed with exception ", exctype
for err in value :
print "---ERROR ELEMENT-------"
print "reason:" , err["reason"]
print "description:" , err["desc"]
print "origin:" , err["origin"]
print "severity:" , err["severity"]
from PyTango import*
import sys
import time
try:
#TODO: put the desired device proxy
contAO = DeviceProxy("generic/acq/ContinuousAO")
###############load a square signal on channel 0####################
#TODO: put the correct BufferDepth (same as in the property of the device)
BufferDepth = 1000
#TODO: put the desired voltage in volts (verify the the input range is coherent with this value)
# The input range is gave by properties Polarity, AORefA, AORefB, AORefSource
max_voltage = 5.0
i = 1
ao_data = [-max_voltage]
while i<BufferDepth/2:
ao_data[i:i] = [-max_voltage]
i = i + 1
while i<BufferDepth:
ao_data[i:i] = [max_voltage]
i = i + 1
#print ao_data
#put ao_data in the argin of the command contAO with the channel number
argin =(ao_data,["0"])
#load the waveform on the device
contAO.SetAOScaledData(argin)
except:
exctype , value = sys.exc_info()[:2]
print "Failed with exception ", exctype
for err in value :
print "---ERROR ELEMENT-------"
print "reason:" , err["reason"]
print "description:" , err["desc"]
print "origin:" , err["origin"]
print "severity:" , err["severity"]
//============================================================
//DEPENDENCIES
//============================================================
#include <asl/ASLExceptionsHandler.h>
#include "ADLinkContinuousAO.h"
//============================================================
//ADLinkContinuousAO::ADLinkContinuousAO
//============================================================
ADLinkContinuousAO::ADLinkContinuousAO (Tango::DeviceImpl* dev)
: Tango::LogAdapter(dev),
asl::ContinuousAO (),
err_ctr(0)
{
}
//============================================================
//ADLinkContinuousAO::~ADLinkContinuousAO
//============================================================
ADLinkContinuousAO::~ADLinkContinuousAO (void)
{
}
//============================================================
//ADLinkContinuousAO::handle_error
//============================================================
void ADLinkContinuousAO::handle_error (const asl::DAQException& de)
{
cout<<"error occured during acquisition"<<endl;
this->lock_data();
err_ctr++;
this->unlock_data();
_ASL_TO_TANGO_EXCEPTION(de, df);
ERROR_STREAM<<"error occured during acquisition"<<endl;
ERROR_STREAM<<df<<endl;
}
#ifndef _ADLinkContinuousAO_H
#define _ADLinkContinuousAO_H
//============================================================
//DEPENDENCIES
//============================================================
#include <asl/ContinuousAO.h>
#include <Tango.h>
class ADLinkContinuousAO: public asl::ContinuousAO, public Tango::LogAdapter
{
public:
ADLinkContinuousAO (Tango::DeviceImpl* dev);
virtual ~ADLinkContinuousAO (void) ;
/**
* Receive errors ocurring during the waveform generation.
* @param de The error
*/
virtual void handle_error (const asl::DAQException& de);
/**
* Get the mutex
*/
inline void lock_data(void)
{
this->data_lock_.acquire();
};
/**
* Release the mutex
*/
inline void unlock_data(void)
{
this->data_lock_.release();
};
unsigned long err_ctr;
private:
ACE_Thread_Mutex data_lock_;
};
#endif // _ADLinkContinuousAO_H
\ No newline at end of file
static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/InputOutput/ADLINK/ContinuousAO/src/ClassFactory.cpp,v 1.1.1.1 2004-12-06 10:20:44 syldup Exp $";
//+=============================================================================
//
// file : ClassFactory.cpp
//
// description : C++ source for the class_factory method of the DServer
// device class. This method is responsible to create
// all class singletin for a device server. It is called
// at device server startup
//
// project : TANGO Device Server
//
// $Author: syldup $
//
// $Revision: 1.1.1.1 $
//
// $Log: not supported by cvs2svn $
//
// copyleft : Synchrotron SOLEIL
// L'Orme des Merisiers
// Saint-Aubin - BP 48
//
//-=============================================================================
//
// This file is generated by POGO
// (Program Obviously used to Generate tango Object)
//
// (c) - Software Engineering Group - ESRF
//=============================================================================
#include <tango.h>
#include <ContinuousAOClass.h>
/**
* Create ContinuousAOClass singleton and store it in DServer object.
*
* @author $Author: syldup $
* @version $Revision: 1.1.1.1 $ $
*/
void Tango::DServer::class_factory()
{
add_class(ContinuousAO::ContinuousAOClass::init("ContinuousAO"));
}
This diff is collapsed.
//=============================================================================
//
// file : ContinuousAO.h
//
// description : Include for the ContinuousAO class.
//
// project : Continuous Anolog Output
//
// $Author: syldup $
//
// $Revision: 1.1.1.1 $
//
// $Log: not supported by cvs2svn $
//
// copyleft : Synchrotron SOLEIL
// L'Orme des Merisiers
// Saint-Aubin - BP 48
//
//=============================================================================
//
// This file is generated by POGO
// (Program Obviously used to Generate tango Object)
//
// (c) - Software Engineering Group - ESRF
//=============================================================================
#ifndef _CONTINUOUSAO_H
#define _CONTINUOUSAO_H
#include <ADLinkContinuousAO.h>
#include <tango.h>
//using namespace Tango;
/**
* @author $Author: syldup $
* @version $Revision: 1.1.1.1 $ $
*/
// Add your own constants definitions here.
//-----------------------------------------------
namespace ContinuousAO
{
/**
* Class Description:
* Perform continuous anolog ouput (waveform generation) on the selected outputs.
*/
/*
* Device States Description:
* Tango::UNKNOWN :
* Tango::STANDBY :
* Tango::RUNNING :
*/
class ContinuousAO: public Tango::Device_2Impl
{
public :
// Add your own data members here
//-----------------------------------------
// Here is the Start of the automatic code generation part
//-------------------------------------------------------------
/**
* @name attributes
* Attributs member data.
*/
//@{
Tango::DevDouble *attr_channel0_read;
Tango::DevDouble *attr_channel1_read;
Tango::DevDouble *attr_channel2_read;
Tango::DevDouble *attr_channel3_read;
Tango::DevDouble *attr_channel4_read;
Tango::DevDouble *attr_channel5_read;
Tango::DevDouble *attr_channel6_read;
Tango::DevDouble *attr_channel7_read;
Tango::DevDouble *attr_errorCounter_read;
Tango::DevShort *attr_useBoardFifo_read;
//@}
/**
* @name Device properties
* Device properties member data.
*/
//@{
/**
* The number of the board in the chassis cPCI.
*/
Tango::DevUShort boardNum;
/**
* The output frequency (the rate the samples are outputed).
*/
Tango::DevDouble frequency;
/**
* 1 if using a start trigger, 0 otherwise.
*/
Tango::DevShort startTrigger;
/**
* 1 if using a stop trigger, 0 otherwise.
*/
Tango::DevShort stopTrigger;
/**
* The start trigger source. Analog trigger DTRIG or ATRIG.
*/
Tango::DevUShort startTriggerSource;
/**
* The stop trigger source. anolog trigger ATRIG or pin AFI0 of AFI1.
*/
Tango::DevUShort stopTriggerSource;
/**
* select the type of analog trigger. Can be BELOW (trigger occurs below ATRIGLevel)
* or can be ABOVE (trigger occurs above ATRIGLevel).
*/
Tango::DevUShort aTRIGSelection;
/**
* The analog trigger level in volts.
*/
Tango::DevDouble aTRIGLevel;
/**
* The edges on which the trigger are detected. Can be RISING or FALLING.
*/
Tango::DevUShort dTRIGPolarity;
/**
* The value of the reference voltage gave on pin AORefA.
*/
Tango::DevDouble aORefA;
/**
* The value of the reference voltage gave on pin AORefB.
*/
Tango::DevDouble aORefB;
/**
* BP for unipolar outputs or UP for bipolar outputs.
*/
Tango::DevUShort polarity;
/**
* Select the internal reference (10.0 volts) with INTERN or the external references
* AORefA and AORefB with EXTERN.
*/
Tango::DevUShort aORefSource;
/**
* 1 if enable channel 0, 0 otherwise.
*/
Tango::DevShort channel0Enable;
/**
* 1 if enable channel 1, 0 otherwise.
*/
Tango::DevShort channel1Enable;
/**
* 1 if enable channel 2, 0 otherwise.
*/
Tango::DevShort channel2Enable;
/**
* 1 if enable channel 3, 0 otherwise.
*/
Tango::DevShort channel3Enable;
/**
* 1 if enable channel 4, 0 otherwise.
*/
Tango::DevShort channel4Enable;
/**
* 1 if enable channel 5, 0 otherwise.
*/
Tango::DevShort channel5Enable;
/**
* 1 if enable channel 6, 0 otherwise.
*/
Tango::DevShort channel6Enable;
/**
* 1 if enable channel 7, 0 otherwise.
*/
Tango::DevShort channel7Enable;
/**
* The buffer depth for <b>one channel</b>.
*/
Tango::DevUShort bufferDepth;
/**
* The waveform for channel 0 (attribute persistency).
*/
vector<double> channel0Waveform;
/**
* The waveform for channel 1 (attribute persistency).
*/
vector<double> channel1Waveform;
/**
* The waveform for channel 2 (attribute persistency).
*/
vector<double> channel2Waveform;
/**
* The waveform for channel 3 (attribute persistency).
*/
vector<double> channel3Waveform;
/**
* The waveform for channel 4 (attribute persistency).
*/
vector<double> channel4Waveform;
/**
* The waveform for channel 5 (attribute persistency).
*/
vector<double> channel5Waveform;
/**
* The waveform for channel 6 (attribute persistency).
*/
vector<double> channel6Waveform;
/**
* The waveform for channel 7 (attribute persistency).
*/
vector<double> channel7Waveform;
//@}
/**@name Constructors
* Miscellaneous constructors */
//@{
/**
* Constructs a newly allocated Command object.
*
* @param cl Class.
* @param s Device Name
*/
ContinuousAO(Tango::DeviceClass *,string &);
/**
* Constructs a newly allocated Command object.
*
* @param cl Class.
* @param s Device Name
*/
ContinuousAO(Tango::DeviceClass *,const char *);
/**
* Constructs a newly allocated Command object.
*
* @param cl Class.
* @param s Device name
* @param d Device description.
*/
ContinuousAO(Tango::DeviceClass *,const char *,const char *);
//@}
/**@name Destructor
* Only one desctructor is defined for this class */
//@{
/**
* The object desctructor.
*/
~ContinuousAO() { delete_device(); };
/**
* will be called at device destruction or at init command.
*/
void delete_device();
//@}
/**@name Miscellaneous methods */
//@{
/**
* Initialize the device
*/
virtual void init_device();
/**
* Always executed method befor execution command method.
*/
virtual void always_executed_hook();
//@}
/**
* @name ContinuousAO methods prototypes
*/
//@{
/**
* Hardware acquisition for attributes.
*/
virtual void read_attr_hardware(vector<long> &attr_list);
/**
* Extract real attribute values from hardware acquisition result.
*/
virtual void read_attr(Tango::Attribute &attr);
/**
* start the generation.
* @exception DevFailed
*/
void start();
/**
* stop the generation.
* @exception DevFailed
*/
void stop();
/**
* Give one period of the signal to generated of a specified channel in volts.
* @param argin The channel number (string). The output data in volts (double)
* @exception DevFailed
*/
void set_aoscaled_data(const Tango::DevVarDoubleStringArray *);
/**
* Read the device properties from database
*/
void get_device_property();
//@}
// Here is the end of the automatic code generation part
//-------------------------------------------------------------
ADLinkContinuousAO* ao;
// asl::ContinuousAOConfig* config;
void set_internal_state(void);
// save a channel waveform in the database
void ContinuousAO::save_waveform(double* waveform, string wfm_channel);
double* ch0;
double* ch1;
double* ch2;
double* ch3;
double* ch4;
double* ch5;
double* ch6;
double* ch7;
double err_ctr;
short use_fifo;
protected :
// Add your own data members here
//-----------------------------------------
};
} // namespace
#endif // _CONTINUOUSAO_H
static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/InputOutput/ADLINK/ContinuousAO/src/ContinuousAOClass.cpp,v 1.1.1.1 2004-12-06 10:20:44 syldup Exp $";
static const char *TagName = "$Name: not supported by cvs2svn $";
static const char *FileName= "$Source: /users/chaize/newsvn/cvsroot/InputOutput/ADLINK/ContinuousAO/src/ContinuousAOClass.cpp,v $";
static const char *HttpServer= "http://controle/DeviceServer/doc/";
static const char *RCSfile = "$RCSfile: ContinuousAOClass.cpp,v $";
//+=============================================================================
//
// file : ContinuousAOClass.cpp
//
// description : C++ source for the ContinuousAOClass. A singleton
// class derived from DeviceClass. It implements the
// command list and all properties and methods required
// by the ContinuousAO once per process.
//
// project : TANGO Device Server
//
// $Author: syldup $
//
// $Revision: 1.1.1.1 $
//
// $Log: not supported by cvs2svn $
//
// copyleft : Synchrotron SOLEIL
// L'Orme des Merisiers
// Saint-Aubin - BP 48/
//-=============================================================================
//
// This file is generated by POGO
// (Program Obviously used to Generate tango Object)
//
// (c) - Software Engineering Group - ESRF
//=============================================================================
//#include <tango.h>
#include <ContinuousAO.h>
#include <ContinuousAOClass.h>
namespace ContinuousAO
{
//+----------------------------------------------------------------------------
//
// method : StartCmd::StartCmd()
//
// description : constructor for the command of the ContinuousAO.
//
// In : - name : The command name
// - in : The input parameter type
// - out : The output parameter type
// - in_desc : The input parameter description
// - out_desc : The output parameter description
//
//-----------------------------------------------------------------------------
StartCmd::StartCmd( const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out,
const char *in_desc,
const char *out_desc,
Tango::DispLevel level)
:Command(name,in,out,in_desc,out_desc, level)
{
}
//
// Constructor without in/out parameters description
//
StartCmd::StartCmd( const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out)
:Command(name,in,out)
{
}
//+----------------------------------------------------------------------------
//
// method : StartCmd::is_allowed()
//
// description : method to test whether command is allowed or not in this
// state. In this case, the command is allowed only if
// the device is in ON state
//
// in : - device : The device on which the command must be excuted
// - in_any : The command input data
//
// returns : boolean - true == is allowed , false == not allowed
//
//-----------------------------------------------------------------------------
bool StartCmd::is_allowed(Tango::DeviceImpl *device, const CORBA::Any &in_any)
{
// End of Generated Code
// Re-Start of Generated Code
return true;
}
//+----------------------------------------------------------------------------
//
// method : StartCmd::execute()
//
// description : method to trigger the execution of the command.
// PLEASE DO NOT MODIFY this method core without pogo
//
// in : - device : The device on which the command must be excuted
// - in_any : The command input data
//
// returns : The command output data (packed in the Any object)
//
//-----------------------------------------------------------------------------
CORBA::Any *StartCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any)
{
cout2 << "DevTemplateCmd::execute(): arrived" << endl;
((static_cast<ContinuousAO *>(device))->start());
return new CORBA::Any();
}
//+----------------------------------------------------------------------------
//
// method : StopCmd::StopCmd()
//
// description : constructor for the command of the ContinuousAO.
//
// In : - name : The command name
// - in : The input parameter type
// - out : The output parameter type
// - in_desc : The input parameter description
// - out_desc : The output parameter description
//
//-----------------------------------------------------------------------------
StopCmd::StopCmd( const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out,
const char *in_desc,
const char *out_desc,
Tango::DispLevel level)
:Command(name,in,out,in_desc,out_desc, level)
{
}
//
// Constructor without in/out parameters description
//
StopCmd::StopCmd( const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out)
:Command(name,in,out)
{
}
//+----------------------------------------------------------------------------
//
// method : StopCmd::is_allowed()
//
// description : method to test whether command is allowed or not in this
// state. In this case, the command is allowed only if
// the device is in ON state
//
// in : - device : The device on which the command must be excuted
// - in_any : The command input data
//
// returns : boolean - true == is allowed , false == not allowed
//
//-----------------------------------------------------------------------------
bool StopCmd::is_allowed(Tango::DeviceImpl *device, const CORBA::Any &in_any)
{
// End of Generated Code
// Re-Start of Generated Code
return true;
}
//+----------------------------------------------------------------------------
//
// method : StopCmd::execute()
//
// description : method to trigger the execution of the command.
// PLEASE DO NOT MODIFY this method core without pogo
//
// in : - device : The device on which the command must be excuted
// - in_any : The command input data
//
// returns : The command output data (packed in the Any object)
//
//-----------------------------------------------------------------------------
CORBA::Any *StopCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any)
{
cout2 << "DevTemplateCmd::execute(): arrived" << endl;
((static_cast<ContinuousAO *>(device))->stop());
return new CORBA::Any();
}
//+----------------------------------------------------------------------------
//
// method : SetAOScaledDataCmd::SetAOScaledDataCmd()
//
// description : constructor for the command of the ContinuousAO.
//
// In : - name : The command name
// - in : The input parameter type
// - out : The output parameter type
// - in_desc : The input parameter description
// - out_desc : The output parameter description
//
//-----------------------------------------------------------------------------
SetAOScaledDataCmd::SetAOScaledDataCmd( const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out,
const char *in_desc,
const char *out_desc,
Tango::DispLevel level)
:Command(name,in,out,in_desc,out_desc, level)
{
}
//
// Constructor without in/out parameters description
//
SetAOScaledDataCmd::SetAOScaledDataCmd( const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out)
:Command(name,in,out)
{
}
//+----------------------------------------------------------------------------
//
// method : SetAOScaledDataCmd::is_allowed()
//
// description : method to test whether command is allowed or not in this
// state. In this case, the command is allowed only if
// the device is in ON state
//
// in : - device : The device on which the command must be excuted
// - in_any : The command input data
//
// returns : boolean - true == is allowed , false == not allowed
//
//-----------------------------------------------------------------------------
bool SetAOScaledDataCmd::is_allowed(Tango::DeviceImpl *device, const CORBA::Any &in_any)
{
// End of Generated Code
// Re-Start of Generated Code
return true;
}
//+----------------------------------------------------------------------------
//
// method : SetAOScaledDataCmd::execute()
//
// description : method to trigger the execution of the command.
// PLEASE DO NOT MODIFY this method core without pogo
//
// in : - device : The device on which the command must be excuted
// - in_any : The command input data
//
// returns : The command output data (packed in the Any object)
//
//-----------------------------------------------------------------------------
CORBA::Any *SetAOScaledDataCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any)
{
cout2 << "DevTemplateCmd::execute(): arrived" << endl;
const Tango::DevVarDoubleStringArray *argin;
extract(in_any, argin);
((static_cast<ContinuousAO *>(device))->set_aoscaled_data(argin));
return new CORBA::Any();
}
//
//----------------------------------------------------------------
// Initialize pointer for singleton pattern
//----------------------------------------------------------------
//
ContinuousAOClass *ContinuousAOClass::_instance = NULL;
//+----------------------------------------------------------------------------
//
// method : ContinuousAOClass::ContinuousAOClass(string &s)
//
// description : constructor for the ContinuousAOClass
//
// in : - s : The class name
//
//-----------------------------------------------------------------------------
ContinuousAOClass::ContinuousAOClass(string &s):DeviceClass(s)
{
cout2 << "Entering ContinuousAOClass constructor" << endl;
write_class_property();
cout2 << "Leaving ContinuousAOClass constructor" << endl;
}
//+----------------------------------------------------------------------------
//
// method : ContinuousAOClass::~ContinuousAOClass()
//
// description : destructor for the ContinuousAOClass
//
//-----------------------------------------------------------------------------
ContinuousAOClass::~ContinuousAOClass()
{
_instance = NULL;
}
//+----------------------------------------------------------------------------
//
// method : ContinuousAOClass::instance
//
// description : Create the object if not already done. Otherwise, just
// return a pointer to the object
//
// in : - name : The class name
//
//-----------------------------------------------------------------------------
ContinuousAOClass *ContinuousAOClass::init(const char *name)
{
if (_instance == NULL)
{
try
{
string s(name);
_instance = new ContinuousAOClass(s);
}
catch (bad_alloc)
{
throw;
}
}
return _instance;
}
ContinuousAOClass *ContinuousAOClass::instance()
{
if (_instance == NULL)
{
cerr << "Class is not initialised !!" << endl;
exit(-1);
}
return _instance;
}
//+----------------------------------------------------------------------------
//
// method : ContinuousAOClass::command_factory
//
// description : Create the command object(s) and store them in the
// command list
//
//-----------------------------------------------------------------------------
void ContinuousAOClass::command_factory()
{
command_list.push_back(new StartCmd("Start",
Tango::DEV_VOID, Tango::DEV_VOID,
"",
"",
Tango::OPERATOR));
command_list.push_back(new StopCmd("Stop",
Tango::DEV_VOID, Tango::DEV_VOID,
"",
"",
Tango::OPERATOR));
command_list.push_back(new SetAOScaledDataCmd("SetAOScaledData",
Tango::DEVVAR_DOUBLESTRINGARRAY, Tango::DEV_VOID,
"The channel number ,in string). The output data in volts ,in double)",
"",
Tango::OPERATOR));
// add polling if any
for (unsigned int i=0 ; i<command_list.size(); i++)
{
}
}
//+----------------------------------------------------------------------------
//
// method : ContinuousAOClass::device_factory
//
// description : Create the device object(s) and store them in the
// device list
//
// in : Tango::DevVarStringArray *devlist_ptr : The device name list
//
//-----------------------------------------------------------------------------
void ContinuousAOClass::device_factory(const Tango::DevVarStringArray *devlist_ptr)
{
for (long i=0 ; i < devlist_ptr->length() ; i++)
{
cout4 << "Device name : " << (*devlist_ptr)[i].in() << endl;
// Create device and add it into the device list
//----------------------------------------------------
device_list.push_back(new ContinuousAO(this, (*devlist_ptr)[i]));
// Export device to the outside world
// Check before id database used.
//---------------------------------------------
if (Tango::Util::_UseDb == true)
export_device(device_list.back());
else
export_device(device_list.back(), (*devlist_ptr)[i]);
}
}
//+----------------------------------------------------------------------------
// Method: ContinuousAOClass::attribute_factory(vector<Tango::Attr *> &att_list)
//-----------------------------------------------------------------------------
void ContinuousAOClass::attribute_factory(vector<Tango::Attr *> &att_list)
{
// Attribute : channel0
Tango::SpectrumAttr *channel0 =
new Tango::SpectrumAttr("channel0", Tango::DEV_DOUBLE, 1000000);
Tango::UserDefaultAttrProp channel0_prop;
channel0_prop.set_label("channel0");
channel0_prop.set_unit("volts");
channel0->set_default_properties(channel0_prop);
att_list.push_back(channel0);
// Attribute : channel1
Tango::SpectrumAttr *channel1 =
new Tango::SpectrumAttr("channel1", Tango::DEV_DOUBLE, 100000);
Tango::UserDefaultAttrProp channel1_prop;
channel1_prop.set_label("channel1");
channel1_prop.set_unit("volts");
channel1->set_default_properties(channel1_prop);
att_list.push_back(channel1);
// Attribute : channel2
Tango::SpectrumAttr *channel2 =
new Tango::SpectrumAttr("channel2", Tango::DEV_DOUBLE, 100000);
Tango::UserDefaultAttrProp channel2_prop;
channel2_prop.set_label("channel2");
channel2_prop.set_unit("volts");
channel2->set_default_properties(channel2_prop);
att_list.push_back(channel2);
// Attribute : channel3
Tango::SpectrumAttr *channel3 =
new Tango::SpectrumAttr("channel3", Tango::DEV_DOUBLE, 100000);
Tango::UserDefaultAttrProp channel3_prop;
channel3_prop.set_label("channel3");
channel3->set_default_properties(channel3_prop);
att_list.push_back(channel3);
// Attribute : channel4
Tango::SpectrumAttr *channel4 =
new Tango::SpectrumAttr("channel4", Tango::DEV_DOUBLE, 100000);
Tango::UserDefaultAttrProp channel4_prop;
channel4_prop.set_label("channel4");
channel4_prop.set_unit("volts");
channel4->set_default_properties(channel4_prop);
att_list.push_back(channel4);
// Attribute : channel5
Tango::SpectrumAttr *channel5 =
new Tango::SpectrumAttr("channel5", Tango::DEV_DOUBLE, 100000);
Tango::UserDefaultAttrProp channel5_prop;
channel5_prop.set_label("channel");
channel5_prop.set_unit("volts");
channel5->set_default_properties(channel5_prop);
att_list.push_back(channel5);
// Attribute : channel6
Tango::SpectrumAttr *channel6 =
new Tango::SpectrumAttr("channel6", Tango::DEV_DOUBLE, 100000);
Tango::UserDefaultAttrProp channel6_prop;
channel6_prop.set_label("channel6");
channel6_prop.set_unit("volts");
channel6->set_default_properties(channel6_prop);
att_list.push_back(channel6);
// Attribute : channel7
Tango::SpectrumAttr *channel7 =
new Tango::SpectrumAttr("channel7", Tango::DEV_DOUBLE, 100000);
Tango::UserDefaultAttrProp channel7_prop;
channel7_prop.set_label("channel7");
channel7_prop.set_unit("volts");
channel7->set_default_properties(channel7_prop);
att_list.push_back(channel7);
// Attribute : errorCounter
Tango::Attr *error_counter =
new Tango::Attr("errorCounter", Tango::DEV_DOUBLE, Tango::READ);
Tango::UserDefaultAttrProp error_counter_prop;
error_counter_prop.set_label("error counter");
error_counter_prop.set_format("%i");
error_counter_prop.set_description("Errors occuring during the waveform generation.");
error_counter->set_default_properties(error_counter_prop);
att_list.push_back(error_counter);
// Attribute : useBoardFifo
Tango::Attr *use_board_fifo =
new Tango::Attr("useBoardFifo", Tango::DEV_SHORT, Tango::READ);
Tango::UserDefaultAttrProp use_board_fifo_prop;
use_board_fifo_prop.set_label("use board FIFO");
use_board_fifo_prop.set_description("Set to 1 if data have been loaded in FIFO.\nSet to 0 if data is continuously tranfered through DMA (possible underrun)");
use_board_fifo->set_default_properties(use_board_fifo_prop);
att_list.push_back(use_board_fifo);
}
//+----------------------------------------------------------------------------
//
// method : ContinuousAOClass::write_class_property
//
// description : Set class description as property in database
//
//-----------------------------------------------------------------------------
void ContinuousAOClass::write_class_property()
{
// First time, check if database used
//--------------------------------------------
if (Tango::Util::_UseDb == false)
return;
// Prepeare DbDatum
//--------------------------------------------
Tango::DbDatum title("ProjectTitle");
string str_title("Continuous Anolog Output");
title << str_title;
Tango::DbDatum description("Description");
string str_desc("Perform continuous anolog ouput (waveform generation) on the selected outputs.");
description << str_desc;
// Use the doc_url field to store all information
// on the server version and CVS
string::size_type pos, len;
// 1) Manage module name
// get rid of the $RCSfile: prefix and of Class.cpp suffix
string classname = RCSfile;
pos = classname.find("$RCSfile: ");
len = classname.length();
if (pos != string::npos)
classname= classname.substr(pos+10, len- pos-10);
pos = classname.find ("Class.cpp",0);
if (pos != string::npos)
classname=classname.substr(0,pos);
// 2) Manage version number with SOLEIL CVS rules
// tag name is in the form : release_1_0 ==> transform it to 1.0
//
string version ;
string str_TagName=string(TagName);
pos = str_TagName.find_first_of("_",0);
if (pos != string::npos)
version= str_TagName.substr(pos+1, 3);
pos = version.find_first_of("_",0);
if (pos != string::npos)
version[pos] = '.';
// Store all info in the str_url property
string str_url= "Documentation URL = " + string(HttpServer) + classname +"-" + version + "/index.html" + "\n";
str_url= str_url + " Version CVS Tag = " + string(TagName)+ "\n";
str_url= str_url + " CVS location = " + string(FileName)+ "\n";
Tango::DbDatum doc_url("doc_url");
doc_url << str_url;
// Push everything in DataBase
Tango::DbData data;
data.push_back(title);
data.push_back(description);
data.push_back(doc_url);
// Call database and and values
//--------------------------------------------
get_db_class()->put_property(data);
}
} // namespace
//=============================================================================
//
// file : ContinuousAOClass.h
//
// description : Include for the ContinuousAOClass root class.
// This class is represents the singleton class for
// the ContinuousAO device class.
// It contains all properties and methods which the
// ContinuousAO requires only once e.g. the commands.
//
// project : TANGO Device Server
//
// $Author: syldup $
//
// $Revision: 1.1.1.1 $
//
// $Log: not supported by cvs2svn $
//
// copyleft : Synchrotron SOLEIL
// L'Orme des Merisiers
// Saint-Aubin - BP 48
//=============================================================================
//
// This file is generated by POGO
// (Program Obviously used to Generate tango Object)
//
// (c) - Software Engineering Group - ESRF
//=============================================================================
#ifndef _CONTINUOUSAOCLASS_H
#define _CONTINUOUSAOCLASS_H
#include <tango.h>
namespace ContinuousAO
{
//
// Define classes for commands
//
class SetAOScaledDataCmd : public Tango::Command
{
public:
SetAOScaledDataCmd(const char *,Tango::CmdArgType, Tango::CmdArgType,const char *,const char *, Tango::DispLevel);
SetAOScaledDataCmd(const char *,Tango::CmdArgType, Tango::CmdArgType);
~SetAOScaledDataCmd() {};
virtual bool is_allowed (Tango::DeviceImpl *, const CORBA::Any &);
virtual CORBA::Any *execute (Tango::DeviceImpl *, const CORBA::Any &);
};
class StopCmd : public Tango::Command
{
public:
StopCmd(const char *,Tango::CmdArgType, Tango::CmdArgType,const char *,const char *, Tango::DispLevel);
StopCmd(const char *,Tango::CmdArgType, Tango::CmdArgType);
~StopCmd() {};
virtual bool is_allowed (Tango::DeviceImpl *, const CORBA::Any &);
virtual CORBA::Any *execute (Tango::DeviceImpl *, const CORBA::Any &);
};
class StartCmd : public Tango::Command
{
public:
StartCmd(const char *,Tango::CmdArgType, Tango::CmdArgType,const char *,const char *, Tango::DispLevel);
StartCmd(const char *,Tango::CmdArgType, Tango::CmdArgType);
~StartCmd() {};
virtual bool is_allowed (Tango::DeviceImpl *, const CORBA::Any &);
virtual CORBA::Any *execute (Tango::DeviceImpl *, const CORBA::Any &);
};
//
// The ContinuousAOClass singleton definition
//
class ContinuousAOClass : public Tango::DeviceClass
{
public:
// add your own data members here
//------------------------------------
public:
// Method prototypes
static ContinuousAOClass *init(const char *);
static ContinuousAOClass *instance();
~ContinuousAOClass();
protected:
ContinuousAOClass(string &);
static ContinuousAOClass *_instance;
void command_factory();
void attribute_factory(vector<Tango::Attr *> &);
void write_class_property();
private:
void device_factory(const Tango::DevVarStringArray *);
};
} // namespace ContinuousAO
#endif // _CONTINUOUSAOCLASS_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment