LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

combo box strings

Solved!
Go to solution
I am trying to get some combo boxes to have their entries populated by a text file. I've read many forum entries about the 'strings[]' property, it but it refuses to work for me. I want the combo box to be modifiable by changing entries in a text file.

Can someone beat this code into submission? I get this error about a GPIB controller needing to be in charge.

I've included the vi, the text file I want to populate the 'Version Number' combo box and that should be it.

Tay
Download All
0 Kudos
Message 1 of 9
(4,094 Views)

Hi slipstick,

which vi in your llb is the "main" vi?

Mike

Message 2 of 9
(4,076 Views)
Solution
Accepted by topic author slipstick
You have several general issues, but here are the ones affecting your combo box:
  1. In general, if you are making copies of NI provided files, use new names.
  2. The VI you modified to read spreadsheet strings has bad default values.  You have number of rows set to default to 4, and start of read offset set to default to 132.  The reason you are getting the error is because the file doesn't have 132 bytes of data.  Setting those back to -1 and 0, repsectively will remove the error.  You should do this by opening the VI, changing the value, then right-click, and select "Data Operations"->"Make current value default" for each of the two controls.
  3. Now, the VI you have will properly load the values from the file.
  4. There is no reason to reread the file everytime the user changes the value of the combo box.  Read it once at the beginning of the program.

Message 3 of 9
(4,069 Views)
The main vi is 'event inspection'.
0 Kudos
Message 4 of 9
(4,051 Views)
Ah, it's the simple things that get you. That modified spreadsheet vi is from my early days and I had missed going back and fixing that error. And the llb has all of that other stuff in it because in my frustration last night I saved it the wrong way. I guess that tells you not to code when both tired and angry.

By the way, why does that particular error come up as a GPIB error?

Thanks Matthew!

Tay
0 Kudos
Message 5 of 9
(4,044 Views)
NI reuses error codes.  So sometimes, there are multiple errors listed and some will make no sense.  Here, it is just the invalid input parameter error that means anything.
Message 6 of 9
(4,023 Views)
On a sidenote, you have some serious coding mistakes. For example look at the following code.
 
I would think that the "select" node should act according to the current value of the boolean. WIth your current code, it is very likely that you read the stale value from the property node before the Pass/Fail indicator has received the new value. This is a classic race condition.
 
Don't be afraid to branch a wire! The property node is entirely useless and actually is computationally expensive. All you need is a wire. Right? The wire creates a data dependency that ensures correct execution order. 🙂
 
 
 


Message Edited by altenbach on 04-20-2008 01:05 PM
Message 7 of 9
(4,019 Views)
Yes, that was a useful change!

I have attached the newest code, which has a number of changes, and now works to my satisfaction. The 'modem' tab will be added to later.

Thanks for all the help!

Tay
Download All
0 Kudos
Message 8 of 9
(4,007 Views)
Ok, Boo-boo. Missed some default values.

Try this.

Tay
0 Kudos
Message 9 of 9
(4,003 Views)