DASYLab

cancel
Showing results for 
Search instead for 
Did you mean: 

min/max statistics with ttl outputs

Solved!
Go to solution

Here's a bizarre problem. I've attached the worksheet because it's difficult to explain the problem. First let me explain what this crazy thing is supposed to do. A signal generator outputs four sinewaves of 5Vp-p which are added. After being added I'm using a Statistics module to determine the Min/Max. All I need is the maximum, the minimum is ignored (I only care about the + peaks). The +peaks are evaluated to uniquely identify at the final output which sinewave(s) were input to the worksheet. Since I ultimately need 16-bits I had to add a unity scalar (scaling module) in order to create the 16th input (max of 15 wires allowed from an output) by expanding the 15th input to two outputs. I can see the expected TTL level outputs from the Statistics module on three Y/t Chart modules. This tells me things appear to be somewhat working at the output of the Statisics module (the hysteresis values inside the stat's module need to be tweaked in order to produce all (16) unique values, but it at least works. The problem is that the Bit Mask module (set to combine bits -- converting 16-bits to an integer output) generates no output regardless of different sinewave input combinations. I thought that I had configured it per a good example C.J. provided. I hooked up DMM's to also monitor the inputs to the the Bit Mask module (called 16-bit encoder) -- I can't get the DMM's to display any outputs of the stat's module, but the Y/t modules show there's TTL values being output. Both display modules should show what's output, but don't -- this puzzles me. The sine wave frequency is set to 1,2,4 & 8 Hz for debugging purposes, so I know it's not too fast for the DMM to display -- I've proven this by connecting the summed sinewave as an input to the upper-most DMM and it displays the changing voltage with no problem.

 

So, the two questions are: 1) Why do the DMM's not work on the output side of the Y/t modules or Stat's Min/Max Module?  2) Why can't the Bit Mask Module evaluate it's inputs? The summed sinewave is continuous and constant phase.

 

Any help would be appreciated. This has really got me baffled trying to debug.

 

 

   

 

   

0 Kudos
Message 1 of 4
(6,983 Views)
Solution
Accepted by topic author Williamx

It occurred to me that the DMM's placed where they are won't work because they're expected to display too short a duration of voltage. They would display between 5V and 25V depending upon the number of 5V wfm's summed, but each TTL output they're trying to display are no more than milliseconds in duration -- not a good application for a DMM. Now it's just a matter of figuring out what's wrong with the 16-bit to integer conversion module!

 

Any suggestions as to the problem?

0 Kudos
Message 2 of 4
(6,962 Views)

While I look this over... I need to point out that the DURATION of the pulse that the Min/Max outputs is one sample. That sample can be anywhere in the block. The DMM only displays one value in the block, which you have current configured to the default (Single value, or last value). If you change that to Maximum, you can see the max value in the block.

 

 

Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.
0 Kudos
Message 3 of 4
(6,952 Views)

Bill,

 

Looking at your example, it appears that you have an incoming waveform that is composed of various frequencies, all powers of two (1,2,4,8,16....).

You want to turn that incoming signal into a single integer where the bits represent whether a given frequency is represented.

 

If that is correct, and all of your expected frequencies are above 1 Hz, then look at this example.

 

I used a Switch-Generator (Amplitude modulated) to create the source signal. The Switch lets me turn off a given frequency. The Generator has 8 channels, generating 1, 2, 4, 8, 16, 32, 64, 128 Hz sine waves.

 

I used a sample rate of 10000 and a block size of 10000, for the convenience.

 

Then, I use the Arithmetic module to add these sine waves together, as you had done. 

 

Next, use an FFT module to decompose the signal from the time domain. When you display it, you can clearly see the frequencies that are turned on. When the block size and the sample rate are the same, then the resultant frequencies will be integer values, filling a block size of half the orginal block size.

 

I used the "Select Values" module to pick out the amplitudes at the target frequencies. The amplitudes are all 5 V, in this constrained example. If your actual test will not be 5 V, then use a trigger or scaling module to force the amplitudes to 0V or 5V. 

 

The selected values are then input into the bit mask module, combined back into an integer, reflecting the on and off bits of the original signal.

 

Let me know if this is helpful.

 

 

Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.
0 Kudos
Message 4 of 4
(6,948 Views)