04-24-2023 07:13 AM
04-24-2023 07:15 AM
Hi T,
@T.Entwit wrote:
selecting 1-8 for the available channels in the front panel scaled unit array control box down here. which I assumed auto indexed into the FOR loop accordingly Channel 1 though 8 or 0 to 3 on the first NI 9219 and 0 to 3 on my second NI 9219 each plugged into my NI cDAQ-9178
Selecting the index value in an array control does NOT CHANGE any array element value…
(I recommend some basic LabVIEW tutorials, as offered at the header of the LabVIEW board in the "Training resources"!)
Suggestion:
Resize the array controls to show more elements, then change the element values.
Learn to recognize the difference between "empty" array elements and "zero" values in numeric elements!
04-24-2023 07:21 AM - edited 04-24-2023 07:35 AM
What you really MUST do is to replace the Task tunnels with a Shift Register.
I'll let everybody else think that one through and discuss....
Then, while you are at it, consider putting that SR in an action engine as well and encapsulate the Task. Personally, when I see a set of related VIs with connector panes wired with paired Top Left and Right xxx In - xxx Out, I automatically write the AE and you'll never see that wire on the callers again.
<as an aside, my magic 8-Ball is actually a long series of painful lessons from finding and fixing my own bugs>
04-24-2023 10:04 AM
I am unsure what you mean when you use the abbreviations SR and AE (action Engine), I am thinking like a sub vi to do this sorting possibly so the data resulting dat gathering and further manipulation to present to a viewer post test in a "master VI"
04-24-2023 10:14 AM
I fixed the blank values by dragging the controls to show all 8 currently available channels CH0-CH3 on each of my 2 NI 9219 DAQ's. but now I cannot connect the indexed array to the terminals on the "map ranges" - DAQmx Scale. Do I need to create a sorted 1D array from my pre-scaled array controls, before entering with auto indexing to the DAQmx create scale terminals?
04-24-2023 10:36 AM
Hi T,
@T.Entwit wrote:
I fixed the blank values by dragging the controls to show all 8 currently available channels CH0-CH3 on each of my 2 NI 9219 DAQ's. but now I cannot connect the indexed array to the terminals on the "map ranges" - DAQmx Scale.
So you "fixed" code by implement more bugs?
You did NOT "show all 8 currently available channels", but now you changed your array from 1D to 8D!
As you failed in attaching your current code (you know we cannot edit/debug/run images with LabVIEW?) you need to fix this on your own!
Resize the array index back to just one value (to define your array as 1D again), but resize the element area to show 8 elements…
Did I mention the Training Resources yet to have you learn the LabVIEW basics?
04-25-2023 06:13 AM - edited 04-25-2023 06:14 AM
@JÞB wrote:
What you really MUST do is to replace the Task tunnels with a Shift Register.
I'll let everybody else think that one through and discuss....
Ok, I'll bite. Are you only talking about preserving the task refnum in the event of a 0-iteration For Loop? Or is there some deeper trick up your sleeve?
Asking because I haven't found it necessary to do such a thing to preserve task state from iteration to iteration. The task refnum behaves like a reference, such that when iteration i=3 executes, the task being referenced retains all the config settings from iterations i=0,1,2 even if the task refnum is passed into the loop via a mere tunnel.
(Though I'd still prefer the shift register as a visual *reminder* that the settings are being preserved from iteration to iteration.)
-Kevin P