From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
11-14-2012 01:54 PM
I can't seem to find the right function for it. Tried using express table but can't use string data for dynamic data, Table is a user input, tried looking for other tables.
I have a loop that iterates through two types of string arrays, the address and the name. For each iteration I want to put it in a table.
Simple enough but can't seem to find the right function for it. =/
Any suggestions?
Thanks,
William
11-14-2012 02:00 PM - edited 11-14-2012 02:01 PM
A table is a 2D array of strings.
If you have two 1D arrays of equal length containing matching elements, all you need is to use "build array". After that, you might want to transpose before writing to the table indicator.
If this does not help. please show us your code. Make sure the two input arrays contain typical default data (make current values default before saving).
11-14-2012 02:05 PM
I tried using the Table function but it doesn't allow me to specificy the index and insert the element.
The Build Array function seems to only accept double and not strings.
Is there a way to change the data type of an array?
11-14-2012 02:18 PM
When you wire a string to the Build Array, it will automagically change the data type to a string. Give it a try.
11-14-2012 02:36 PM
I see, that would work if I knew the number of elements.
Is there a function that appends, to a current string each time?
What I am essentially trying to do it:
numElements = (specified by user);
for ( i = 0, i ==NumElements-1, i ++)
{
stringArray(i,0) = GPIB_Adress_List(i);
stringArray(i,1) = IDN_List(i);
}
display(stringArray);
I sort of got this down in LabView except I am not sure how to put it in the "stringArray".
Does the build array function have another option that I don't see that would be able to do this?
11-14-2012 05:29 PM - edited 11-14-2012 05:30 PM
You should be using the Autoindexing on the FOR loop. It makes life a lot easier. Try something along these lines. It is far from perfect, but it will hopefully get you over the hump.
11-16-2012 11:38 AM
Oh nice.
Just started LabView so I have many things to learn. I'll look into autoindexing.
I was wondering if you are able to upload the .vi for the example that you've shown or rather what these certain functions are
VISA abc --> W
VISA abc <--- R
two boxes --> { many boxes
Thanks,
William
11-16-2012 12:01 PM
Actually, that picture is called a snippet. Save it to your machine and then drag it onto an empty VI. And the code will automagically appear.
Since you seem quite new, I would recommend taking the online tutorial: LabVIEW 101