01-17-2018 12:39 AM - edited 01-17-2018 12:42 AM
Hi Teddy,
what's the matter with you?
Why do you still use lots of local variables and sequence frames - despite getting suggestions to not use them?
Why do you still set the index of an array constant to 100 - despite being told it's senseless?
That's your VI after cleaning up:
The information is being added was appended to the bottom last used row in the programmatic table instead of the last used column
Because you have it programmed that way!
Do you see that InsertIntoArray you use to insert the "manual input table"? Do you see its set to insert by rows as the first "row" index input is a full black rectangle while the 2nd "column" index input is an open rectangle?
When you want to insert by columns you need to do and wire exactly that!
As Altenbach says: InsertIntoArray most often is the wrong tool!
Why do you initialize your array to 20 columns? When you want to replace elements in your array you should actually replace them, but not insert them! Use ReplaceArrayElements to put your "manual input" at the right place…
01-17-2018 01:45 PM
Hi GerdW,
I do apologize, coming from a syntax coding background. Variables have been my go to thing for my coding structures. I guess I'll have to break out of that habit. I did read that direct wiring is better suited due to race conditions (I have yet to see an example of that, but I feel it might be taught in the first course for Labview)
Thank you for the insights so far. I'll definitely keep them in mind for future projects.
01-17-2018 02:24 PM
So I've tried using replaceArrayelements to get my manual input table to the right location of my programmatic table but I'm getting a table mismatch connection error.
Is it due to the fact that one has headers and in addition is numerical vs. the other which is full of strings?
01-17-2018 02:37 PM - edited 01-17-2018 02:38 PM
A table is always strings. You can format your numerics to make the compatible.
Did you even look at the example I attached earlier? It has all the tools you possibly need. even shows the formatting!
01-17-2018 02:59 PM
Hrmm. Okay so my manual input table is full of strings, but I'm still getting a table mismatch error, and I have no clue what format function I should use or if that's even the case for the error...
01-17-2018 03:45 PM
If you attach a new VI, please also give it a new name to avoid confusion. I'll have a look.
01-17-2018 03:46 PM - edited 01-17-2018 03:55 PM
If you need to replace part of a 2D array with a 2D array, you need to wire both indices to avoid ambiguity.
01-17-2018 04:47 PM
Thank you altenbach,
I didn't want to spam your download list with different VI's with different names. I'll submit myself to the classes for the basics.
I appreciate all the help given.
01-17-2018 05:09 PM
TeddyLu wrote:I didn't want to spam your download list with different VI's with different names. en.
The problem is that my "downloads" folder now has multiple VIs, all with the same name and numbered in the order of downloads (not necessarily in the order posted). The number of files is the same, but with unique names they are easier to track and cross-reference to the related post. To make sure I am looking at the right VI, I might to even have to download it again, making the problem more serious. (The problem gets worse with subVIs, for example if there is an older subVI with the same name (e.g. untiltled 1.vi) and new VIs (caller and sub) are posted, the new untitled 1.vi will be renamed by the browser to untitled 1(1).vi and the caller will try to load the old, unrelated VI, breaking everything in the process. Yes, happens all the time!)