Daqarta for DOS Contents
DQA.CFG file. Each parameter is given as a letter and colon, followed immediately by a value or text string. Use one or more spaces between parameters. For example:
LPTX.ADC A:1 M:SAR R:2.5The order of the parameters is not important for this driver. The parameter letters are case-insensitive, as are the entries that follow the colons.
You can check to see which parameters have been set, either via the configuration line or by default, by checking the board information summary available via the ALT-H Plug-In Help system. This also shows a summary of the default values for all parameters. There is no need to enter any parameter that is the same as the default value assumed by the driver.
LPTX.ADC A:1LPT1 is actually the default assumed by the driver, so you can omit this parameter if that's what you want to specify.
If the number you enter is not in the 1 to 4 range, Daqarta will exit immediately with:
'LPT value out of range.'The only exception is if you set A:0 to allow viewing of this board Help system without actually activating the port. You might want to do this to avoid having to disconnect a printer while you are still learning about the LPTX driver.
Most computer systems come with a single standard printer port, and if you need more than that you will have to install a separate board. All DOS systems can support ports LPT1 through LPT3 "naturally", without special software. The system BIOS keeps a record of the location of each LPT that it recognizes, and that record is consulted to validate the LPT value that you use here. If there is no entry for the LPT number you give (L:3 in this example), Daqarta exits with a message like:
'LPT3 not recognized by BIOS.' 'BIOS recognizes only LPT1 to LPT2.'where the message will reflect actual LPT availability.
Problems may be due to adding a new printer port board and getting the jumpers or switches wrong. Most boards allow designation as LPT1 or LPT2. If you need to add LPT3, be sure the board allows it before you buy. Some boards allow LPT4 use, but not all systems support this. For example, IBM PS/2 systems use the LPT4 location in the BIOS data area for other purposes.
You can use the LTEST.EXE utility supplied with Daqarta to see the port addresses corresponding to each LPT, as read from the BIOS data area just like this driver does. A typical display would be:
Printer Port assignments: LPT1: 0378h LPT2: 0000h LPT3: 0000h LPT4: 9FC0hIn this example, only LPT1 is installed, at address 378h. LPT2 and LPT3 are available, but LPT4 is clearly in use for something else. LPT ports are always assigned consecutively by the BIOS, so this can't be a hidden port. It's also beyond the highest possible port address of 3FFh.
Even if LTEST shows that the LPT4 location is available to install a new port, you may need to run special software (supplied with your port board) to make use of it... not all BIOSes will assign this automatically on start-up.
SAR or MUX via the M: Model parameter, otherwise it is ignored.
The SAR defaults to an 8-bit ADC configuration, but can be set via this parameter (or dynamically under menu control) to use anywhere from 1 to 8 bits. You might want to use less than 8 bits for faster sample rates on slow systems.
Initially, you will probably want to omit this parameter and just experiment with the menu control. Use the B: parameter if you find that you want to run with less bits most of the time... you can always change the setting via the menu.
board drivers and the Daqarta title line. However, the channel designations don't match the bit numbers: The bits available are 3 through 7, but the driver designates these as channels 0 through 4.
LPTX Status DB25 Printer Chan Bit Pin Function 0 3 15 Error 1 4 13 Select 2 5 12 Paper Out 3 6 10 Acknowledge 4 7 11 BusyYou can specify one of these with the C: parameter. For example:
LPTX.ADC C:1would preset Channel 1. You can always use the Channel menu item to change this during operation.
If you have selected DigOut (default) or DAC via the M: Model parameter, channel 4 is reserved for External Trigger use. In this case, selecting 4 (default) shows as "All 4", which means that all 4 channels (0-3) are combined in a weighted fashion, as though they were the output of a 4-bit ADC. Depending on what digital inputs are active at any given sample interval, the trace will show one of 16 levels.
For the SAR or MUX model, the channel usage is a bit different: The SAR consists of a DAC whose output is combined with the analog input signal and connected to one of the digital inputs. The C: parameter (or the Channel menu item) simply tells the driver which digital input you have chosen... it doesn't select from among different analog input sources as with other board drivers. (In theory, you could drive multiple DACs with each connected to a different analog signal and digital input, or you could use a single DAC with an output buffer for each analog input.)
Thus for the SAR or MUX model, there is no "All 4" combination of inputs, and the menu item normally allows selection of only Channels 0-3, with 3 as the default. Channel 4 is reserved for External Trigger as for the other models, but if you use the C:4 parameter you may specify it as the SAR input and forgo External Trigger operation. In this case, the menu item will of course be preset to Channel 4, but you may then change it over the 0-4 range... useful during hardware development, where you are testing to see which input works best with the SAR. (Some inputs may require different Wait settings, or have different thresholds that affect passive SAR design.)
If you select External Pacer operation via the S:En Speed parameter option, then Channel 3 is dedicated to that use. In that case, DigOut or DAC models only allow channels 0-2 to be set individually, and attempting to set Channel 3 (either via the C: parameter or menu option) will result in an "All 3" combination of channels 0-2. Note that the weighting will be such that channel 2 is as large as channel 3 under the "All 4" combination... everything is scaled up by a factor of 2.
For an SAR model with External Pacer, you may only use inputs corresponding to channels to 0-2. Trying to set a higher channel via the C: parameter will not produce an error, it will just set Channel 2.
configuration line tells the driver not to look for the file. You would probably only want to use this option if you are really short of DOS memory, since loading the Help file only increases memory use by a few hundred bytes for its separate link stack and directory. (The file itself shares the text buffer of the Main Help file.)
Note that ALL Help files, including main, can be omitted via an F:0 parameter on the INIT line (first line) of the DQA.CFG file. If this is present, no individual module Help will be loaded.
RTime mode, an interrupt must be generated for each sample acquired. The system timer (IRQ 0) is normally used for this purpose, but if you select the External Pacer option via the S:En Speed parameter, the interrupt must be generated by the printer port. The I: parameter tells the driver which IRQ will be used, as in:
LPTX.ADC S:E20 I:7This would specify IRQ 7, which is the normal IRQ for most systems with only one printer port. This parameter accepts IRQs of 3, 4, 5, or 7. Most printer port cards only allow selection of IRQ 5 or IRQ 7, with 5 typically used for the second printer port in a system. A few 16-bit port cards allow other IRQs, but those IRQs are not supported here.
If your printer card doesn't support interrupts, or if there is some system conflict that prevents proper use, you can still use the External Pacer option by simply omitting the I: parameter. However, you will be limited to Sequential mode only... the RTime key option will be shown crossed out.
If you give an I: parameter but no corresponding S:E to set External Pacer mode, Daqarta will exit with:
'I: IRQ parameter only for S:En External Pacer mode.'
DigOut (the default), DAC, SAR, or MUX. For example, the DAC option would be specified by:
LPTX.ADC M:DACThese designations pertain to the way the printer data output port is to be used:
STIM3 stimulus generator or equivalent.
The built-in printer data port is used for this by default if the DigOut Model is selected (default M: setting). You can also use a separate 8255-type port board, or an additional LPT printer port. This will allow you to use the main LPT for DAC or SAR operation, yet still provide digital stimulus output.
If you only need a single digital output bit, see if the Trigger Pulse output option available on all LPTX Model configurations is adequate before adding another board.
An 8255-type port occupies 4 consecutive addresses: Port A, Port B, Port C, and a Control Port. The Port A address is always used to indicate the base 8255 address. You should give the address in hexadecimal notation by preceding it with an 'h', as in:
LPTX.ADC P:h310This would specify Port A at 310 hex. If you want to use Port B or Port C for output instead, do NOT "adjust" this base address to 311 or 312... the driver needs the true base address in order to find the Control Port. Instead, we use a trick: Since A, B, and C are perfectly valid hexadecimal digits, the driver employs special tests to allow you to use the form P:h310B to specify Port B and P:h310C for Port C. Port A may be specified this way as well, if you want the parameter line to serve as a reminder of which port is in use... but it's not really needed, since Port A is the default.
Note that only the selected A, B, or C port is set to be an output... the other two ports are set as inputs. This allows other equipment to stay wired to them for other applications, since the inputs will just be ignored here. If the other application expects these to be inputs and there are active device outputs connected to them, then of course you don't want them to be forced to any possibly conflicting state.
However, suppose the other application uses those ports as outputs, and you want to leave device inputs connected to them while you run the current application. In this case, you can't assume that those device inputs will never be activated: The pins of the 8255, even though set as inputs, will have some indeterminate high or low voltage state unless they are loaded with around 5000 ohms or less. If your device inputs don't provide this load, you could be in for a nasty surprise when the other device activates unintentionally.
When the other application later makes the port an output, it will have no trouble driving the device to either state with this "pull-up" or "pull-down" resistor present. Of course, if you are SURE that your device inputs already provide adequate loads, go ahead and skip the resistors...
STIM3 Stimlulus Generator, if the main LPTX port is used for DAC or SAR operation. Standard printer boards are much less expensive than 8255 boards, and they are much more readily available.
For example, to specify LPT2 with the P: parameter, you would use:
LPTX.ADC P:L2All of the same considerations apply here as to the main LPTX port which you specify via the A: parameter.
SAR or MUX models, this allows direct input voltage calibration without using Daqarta's User Units option.
To specify a range such as +/- 2.34 Volts, use:
LPTX.ADC M:SAR R:2.34For large or small ranges, you can use European notation to supply a standard prefix in place of the decimal point. For example, to set +/- 1.23 mV, use:
LPTX.ADC M:SAR R:1m23The integer and fraction parts of the value must each be 65535 or less. If you want to set the range to +/-100000 you may use:
LPTX.ADC M:SAR R:100kIf you have configured your SAR to use the full range for positive data only (Unipolar operation), you can specify that by adding a 'U' just before the value, as in:
LPTX.ADC M:SAR R:U1m23This would specify a full-scale range of 0 to 1.23 mV. In this case all data would be shown above the zero line of the Daqarta waveform display, with the bottom half of the screen unused.
Note that Unipolar operation requires that the Trigger Level be set above zero for Norm trigger mode. For Auto mode, the trigger always behaves in an AC-coupled manner, such that when Trigger Level is set to zero, the trigger point will be half of the peak-to-peak span of the input. For Unipolar data this will be the midpoint of the positive input.
TTL digital input range is 0 to 5 Volts, so with a single digital input active on the DigOut or DAC models (Channel = 0 to 3), the default trace shows a 5 Volt swing. However, with this single input the trace is shifted down such that a low input level shows at the bottom of the screen, and a high level shows at the screen-center zero line.
This seemingly unusual format is slightly faster to compute, but, more importantly, it is actually the "natural" format of a single-bit ADC. This keeps it compatible with the "All 4" Channel setting, which emulates a 4-bit ADC.
The standard "offset binary" data format, used by all 8-bit sound cards and by most laboratory acquisition boards, encodes the lowest (most negative) input as all zeroes, zero input as mid scale, and most positive input as all ones. For a 4-bit "board" each binary value is 1/16 of the full-scale value, from 0 to 15/16 of full scale:
Input: Binary: Decimal: Scaling: Trace: Maximum 1111 15 15/16 Near Top Zero 1000 8 8/16 Middle Minimum 0000 0 0/16 BottomHence, the trace with all bits set is 15/16 of the total trace height. With a single bit ADC, the same system is used but with the least-significant bits set to zero. Only the 1000 and 0000 binary values are produced, so the trace "naturally" runs between the bottom and middle of the screen. The maximum value in a single-bit ADC is thus half of full-scale.
You can tell Daqarta to show the data as positive values only by using the 'R:U' notation just as for SAR analog ranges. For example, if you use:
LPTX.ADC M:DAC R:U10then the trace will go between 0 and +5, with +5 shown as half of the +10 Volt full-scale range. The negative portion of the trace would be unused.
For the 'All 4' Channel setting, you may want to set R:U16 so that you can read the binary weight of the combined inputs directly from 0 to 15 "Volts". If you are actualy using less than all 4 bits with the 'All 4' setting, adjust the range value accordingly (assuming you use the most significant bits):
Bits Binary Range Display 1 0000 or 1000 R:U2 0 or 1 2 0000 to 1100 R:U4 0 to 3 3 0000 to 1110 R:U8 0 to 7 4 0000 to 1111 R:U16 0 to 15Note that you can always use one of the Auto Zero options to center the trace about the normal bipolar zero line.
ADC conversion speed, in microseconds. It must be an integer between 2 and 1000. The default setting is equivalent to:
LPTX.ADC S:10or 10 microseconds, for a 100 kHz maximum sample rate. This value is used as a limit when setting sample rate under menu control, and is only there as a safety net to prevent you from setting the rate so high that you get bad data.
Note, however, that the actual upper limit depends on the speed of your system and the Model configuration you are using. DigOut and DAC models use digital inputs only, so the effective "ADC" is very fast. With a fast Pentium system you may be able to set the S: value as low as 4 µsec or even lower. On the other hand, with the SAR or MUX model you probably can't use anything much lower than 20 µsec.
So how do you determine when you are sampling too fast for your configuration? Typically, you will get an alert and this
'Sample rate overrun!'message when you try to exceed the limit. If RTime mode was active, it will be forced back to Sequential. This prevents lockup in case you give the system so much to do during each sample interrupt that there is no time for any other processing between the RTime interrupts.
If you use stimulus oversampling (Stimulus Generator Factor greater than 1), you may be able to have the effective stimulus output rate run faster than the S: limit, since data is not acquired on every output sample.
sample rate to be controlled externally, to provide exact synchronization to some external process. The external pacer signal may be fixed, or dynamically variable. For example, if you provide a sample clock that is synchronized to an engine or other machine's operating speed, you can view vibration spectra where each harmonic of the main rotation rate stays at the same screen location even as operating speed varies.
You must provide an external TTL clock signal at exactly the desired sample rate. Connect it to status input bit 6, which is referred to as the -ACK pin for printer use and is on pin 10 of the DB25 connector. This is normally used by the LPTX driver as digital input Channel 3.
To indicate that this signal should be used as an External Pacer, you need to prefix the conversion Speed parameter value with an 'E', as in
LPTX.ADC S:E5Daqarta will make no attempt to determine the actual sample rate... X-axis markings and readouts will be constant at the sample rate implied by this value. (You probably wouldn't want to look at them if they changed very quickly!)
In this example, the E5 indicates an external pacer with a sample period of 5 microseconds, or 200 kHz. This may be way faster than the actual sample rate, but it has the advantage that the frequency axis indicates 0 to 100 kHz, which you can interpret as 0 to 100% of the spectrum.
You can set any integer value from 2 to 65535 here. If your pacer signal is constant, or nearly so, you can just use the closest integer microsecond approximation of its period. If it varies all over the place, you may be better off with a 0 to 100% representation.
For analyzing rotating machinery, sample pulses are typically derived from a magnetic or optical pickup that monitors the passing teeth of a gear. If you want the X-axis to read directly in multiples of the main shaft speed (harmonic numbers), you need to do a little planning.
For example, suppose you put the pickup on a gear with 100 teeth, and that gear is driven 4 times faster than the main shaft. Then the pickup produces pulses 400x faster than the main shaft revolves. If you want the main shaft frequency (fundamental) to show as 1 Hz, you must indicate that the sample rate is 400 Hz (2500 microseconds) via S:E2500. The X-axis will then show 0 to 200 Hz, which you can interpret as 0 to the 200th harmonic.
The value you set is not used for any "real" sampling operations... that's completely controlled by the TTL pacer signal you feed to the pin 10 input. You must insure that this never goes faster than the maximum sample rate for your board, or you will get bad data.
However, the S:E value does affect certain other internal functions that deal with time units. When a Trigger Delay is set, the entered time value is converted internally to an equivalent number of sample periods. The delay operation is then carried out by counting samples. So if the true sample period is different from the S:E value, all trigger delays will be off by the same proportion. Dynamically changing the external sample clock will produce changing delays.
Although the Delay value won't indicate the actual delay in time units, this variable delay operation provides constant delay in terms of rotational degrees. This allows you to start your acquisition sweep at any shaft angle relative to a fixed trigger sensor, for example.
In RTime mode, Cycle times are handled just like Trigger Delay and will show the same sample clock effects. Sequential mode Cycle timing will be correct, since it is done with the system timer using absolute time, not sample counting. The Cycle adjustment control uses the same sample-period increment size in both RTime and Sequential modes, and is limited to a total of 32767 samples maximum, so the S:E value will affect both resolution and range.
If you use a varying External Pacer clock frequency during stimulus generation with the STIM3 Stimulus Generator or the Trigger Pulse option, the output frequencies will be scaled accordingly. The sample period established by the S:E value will be used as the basis for STIM3 sine wave calculations when using the DAC outputs. All STIM3 durations, for both DAC sine waves and DigOut digital output pulses, are given in sample periods that may thus be variable in width. These will thus be constant in rotational degrees or phase angle, even though they don't indicate in those units.
When you are using the External Pacer option, the board summary screen will show:
'External Pacer for Seq and RTime.'instead of the usual:
'System timer 0 used for Seq and RTime pacer.'If you use the S:E option, but don't provide a TTL pacer clock signal at the proper input, Daqarta will exit with:
'External Pacer not connected to Channel 3. (Status input bit 6 = DB25 pin 10 = -ACK line.)'Note that it is not enough just to have something connected to this pin... there must be a frequency present of at least 20 Hz or so to pass the internal tests. If you want to start Daqarta while the External Pacer is at a lower frequency, or before it becomes active, use a lower-case 'e', as in:
LPTX.ADC S:e5This will bypass the intialization tests.
'External Pacer interrupts not found.'As noted in the I: parameter section, if your printer port doesn't support interrupts, or if there is some system conflict that prevents proper use, you can still use the External Pacer option by simply omitting the I: parameter. However, you will be limited to Sequential mode only... the RTime key option will be shown crossed out. The board summary screen will then show:
'External Pacer for Seq only... no RTime.'
SAR and MUX Model configurations operates by setting trial output values on the DAC and attempting to match or balance the analog input signal. It sets one bit at a time, starting with the most significant, and looks to see if the new DAC output is greater or less than the input signal.
However, the DAC output must reach a stable value after each change, before a valid decision can be made. Using either the Wait menu option or the W: parameter, you can specify a delay to allow the new value to settle before any tests are done. You can set separate delays for each bit, or set all bits at once.
The Wait values do not correspond to particular delay values. They are arbitrary, and depend upon the speed of your system. For Wait values from 0 to 8, the delay steps are not equal because each delay is created by a different CPU instruction or string of up to four repeated instructions. For Wait values from 9 to 255, the delays are created by setting the counter of a single-instruction loop from 1 to 247 passes. On fast systems, the Wait = 9 delay may actually be less than Wait = 8, perhaps much less, due to low loop overhead for a single pass at Wait = 9 compared to four in-line instructions at Wait = 8.
When you are first setting up your system, you will probably want to use the menu controls to allow you to change these delays in real time so you can observe the results. But once you find a setting that you want to use in future sessions, the W: parameter can set this automatically at start-up.
To set the delays for All bits to a certain value n, use the format:
LPTX.ADC M:SAR W:A=nTo set an individual bit delay, specify the bit number. For example, to set bit 7 to Wait = 5, use:
LPTX.ADC M:SAR W:7=5You can use as many W: parameter invocations as you need to set all desired bits. If several bits have the same Wait value, start with the A form first to set those, then set the rest individually. For example:
LPTX.ADC M:SAR W:A=4 W:7=6 W:6=5would set:
Bit Wait 7 6 6 5 5 4 4 4 3 4 2 4 1 4 0 4Typically, you will probably set All delays the same. But since errors in the more significant bits are, well, more significant, you might find that the less significant delays can be reduced somewhat. Remember, all these delays add together to limit the maximum sample rate, so if you are trying for top speed then any delay reductions will be helpful.
How do you go about determining the optimum Wait delays for your configuration? The simplest method is to use the SAR to monitor a known good triangle, ramp, or sine wave from an external source. This could even be the DAC output of another Daqarta system. A ramp or triangle is best, since you can easily see deviations from a straight line.
Adjust the source amplitude to get near full-scale deflection on the trace, so that the full range of the SAR will be in use. Set the source frequency and the Daqarta sample rate so that you are viewing only a couple of cycles of the wave... you want things spread out enough to see problems in the waveform.
If the Wait delay is inadequate, there will be jagged spots in the trace. These will typically be worse where the more significant bits change, at mid-scale, quarter-scale, and so on. Use the Wait menu option and slowly increase All delays until the waveform looks good. As the Wait delay increases, you may get an alert and 'Sample rate overrun!' message. If so, you should reduce the sample rate until you no longer get this.
When you are satisfied, you may want to reduce individual bit Wait delays to try to get a bit more speed. Depending on your application, you may also want to reduce the number of bits to gain still more speed at the sacrifice of resolution.
How can you reduce the need for Wait delays? By reducing the time for the DAC to settle. The most profound influence on this is the length of the lines between the computer and the DAC, since these add propagation delay due to inductance and capacitance in the cables. The best situation is with the DAC right at the port connector on the back of the computer.
As an example, an entire passive SAR was built into a DB25 connector shell, with the DAC resistors wired directly to the connector pins. The DAC output was wired directly to the Channel 2 input (pin 12). The analog input signal was wired to this summing junction via a selected input resistor (10 k) from the signal connector, forming the complete SAR.
Running on a 33 MHz 486, this SAR system required no Wait delays to give clean waveforms. But adding extension cables between the computer port and the SAR connector made a big difference:
---- Connection ---- Wait Max Sample Rate Direct 0 31.4 kHz 12 foot ribbon cable 5 19.5 6 foot round cable 7 11.5Note that the round (standard printer extension) cable was much worse than the ribbon cable, yet was only half as long! So for experiments or development using a prototype board, use as short a cable as possible, and make sure it is ribbon cable. For the final product, put the SAR right at the connector.
Although not shown above, note that the length of the cable carrying the analog signal from the outside source to the input resistor has no effect on the settling time, whereas any capacitance at the summing junction on the other side of this resistor will make matters worse.
Questions? Comments? Contact us!We respond to ALL inquiries, typically within 24 hrs.
25 Years of Innovative Instrumentation
© Copyright 1999 - 2006 by Interstellar Research