Privacy and Security Notice

DAC Module



DAC Module (Digital to Analog Converter VMIVME4140)

The VMIVME-4140 Analog Output Board has 16 analog output channels withs 12-bit resolution, sourcing up to 10mV at +/10V. Each output has a dedicated Digital to Analog Converter (DAC) assigned to it. The outputs may be configured as  unipolar(0 to+10V,0 to +5V,0 to +2.5V) or bipolar(+/-2.5V,+/-5V,+/-10V).

Configuring of DAC for operation.

There are two options to configuring logic of operation of PLU. One of them is used routines from 'vmic4140.o' library(located on adaqel2: "/home/moller/dev/vmic4140/")
in the coda '*.crl' file. The second one is remote configuration using 'plu_server' running on VME CPU and client
program 'cli.pl' (perl script) (located in adaqel2:~/dev/vx/plu_server/).

To configuring the logic of the module operation next functions from 'vmic4140.o' library are used:

init_4140() -  performs allocation of address and space for DAC register on VME bus and set default mode of operation: +/-10V, online, 2's compliment, no sync
Parameters: none;
Returns: 0 - on successfull and  -1 otherwise.

config_4140( data) - configures mode of operation of DAC
Parameters: data - configuration word(16bit) to write to Configuration Control Register (Offset $002)
Returns: none

set_out_4140(channel, value) - load 'value' to DAC register for selsected 'channel'
Parameters: channel - integer (0-15) channel number, value   - integer (0x0000-0x0FFF) value for DAC register Retuns: 0 on successfull and -1 otherwise.
  
get_out(channel) - returns value from DAC register for selected 'channel'.
Parameters: channel - channel number(0-15);
Returns: value from DAC register  


Examples.

Before using the any functions  'init_4140()' should be executed.
1. To configuring DAC for operation: range:+/-10V, 2's compliment, no sync:
   config_4140(0xC000);
2. Load value '1000' to DAC register for channel=0:
  set_out_4140(0, 1000);

Remote configuration.
For remote control of DAC outputs the perl script 'cli.pl' or 'hvcli' programm are used.
Format of configuration command for script 'cli.pl' is next:

cli.pl  host  port  "message"
where:
host -is hostname (halladaq10.jlab.org) of the VME CPU where 'plu_server' is running
port -is port number (1357) to connect to the 'plu_server'.
"message"  -is command string(in double or single quotas) to send to the 'plu_server'.
The message format of command string is next:
"destination command [parameter] [value1] [value2]"
where:
destination -  module name from next list : PLU,  TDC,  DAC, VME,  SERVER
command - command name: SET, CONFIG, GET, INIT, RESET, WRITE, READ
parameter - parameter name: AND, OR, NOT, TEST, OUT, STATUS

The format of the respond message is next if command is successfully executed :
"OK <sent command message>  [return value]"
On unsuccessfully exectution the respond message is:
"ERROR <error description>"

The 'plu_server' supports next  commands for DAC:  INIT, SET, GET, TEST
and list  parameters: OUT

  DAC commands description:
 INIT - initialization of DAC;
 CONFIG - setting of operation mode of DAC;
 GET - get the data from output register of DAC.
 SET - load data to output register of DAC;

Examples:
Command message for setting of operation mode of DAC (range:+/-10V, 2's compliment, no sync)  :
cli.pl halladaq10 1357 "DAC config 0xC000"
response message:
"OK    DAC CONFIG AND 0xC000"

Command message for load value=256  to the channel=1:
cli.pl halladaq10 1357 "DAC SET 1 256"
response message:
"OK    DAC SET  1 256"
 or
cli.pl halladaq10 1357 "dac set 1  0x00FF"
response message:
"OK    DAC  SET 1 0x00FF"
Get data from output register of DAC for output(channel) #4 :
cli.pl halladaq10 1357 "dac GET  4"
response message:
"OK    DAC GET  4 1024"


Back Back