Back: 6.13 Frequency Counter Functions Forward: 6.15 DIO Functions   FastBack: 6. Device Functions Up: 6. Device Functions FastForward: 7. Other Modules         Top: fsc2 Contents: Table of Contents Index: Index About: About This Document

6.14 DAQ Functions

Modules for the following data acquisition (DAQ) devices exist:

pci_mio_16e_1

National Instruments PCI-MIO-16E-1

me6000

Meilhaus Electronic GmbH ME-6000 and ME-6100 digital-to-analog converter cards,

hjs_daadc

Home-built DA and AD converter, group of H.-J. Steinhoff, Osnabrück

rb8509

Rulbus 12-bit ADC card RB8509, Leiden

rb8510

Rulbus 12-bit DAC RB8510, Leiden

To use a module in an experiment put its name into the DEVICES section of the EDL script.

Both the National Instruments PCI-MIO-16E-1 and the Meilhaus ME-6000 and ME-6100 cards, require that a kernel module and an additional library (both coming with fsc2) have been successfully installed.

The Rulbus rb8509 and rb8510 ADC and DAC cards both require that the Rulbus kernel module and an additional library (coming with fsc2) have been successfully installed.

List of DAQ functions:

`daq_name()'
`daq_ai_channel_setup()'
`daq_ai_acq_setup()'
`daq_ai_start_acquisition()'
`daq_ai_get_curve()'
`daq_trigger_setup()'
`daq_start_continuous_counter()'
`daq_start_timed_counter()'
`daq_timed_count()'
`daq_intermediate_count()'
`daq_final_count()'
`daq_stop_counter()'
`daq_single_pulse()'
`daq_continuous_pulses()'
`daq_dio_read()'
`daq_dio_write()'
`daq_ao_channel_setup()'
`daq_freq_out()'
`daq_reserve_dac()'
`daq_set_voltage()'
`daq_maximum_output_voltage()'
`daq_reserve_adc()'
`daq_get_voltage()'
`daq_dac_parameter()'
`daq_trigger_mode()'
`daq_gain()'

Descriptions of DAQ functions:

`daq_name()'

Returns a string with the name of the DAC being used.

`daq_ai_channel_setup()'

This function is only available for the PCI-MIO-16E-1 card. It is required that this function is called before analog input (AI) can be done to setup the properties of the input channels.

In order to understand what this function (as well as the next few) do a short explanation of the way analog input (AI) is done with the card is required: the most basic element of an acquisition is a single conversion of an input voltage into a digital value. Since there's only a single ADC on the card, converting the voltages of a set of channels needs to be done serially. This is called a scan, consisting of as many conversions as there are channels to be sampled. So a single scan consists of one or more conversions, depending on the number of channels involved. To acquire a a curve several scans have to be done.

But before even a single scan can be done, the card must be told about all the channels that are to be sampled. Thus the first argument the function expects is a channel number, specified by one of the symbolic names between CH0 and CH15.

The second non-optional argument is the range to use for the channel. For channels set up for bipolar input the allowed ranges are 10 V, 5 V, 2.5 V, 1 V, 500 mV, 250 mV, 100 mV and 50 mV, while for channels to be used in uniploar mode the possible range settings are 10 V, 5 V, 2 V, 1 V, 500 mV, 200 mV and 100 mV.

After these two required values three optional settings can follow. The first one is the coupling of the channel, which must be given by one of the strings "Ground", "Floating" or "Differential". The first one, "Ground", means that a ground-referenced signal source is connected to the channel and is, therefore, already connected to a common ground. "Floating" means that the signal source is in no way connected to the ground system and is therefore free floating. Examples are e.g. batteries, thermocouples, transformers etc. Finally, "Differential" is for cases where the signals source has its own reference signal or signal return path. In these cases two inputs channels are required, one from the range CH0 to CH7 and the second being the number of the first channel incremented by 8 - thus if one of the channels involved is CH0 the other channel to be used for differential input is CH8 etc. This second channel must not be set up, it's already clear from the setup for the first channel (which must be between CH0 and CH7) that it's is going to be used and how. When not given the coupling will be set per default to "Ground".

The next optional argument is the polarity of the channel, specified by the strings "BIPLOAR" or "UNIPLOAR". Per default "BIPLOAR" will be used, but if the specified range can only be used with uniploar coupling "UNIPLOAR" must be specified.

Finally, the card allows to add approximately 0.5 LSBrms of white Gaussian noise to the signal to be converted by the ADC, which is called dithering. This addition is useful when averaging rather small samples to increase the resolution. To enable dithering use the string "DITHER_ON" as another argument. Per default dithering is switched off, but you can make sure by passing the function the string "DITHER_OFF" as another argument.

The above listed set of arguments have to be repeated for each channel. Thus a typical invocation, setting up an acquisition using two channels may look like this:

 
daq_ai_channel_setup( CH3, 5 V, "Differential", "BIPLOAR",
                      CH1, 500 mV, "UNIPOLAR", "DITHER_ON" );

In this case CH3 and CH11 will be used together (remember that for differential measurements always a second channel must be used automatically) for a signal in the range between -5 V and +5V (i.e. in bipolar mode), where the sampled voltage is the difference between both channels, and CH1 is going to be used in unipolar mode for a voltage between 0 V and 500 mV in "Ground" coupling mode and with dithering switched on.

The function can only be used in the EXPERIMENT section of an EDL script.

`daq_ai_acq_setup()'

This function is only available for the PCI-MIO-16E-1 card. It is required that this function is called before analog input (AI) can be done using the card to setup the trigger mode, trigger sources and timings for the analog data acquisition.

As already explained in the paragraph for the previous function, an AI data acquisition is a set of scans, which in turn consists of a set of conversions, one for each channel to sample. Before an acquisition can be started the program must be told how many scans are to be done, which is the first argument the function expects. The next thing to specify is when to start the acquisition and, during the acquisition, when scans are to be started. It can even be set when each individual conversion can be started. For this reason there are several trigger modes, and the second argument the function expects is one of these:

`"TRIGGER_NONE"'

The acquisition is started immediately without requiring an external trigger event when the function daq_ai_start_acquisition() is called, the start of scans and conversions is controlled via timers on the card.

`"TRIGGER_SCAN"'

The acquisition is started automatically without an external trigger event, each scan is started on receipt of a trigger event and conversions are started via the cards timers.

`"TRIGGER_SCAN_CONV"'

The acquisition is started automatically without an external trigger event while both scans and each conversion during a scan are started on external trigger events.

`"TRIGGER_CONV"'

The acquisition is started automatically without an external trigger event, scans are started via one of the cards timer, but each conversion is started on receipt of an external trigger.

`"TRIGGER_START"'

The acquisition is started on receipt of an external trigger event while the starts of both the scans as well as the conversions are started via the cards timers.

`"TRIGGER_START_SCAN"'

The acquisition and the scans are started on receipt of an external trigger event while the conversions are started via a card timer.

`"TRIGGER_START_SCAN_CONV"'

The acquisition, the scans and the conversions are all started on receipt of external trigger events.

`"TRIGGER_START_CONV"'

The acquisition is started on receipt of an external trigger event, scans are started by a card timer and the conversions making up the scan are started by an external trigger event.

`"TRIGGER_OUT"'

In this mode the triggering of the acquisition is done via the counters on the card (which then can't be used at the same time) and allows to output a trigger signal at a well-defined time before or after the start of the acquisition.

For each of these trigger modes different further arguments are required. For the trigger modes where an external trigger event is used it must be specified what input to use for the trigger. This can be either one of the PFI input lines of the card, specified by the strings "PFI0" to PFI9, or the output of the first counter of the card (when used for creating pulses, see below), in which case the string "GOUT_0" is to be passed to the function. Optionally, the trigger input can be followed by another argument that tells if the trigger event is supposed to happen on the rasing or the falling edge of the input - the string argument "POSITIVE" (or abbreviated to "POS) switches to trigger on the a raising edge, while an argument of "NEGATIVE" (or "NEG") is for triggering on the falling edge.

A special role is played by the trigger input PFI0: while all other trigger inputs work only on TTL levels, this input can be switched to be used as an analog trigger. The function daq_trigger_setup() can be used to switch this input between TTL level mode and analog trigger mode. (To make the difference easier to spot and to stay in tune with the naming scheme in the documentation of the card instead of "PFI0" also the name "TRIG1" can be used).

On the other hand, when no external timer is to be used for starting scans or conversions the time distance between starts of scans and conversions must be known. Here one has to take into account the specifications of the card. The minimum time distance between conversions is at least 800 ns. Thus the time distance between scans must be at least 800 ns times the number of channels to sample. But when channels are used with different ranges (or some in bipolar and others in uniploar mod) this minimum time distance increases to 2 us to allow for settlings times of the internal preamplifier and thus also the minimum time between starts of scans is increased accordingly. Another point to note is that specifying the time distance between conversions is optional - if not given the program will pick the smallest pssible delay, i.e. either 800 ns or 2 us.

The TRIGGER_OUT mode is a poor mans pre-trigger mode, which can be used as long as it is possible to use the DAQ board as the contolling clock of the experiment. At a well-defined time before or after (or exactly at) the start of the acquisition a trigger is output at the GPCTR1_OUT pin of the board. This mode can be used e.g. to start an acqisition and only afterward trigger e.g. a laser, or the other way round, first trigger the laser and only after a well-defined time delay start the acquisition. The length of the trigger being output is an compile time option and can be changed in the configuration file for the device, the default is 100 ns.

According to the above discussion here's a list of all required and optional arguments to the function when used with the different trigger and timing modes. Optional arguments are enclosed in square braces:

 
daq_ai_acq_setup( Num_Scans, "TRIGGER_NONE", t_scan
                  [ , t_conv ] );

daq_ai_acq_setup( Num_Scans, "TRIGGER_SCAN", S_scan
                  [ , P_scan ] [ , t_conv ] );

daq_ai_acq_setup( Num_Scans, "TRIGGER_SCAN_CONV", T_scan,
                  [ P_scan , ] T_conv [ , P_conv ] );

daq_ai_acq_setup( Num_Scans, "TRIGGER_CONV", t_scan,
                  S_conv [ , P_conv ] );

daq_ai_acq_setup( Num_Scans, "TRIGGER_START", S_start,
                  [ P_start, ] t_scan [ , t_conv ] );

daq_ai_acq_setup( Num_Scans, "TRIGGER_START_SCAN", S_start,
                  [ P_start, ] S_scan [ , P_scan ] [ , t_conv ] );

daq_ai_acq_setup( Num_Scans, "TRIGGER_START_SCAN_CONV", S_start,
                  [ P_start, ] S_scan, [ P_scan, ] S_conv
                  [ , P_conv ] );

daq_ai_acq_setup( Num_Scans, "TRIGGER_START_CONV", S_start,
                  [ P_start, ] t_scan, S_conv [ , P_conv ] );

daq_ai_acq_setup( Num_Scans, "TRIGGER_OUT", t_delay,
                  t_scan [ , t_conv ] );

The symbol Num_Scans stands for the number of scans to be done, S_start for the source of the trigger starting the acquisition, P_start is the "polarity" (i.e. rasing or falling edge) of this trigger, S_scan and P_scan have the same meaning but for the start-of-scan trigger and S_conv and P_conv are for the start-of-conversion trigger. t_scan and t_conv are the time distances between starts of scans and between conversions, respectively. Finally, t_delay is the time between the start of the aquisition and the trigger output appearing on the GPCTR1_OUT pin of the card. It can be both positive and negative (a positive value leads to the trigger being output after the start of the acquisition).

Please note that not all timings are possible. E.g. when very long times between starts of scans are required (for example 1 s) but very short time distances between starts of conversions (for example 800 ns) this can't be realized using the cards hardware and you will have to fall back on using an external trigger for either the event that starts the scans or the conversions.

The function can only be used in the EXPERIMENT section of an EDL script.

`daq_ai_start_acquisition()'

This function is only available for the PCI-MIO-16E-1 card. It is to be used to start an analog input acquisition according to the paramter set by previous calls of the functions daq_ai_channel_setup() and daq_ai_acq_setup(). It expects no arguments.

The function can only be used in the EXPERIMENT section of an EDL script.

`daq_ai_get_curve()'

This function is only available for the PCI-MIO-16E-1 card and is used to fetch the acquired data from the card. It expects no arguments. What type of variable the function returns depends on the number of channels that got sampled. If there was only a single channel the function returns an 1-dimensional array with as many elements as scans where done. If two or more channels where sampled a 2-dimensional array is returned, with a rank of number-of-channels times number-of-scans.

The function can only be used in the EXPERIMENT section of an EDL script.

`daq_trigger_setup()'

This function is only available for the PCI-MIO-16E-1 card and can be used to switch the first trigger input line (named "PFI0" or "TRIG1" when specified in the function daq_ai_acq_setup() between "digital" (TTL level) and analog mode.

To switch to "digital mode where a TTL-level trigger signal is required simply call it with the string "TTL" as the only argument. In contrast, when switching to analog trigger mode there are several options for the first argument:

`"Low_Window"'

Creates a trigger signal that raises from low to high state when the input voltage falls below the threshold voltage V_low, that has to be specified as the next argument. The trigger signal falls back to the low state when the input voltage again gets raised above the threshold voltage.

`"High_Window"'

This is the inverse of the previous mode: a triger signal that goes from low to high is created when the input voltage is raised above a threshold value V_high (to be specified as the next argument) and that again goes back to low when the input voltage drops below the threshold voltage.

`"Middle_Window"'

Here the trigger signal is raised whenever the input voltage enters an voltage interval between the voltages V_high and V_low, taht have to be specified as the next two arguments, and drops to low again when the input voltage is raised above V_high or drops below V_low.

`"High_Hysteresis"'

In this mode the created trigger signal is raised when the input voltage exceeds a high threshold voltage V_high (to be specified as the next argument) and again falls back to low when the input voltage drops below a second threshold voltage V_low, to be specified as the final argument of the function (with V_low being lower that V_high).

`"Low_Hysteresis"'

This mode is opposite of the previous one: the trigger signal is raised when the input voltage drops below V_low and falls back to low when the input voltage exceeds V_high.

According to this the function has to be called in one of these forms:

 
daq_trigger_setup( "TTL" );
daq_trigger_setup( "Low_Window", v_low );
daq_trigger_setup( "High_Window", v_high );
daq_trigger_setup( "Middle_Window", v_high, v_low );
daq_trigger_setup( "High_Hysteresis", v_high, v_low );
daq_trigger_setup( "Low_Hysteresis", v_high, v_low );

The function can only be used in the EXPERIMENT section of an EDL script.

`daq_start_continuous_counter()'

This function is only available for the PCI-MIO-16E-1 card. It starts one of the two counters of the card. The counter will count until it is stopped by a call of the EDL function daq_stop_counter(). The first required argument is the counter to be used, which needs to be specified by one of the symbolic names CH0 and CH1 (please don't use numbers directly, the mapping between the symbolic values and channel numbers is non-trivial). If the requested counter is already running the function will fail.

As the second argument the source of events to be counted must be specified by one of the following symbolic names: PFI0 to PFI9, indicating one of the 10 PFI input lines of the card., TIMEBASE_1 or TIMEBASE_2, specifying the slow or fast timebase of the card.

The function can only be used in the EXPERIMENT section of an EDL script.

`daq_start_timed_counter()'

This function is only available for the PCI-MIO-16E-1 card and starts one of the counters of the card. The counter will count for a specified time and then stops automatically. It requires at least two arguments, the counter to be used, specified by a symbolic name, CH0 or CH1. If the requested counter is already running the function will fail. The second required argument is the length of time the counter is supposed to count. This time must be at least 100 ns and an integer multiple of 50 ns.

Please note:

This function requires not only one counter channel, i.e. the one passed to the function as the first argument, but also a second counter. If CH0 is specified as the counter channel also CH1 will be needed and vice versa. If the adjacent counter is already in use for some other purpose the function fails.

As the third argument the source of events to be counted must be specified by one of the following symbolic names: PFI0 to PFI9, indicating one of the 10 PFI input lines of the card., TIMEBASE_1 or TIMEBASE_2, specifying the slow or fast timebase of the card.

The function can only be used in the EXPERIMENT section of an EDL script.

`daq_timed_count()'

This function is only available for the PCI-MIO-16E-1 card is and very similar to the previous function, daq_start_timed_counter(), i.e. it runs a counter for a specified of time, but in contrast it waits for the requested duration of time and only then returns with the masured count. In every other respect, e.g. the required arguments etc. it is identical to the previous function.

The largest value that can be returned is 16777215, i.e. 2^24 - 1.

`daq_intermediate_count()'

This function is only available for the PCI-MIO-16E-1 card and returns the current value of a counter. The counter may still be running, in which case each call of the function will return an updated value according to the number of events that happened between invocations of the function. The function requires one argument, the counter for which the current value is to be returned. It must be specified by one of the symbolic names CH0 and CH1 (please don't use numbers directly, the mapping between the symbolic values and channel numbers is non-trivial).

The largest value that can be returned for a counter is 16777215, i.e. 2^24 - 1.

The function can only be used in the EXPERIMENT section of an EDL script.

`daq_final_count()'

This function is only available for the PCI-MIO-16E-1 card and waits for an counter to stop and only then returns the final value of the counter. Trying to call this function on a counter that has been started by the function daq_start_continuous_counter() and hasn't already been stopped will fail, because such a counter will never stop by itself.

The function requires one argument, the counter for which the current value is to be returned. It must be specified by one of the symbolic names CH0 and CH1 (please don't use numbers directly, the mapping between the symbolic values and channel numbers is non-trivial).

The largest value that can be returned for a counter is 16777215, i.e. 2^24 - 1.

The function can only be used in the EXPERIMENT section of an EDL script.

`daq_stop_counter()'

This function is only available for the PCI-MIO-16E-1 card and can be used to stop a counter independently of the purpose (i.e. counting or pulse train creation, see below) it was started for. It requires one argument, the counter to be stopped. It must be specified by one of the symbolic values CH0 and CH1 (please don't use numbers directly, the mapping between the symbolic values and channel numbers is non-trivial).

The function can only be used in the EXPERIMENT section of an EDL script.

`daq_single_pulse()'

This function is only available for the PCI-MIO-16E-1 card. Beside being used as event counters the counters can also be used to create pulses on its default output port. This function can be used to create a single pulse on the output port. It requires two arguments, the first being the counter to be used, specified by a symbolic value CH0 and CH1. If the requested counter is already running the function will fail. The second argument is the length of the pulse, which must be at least 100 ns and an integer multiple of 50 ns.

The function can only be used in the EXPERIMENT section of an EDL script.

`daq_continuous_pulses()'

This function is only available for the PCI-MIO-16E-1 card. It allows to create a continuous train of pulses. It requires at least two arguments, the first being the counter to be used, specified by a symbolic value CH0 and CH1. If the requested counter is already running the function will fail. The second argument is the length of the pulse, which must be at least 100 ns and an integer multiple of 50 ns.

If no third argument is specified the distance between pulses will be identical to the pulse length (resulting in a pulse frequency of twice the value of the second argument). By specifying a third argument (with the same restrictions as for the second argument) the distance between pulses can be set.

To stop creation of pulses (and to free the counter for other uses) the function daq_stop_counter() must be called.

The function can only be used in the EXPERIMENT section of an EDL script.

`daq_dio_read()'

This function is only available for the PCI-MIO-16E-1 card. Beside counters the card also can do digital input and output. There are 8 lines that can be monitored or set. Using this function the current state of any subset of these 8 lines can be determined. If the function is called without an argument the state of all lines is returned, with the lowest bit of the number returned being the state of the lowest numbered DIO line, the seond-lowest bit of the number standing for the second-lowest numbered DIO line etc. If all lines are set the returned value is thus 255.

If an integer argument gets passed to the function it is taken as a mask, determining which of the DIO lines are to be treated as input lines. The lowest bit of the mask stands for the lowest numbered DIO line, the second-lowest bit of the mask for the second-lowest DIO line etc. Thus, by specifying a mask of value of 1 the state of only the DIO line numbered 0 would be returned, for a mask of value of 2 the state of DIO line 1, for 4 DIO line 2 etc. By adding values for different DIO lines a subset of the DIO lines can be specified. Simple arithmetics show that the value of the mask must be between 0 (no DIO lines selected) and 255 (all DIO lines selected, which is the default). All bits in the resulting return value for which bits in the mask ae not set will be returned as being set to 0.

The function can only be used in the EXPERIMENT section of an EDL script.

`daq_dio_write()'

This function is only available for the PCI-MIO-16E-1 card. The 8 DIO lines of the card can not only be monitored (see the previous function, counter_dio_read()) but also set, which this function is to be used for. The function requires at least one integer argument, defining the states of the DIO lines to be set to. To output a high voltage at one of the DIO lines the corresponding bit of the value must be set. The lowest bit of the value corresponds to the lowest numbered DIO line, the second-lowest bit to the second-lowest numbered DIO line etc. To only set the lowest numbered DIO line the value passed to the function would have to be 1, to set only the second-lowest numbered DIO line the value would be 2, to set only the third-lowest numbered DIO line a value of 4 would be used. By combining these values for the different DIO lines a certain output pattern can be set for all DIO lines. Obviously, the allowed values are restricted to the range between 0 (all DIO lines in low state) to 255 (all DIO lines in high state).

Without a second argument all 8 DIO lines are switched to output mode and the states of the lines set according to the value of the first argument. But by passing the function a mask value as the second argument only a certain subset of the DIO lines will be set to output mode, thus allowing to have some of the DIO lines for output, while the can be used as input lines. Each set bit in the mask will switch the corresponding lines to output state while not changing mode for the lines for which no bit is set in the mask. Bits in the first argument for which no bit is set in the second argument will be not used, i.e. don't influence the state of the DIO lines.

The function can only be used in the EXPERIMENT section of an EDL script.

`daq_ao_channel_setup()'

This function is only available for the PCI-MIO-16E-1 card. It allows to configure individulaly the analog outputs (AO) of the card. Both output channels can be used to do biplor or unipolar output. While in bipolar mode voltages between -10 V and +10 V with a resolution of ca. 5 mV can be produced, in unipolar mode voltages between only 0 V and +10 V but with an increased resolution of about 2.5 mV can be produced.

The channels can also be used to either output a voltage derived from an internal reference voltage (in which case voltages between -10 V and -10 V or 0 V and +10 V can be produced), the output voltages can also be derived from an external voltage (between -11 V and +11 V maximum) can be produced. Using the function one can switch between internal and external reference.

The function expects at least two argument. The first one is the AO channel to configure, either CH0 or CH1. The second (or, optionally, the third) is the polarity, either the string "BIPOLAR" or "UNIPOLAR". Alternatively, the second or third argument selects the reference voltage to use, specified by the strings "INTERNAL_REFERENCE" or "EXTERNAL_REFERENCE". If no argument for the polarity or reference are given this property of the channels is not changed. Both channels are per default in bipolar mode and use the internal reference voltage.

`daq_freq_out()'

This function is only available for the PCI-MIO-16E-1 card. The card has an FREQ_OUT in and this function can be used to determine or set the frequency output at this pin (or switch output off). If called with no argument it returns the currently output frequency (or 0.0 if the output is switched off.

When called with an argument this must be the frequency to output (or 0.0 to switch output off). The allowed frequencies are either 20 MHz, 10 MHz, 200 kHz or 100 KHz or any frequency that can be derived from these frequencies by a division by an integer number between 2 and 16. If the frequency doesn't fit these requirements a frequency as near as possible to the allowed values is output.

Please note:

Under certain circumstances it is possible that changing the output frequency between a value that can only be derived from 200 Khz to one only derivable from 100 kHz and vice versa can also change the timing of both a currently runing analog input data acquisition as well as that of counters or pulsers. Thus this function should only be used while the analog input (AI) subsystem as well as the counter and pulser subsystem of the card isn't active.

The function can only be used in the EXPERIMENT section of an EDL script.

`daq_reserve_dac()'

This function can be used to reserve (or un-reserve) a DAC so that it can only be used with a pass-phrase. This will mainly be used by modules for other devices that require a DAC to keep an EDL script from accdentally changing the output of the DAC.

This function is not implemented for the Rulbus RB8509 ADC card.

For the ME-6000 and ME-6100 card the function expects an output port as the first argument specified by one of the symbolic values between CH0 and CH15 (don't try to use simple numbers instead!). For the home-built AD and DA converter this argument can't be specified since it has only a single output.

If there is no further argument (or, in the case of the home-built AD and DA converter, no argument) an integer is returned. If it 1 the DAC channel is reserved, if it is 0 the DAC channel is not reserved and can be used without a pass-phrase.

The next argument is a string variable to be used as the pass-phrase in later calls of the function daq_set_voltage() and, in the case of the home-built AD and DA converter, the function daq_maximum_output_voltage().

The final argument is optional. If is not given the function will try to reserve the DAC channel. If called with either an argument of 0 or a string "OFF" the DAC channel is released so that it can be freely used again. If called with either an argument of 1 or a string "ON" the DAC channel is reserved (which is identical to not passing it this argument).

The function returns an integer, if it is 1 the operation (i.e. reserving or releasing the DAC channel) succeeded, if it is 0 the operation failed.

`daq_set_voltage()'

This function has to be used to output a voltage at (one of) the output ports. For the PCI-MIO-16E-1, ME-6000 and ME-6100 cards the first argument has to be the output port, specified by one of the symbolic values between CH0 and and CH1 for the PCI-MIO-16E-1 card and between CH1 and CH15 for the ME-6000 and ME-6100 cards (don't try to use simple numbers instead!). For the home-built AD and DA converter as well as the RB8510 DAC card this argument can't be specified since both have only a single output.

If the PCI-MIO-16E-1 card he channel is in biploar mode and uses the internal voltage reference the second argument, the voltage to be output, must be between -10 V and +10 V). If it is set to unipolar mode it must be between 0 V and +10 V). If the channel is setup to use an external refeference voltage the argument must be be either between -1 and +1 or 0 and 1, standing for the fraction of the external reference voltage to be output.

For the ME-6000 and ME-6100 cards the second argument is the output voltage to be output in the range between -10 V and +10 V.

In contrast, for the home-built AD and DA converter card, the only argument is the output voltage. It must be between 0 V and the maximum voltage that has been specified in the call of the function daq_maximum_output_voltage(). If this function hasn't been called the default maximum output voltage is +10 V.

Also the module for the Rulbus RB8510 12-bit DAC allows only a single argument, the output voltage. Since there are different versions of the card with different output voltage ranges the possible range can only be determined at the start of the experiment.

If an output voltage has already been set for an output port the last set voltage is returned when the function is called without a second argument.

Please note:

The latest set output voltage will still appear on the output port after the program is finished. If it is required that the output voltage reverts to a default value at the end of the experiment please put a command for setting this voltage into the ON_STOP section of the EDL script.

For the home-built DA and AD card the output voltage will automatically drop to 0 V if the function daq_get_voltage() (see below) is called without a previous call of the function for setting an output voltage.

Please note:

If the DAC channel had previously been reserved by a call of the function daq_reserve_dac() the pass-phrase specified in that call has to be passed to the function as the very first argument if you want to be able to change the output voltage of the DAC channel.

The function can be used in the EXPERIMENT as well as in the PREPARATIONS section.

`daq_maximum_output_voltage()'

This function is only available for the home-built AD and DA converter. This device has a potentiometer at the front side that can be used to reduce the output voltage level from the maximum level of +10 V. By calling this function you can tell the program about the new value of the maximum output voltage, so that you afterwards may use the real required output voltages instead of values that have to be too large by the reduction factor of the potentiometer. So, if the potentiometer is set to 5 (of its maximum range of 10) and you call this function with an argument of 5 V you then can specify the real voltage you want to output in calls of daq_set_voltage() instead of having to pass it values that are too large by a factor of 2.

If this function hasn't been called the program will assume that the potentiometer is set to its maximum of 10 and output voltages of the DA converter are between 0 V and +10 V.

Please note:

If the DAC channel had previously been reserved by a call of the function daq_reserve_dac() the pass-phrase specified in that call has to be passed to the function as the very first argument if you want to be able to change the maximum output voltage.

The function can be used in the EXPERIMENT as well as in the PREPARATIONS section.

`daq_reserve_adc()'

This function is only available for the home-built AD and DA converter and can be used to reserve (or un-reserve) the ADC so that it can only be used with a pass-phrase. This will mainly be used by modules for other devices that require a ADC to keep an EDL script from accidentally triggering an input conversion.

If there is no argument an integer is returned. If it 1 the ADC is reserved, if it is 0 the ADC channel is not reserved and can be used without a pass-phrase.

The first argument is a string variable to be used as the pass-phrase in later calls of the function daq_get_voltage().

The final argument is optional. If is not given the function will try to reserve the ADC channel. If called with either an argument of 0 or a string "OFF" the ADC is released so that it can be freely used again. If called with either an argument of 1 or a string "ON" the ADC is reserved (which is identical to not passing it this argument).

The function returns an integer, if it is 1 the operation (i.e. reserving or releasing the DAC channel) succeeded, if it is 0 the operation failed.

`daq_get_voltage()'

This function is only available for the home-built AD and DA converter and the Rulbus rb8509 ADC card. For the home-built AD and DA converter it accepts no arguments and returns the current voltage at the input of the AD converter, a value between -10 V and +10 V. For the Rulbus rb8509 card it expects a single argument, the input channel. This must be a symbolic name, starting from CH0 up to CHx, where the x stands for one less than the number of channels the card has.The voltage value returned depends on the type of the rb8509 card (there are several versions with different voltage ranges and some allowing only unipolar input while others can convert biplor voltages) and the gain setting for the card, see function daq_gain() below.

The function can be used in the EXPERIMENT section only.

The following remarks apply to the home-built AD and DA converter only:

Please note:

If this function is called without a previous call of the function daq_set_voltage() (see above) the voltage at the output of the DA converter will switch to 0 V automatically. So you should call daq_set_voltage() always before daq_get_voltage() if something is connected to the DA output!

Also note:

if the ADC had previously been reserved by a call of the function daq_reserve_adc() the pass-phrase specified in that call has to be passed to the function as the very first argument if you want to be able to read in the voltage at the ADC.

`daq_dac_parameter()'

This function is available only for the ME-6000 and ME-6100 cards and the home-built AD and DA converter. It can be used to determine the current parameter of a DAC (channel). It returns an array of three floating point values. The first element of the array is the minimum voltage that can be output by the DAC, the second is the maximum output voltage and the third is the voltage resolution. If the device has more than one DAC channel, the function expects a channel as the only argument (which can be omitted if settings for alll channels must be identical).

`daq_trigger_mode()'

Some of the Rulbus RB8509 ADC cards allow to trigger a conversion on receipt of an external trigger. When in internal trigger mode a conversion is triggered automatically by calling the function daq_get_voltage(). In external trigger mode the conversion is triggered by an external event and the daq_get_voltage() function only returns after such a trigger as been received. The function expects a string argument, either "INT" or "INTERNAL" to select internal trigger mode, or "EXT" or "EXTERNAL" to switch to external trigger mode.

`daq_gain()'

The Rulbus rb8509 ADC card has a pre-amplifier with a gain factor that can be set to either 1, 2, 4 or 8 using this function. Trying to set it to any other values will result in an error message and the running experiment is stopped immediately.


Back: 6.13 Frequency Counter Functions Forward: 6.15 DIO Functions   FastBack: 6. Device Functions Up: 6. Device Functions FastForward: 7. Other Modules

This document was generated by Jens Thoms Toerring on September 6, 2017 using texi2html 1.82.