01-30-2019 03:49 PM
I have two similar programs, which have been running fine:
(Note that you have to disable one of the blocks above to make the program run. I just stitch them together here.)
Now I wanted to add a little tweak to those two programs. On the top of diagram, I added a Dial, which I hope to allow users to add some offset to the the input array. However it does not work. It seems that once the data has been sent to the card, one could not change it. I am looking for suggestions.
Solved! Go to Solution.
01-30-2019 10:03 PM
Well, you've discovered that once you've started a AO Task that has the data, just waiting for a Trigger, you are "committed". But under some circumstances, you can "have your Cake and Eat it,too".
Here's the deal -- when you get the changed input Event that says "Oops, I need to adjust the output Waveform", do the following:
There is, of course, a possibility that you will change the offset just as the (asynchronous) Trigger fires, but that is a "low probability" event, and not much you can do about "bad timing". If your Triggers come somewhat periodically, then you might just (rarely) miss a trigger.
Bob Schor
02-01-2019 03:26 PM
Those are solutions that I came up.
Thanks, Bob.
02-01-2019 07:13 PM - edited 02-01-2019 07:14 PM
Are those array operations for real, or just to simulate something?
Instead of building an array of 5 constants, you can just use an array constant. Or even use the Ramp function built into LabVIEW.
And you don't need to create an array of the 5 values from the control. Initialize Array would have been one step better. But you don't need an array for that. You can add a scalar to an array.
02-04-2019 10:05 AM
The values in the array are actually obtained by parsing a .csv file earlier, so I couldn't use a constant array for them. (or maybe I could?)
The idea of adding a single scalar to the array is awesome!
02-04-2019 10:17 AM
It doesn't matter where they come from. The constants shown are just to give simple example of how numeric functions can handle arrays.