01-30-2008 10:51 AM
01-30-2008 11:13 AM - edited 01-30-2008 11:16 AM
Hi immortalc,
Usually it is easier to diagnose problems like these when the actual vi is posted or at least a similar code snipet the mimics that actual code (for codes that have IP issues etc.) At first glance, I must ask if you have looked at the analog out indicator and verified that the voltages you are sending to the analog out task make sense. For instance, it appears that the first sample in the damping magnification array is being wired to the duty cycle input of your square wave function. If this is true, could you be possibly wiring a 0 to the duty cycle, as this will give you 0 voltage readings for the entire array? Also, you haven't wired anything to the sampling info input of the squarewave function. By default, the sampling frequency and number of samples of the square wave will be 1000 samples at 1 kHz. I'm not sure how many samples you have configured for analog output and what the output sample rate is but you will want to make sure that your square wave matches these parameters. So, first things first, post your code and this should be an easy fix. Secondly, check the data that you are sending to the DAQmx write function to make sure it makes sense. For instance, your task may be configured to output 100 samples and the first 100 samples of your square wave may be all 0s based on the duty cycle and phase controls.
regards,
caz
01-30-2008 12:15 PM
01-30-2008 01:04 PM
If, as you say, the AO works when the damping multiplier array (thick orange line) is wired directly to the DAQmx Write.vi, then the problem should only be in the data that the Square Wave.vi is sending. Without having your hardware to actually test your blockdiagram, I can only point out a few things to try. You should make the data the square wave.vi is generating match the same upper and lower limits as what is coming from the damping multiplier. For instance, set the offset to the same value as the amplitude to ensure that only positive values are being generated. If the multiplier array goes only from 0 to 5 V, set the amplitude to 2.5 and offset to 2.5. Also, verify that the duty cycle (stick a probe on this wire) is not 0. You may want to just hardwire a 50 to force this. To test how the square wave.vi works, make a new vi with just this function and wire its output to a waveform graph. Play with all the different inputs to get a square wave that looks like what the multiplier array looks like. Then duplicate these inputs in your real code. Last but not least, if nothing above works, write a new simple AO vi that only does analog output and uses the square wave.vi to generate data. If you can't get this to work, then there is something else that needs to be debugged. However, if the board works when using the damping multiplier array, I feel like it is just a problem with setting the parameters for the square wave.vi.
Let me know how everything works out,
caz
01-30-2008 03:40 PM