06-12-2023 03:39 AM - edited 06-12-2023 03:42 AM
Hello all,
unfortunately I have a problem with the generation of time-varying analog output signals with the MyDAQ.
A defined voltage curve is to be given at different intervals via the analog output. With one signal alone this worked well with stopping and then restarting the signal output as soon as the trigger was set.
But now the problem is: I have to output two independent pulses, which are triggered by two different triggers. If they happen to occur at the same time, their voltage values should be added. I have stored the two courses in an array each and read out the next value from the arrays for the output of the values and add them.
Unfortunately, the voltage that I read in via the analog input does not match the expected results at all.
Can you tell me where my thinking error is? I'm afraid it has something to do with the timing or my method of signal output, but I just can't find the error.
Best regards
Josi
06-12-2023 03:43 AM
Hi Josi,
@J0SI wrote:
But now the problem is: I have to output two independent pulses, which are triggered by two different triggers. If they happen to occur at the same time, their voltage values should be added. I have stored the two courses in an array each and read out the next value from the arrays for the output of the values and add them.
Unfortunately, the voltage that I read in via the analog input does not match the expected results at all.
Can you tell me where my thinking error is?
Mind to share your VI?
And please define the term "triggers"…
06-12-2023 03:49 AM
Hi GerdW
I am so sorry, I just saw that it was not uploaded in my post and added it again.
Best regards
Josi
06-12-2023 05:13 AM
06-12-2023 05:32 AM
Hi GerdW,
yes of course, gladly, here is version for LabVIEW 2019.
Best regards,
Josi
06-12-2023 08:16 AM - edited 06-12-2023 08:20 AM
Hi Josi,
thanks for conversion!
See this:
How do you make sure both input arrays have the same (and sufficient) number of elements?
How do you know the shift registers ALWAYS start with valid values?
Why were there so many orange wires when you want to handle integer array indices?
Why do you need expression nodes when there are simple and equivalent math functions, like "+1"/"-1"?
Why are there indicators with generic labels or even worse without a label?
Why do you multiply with "0" and "1" in your formula nodes? The results of those operations is known at edit time (aka Rube-Goldberg)…
06-12-2023 09:12 AM
Hi GerdW,
thank you for your time and feedback. Regarding your questions:
1. i wanted to set the size of the array for the output by the variable length, which limits the length of the output array section, for both arrays equally.
2, 3, 4, 6. thanks for the hint, i have adjusted these points now
5. these indicators are only used for error detection, they should not be part of the later VI... so I didn't spent time on labeling them.
Best regards
Josi
06-12-2023 09:54 AM
I have made the
Now the time interval of the output of the array seems to be correct, but the measured output is still too long (if I set the values to 10 for dt and 20 for dT i have an interval of 30 instead of 10 for dt measured at the ai).
I tried to solve this timing problem via the onboard clock (by setting my loop for the onboard clock to true) but then I don't get any voltage drop at the ai at all.