LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Table problem

Attached is the actual code.
 
I'm using labview 8.0, winsXP, Anritsu MT8852A Bluetooth Test Set, GPIB-USB cable
0 Kudos
Message 11 of 21
(1,185 Views)

Why do you have 2 For loops (one inside the other) that only execute once because of the constant of 1 wired to their N terminal?  What is the purpose of that lower For loop?  You have an indicator called Results, where does it get its value from?

When Dennis said post the actual code, he meant post the actual VI (and also any sub-VI's or anything needed to allow the code to run such as a typedef control).  This allows for all the code to be seen and possibly tested.

Sorry, you posted the actual VI while I was writing the reply.  But this generated a couple other comments.

1.  Why is the control numeric6 a hidden control?  Where does it get its value from.

2.  Why do you initialize the 2 1-run loops with a local variable of numeric?  You may have generated a race condition, the code at the lower part may occur (probably is more like it) before the value gets assigned to the numeric terminal in the upper portion.  You can't guarantee that you'll have the latest code.  You could possibly get duplicate values, and also miss a value.  You should minimize the use of local variables and replace that with a wire to guarantee data dependency and data flow.

Message Edited by Ravens Fan on 09-30-2007 11:02 PM

0 Kudos
Message 12 of 21
(1,185 Views)
Also, you may want to put a small wait between the VISA write and VISA read to allow the device time to return its response.
0 Kudos
Message 13 of 21
(1,177 Views)
Hello again,
 
I want to present my results in a table format so i can do away with the Results Cluster later.
 
Answers for your questions...
 
1) i just want to wire it to the right terminal of Shift Register that's all, frankly i'm not sure how to wire it properly. :x
 
2) I was hoping to capture the data at every test which can be displayed in the table format from column 0, column 1 and etc.
 
Should i do away with the numeric variables and wire straight to the build array function then? I'm getting an error (broken wire) at Number to Fractional String  for connecting two arrays that mismatch. Hmmm...
 
0 Kudos
Message 14 of 21
(1,173 Views)
Yes, get rid of the local variables.  Because of the empty string array as the initialization to the shift register to those inner most loops, you would get some empty columns on every iteration of the outer loop.  Seeing what you are trying to do, initializing an empty string array of the desired size, then replacing the appropriate column with the results seems best.  I added some string functions to take the results, rebuild them into a string, then convert that string into a 1-D array that would replace the particular column of the table.  Also, added a wait statement, adjust the time to wait as needed.  There are also numerous other threads on wait statements and using "bytes at port", and waiting to the termination character is received that may be helpful for serial I/O.
 
I left the results cluster and its local variable there.  You could  turn the results cluster into a shift register as well.  If you don't need it that on screen indicator, then you can eliminate a lot of that extra wiring and bundling of the data into the cluster.
 
See attached screenshot.

Message Edited by Ravens Fan on 09-30-2007 11:53 PM

0 Kudos
Message 15 of 21
(1,168 Views)
Create a shift register in outer for loop... and then pass your table data through shift register....
0 Kudos
Message 16 of 21
(1,165 Views)
Hi again,
i did what goes in your picture attached but this time round, i don't see data in the table control but yes at Results Cluster.
What should i do?
 
0 Kudos
Message 17 of 21
(1,145 Views)
Without having the other code, I wasn't able to test it.  I knocked out the missing sub-VI's and created some dummy code to be able to test it.  I found I had errors in the format string, as well as I had the initialize string array dimensions swapped.  Try the attached code in LV8.2
Message 18 of 21
(1,126 Views)

Hi again,

sorry to trouble you again, could you save the attached .vi in version 8 cause i couldn't open it in LV8.2.

Many thanks!

0 Kudos
Message 19 of 21
(1,116 Views)
Sure.  Try this one.

Message Edited by Ravens Fan on 10-01-2007 10:29 PM

Message 20 of 21
(1,104 Views)