LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

global variable cannot hook up to Excel Easy Table data in node

I have Labview 8, windows 2000. I am trying to write a global variable into the data node of Excel Easy Table.vi  but it won't connect. Easy Table is looking for an 8 bit unsigned 1D array and I can't configure the variable to match. Has anyone had this same problem? I'm trying to write the variable to a specific cell in an excel spreadsheet.
Thank you.

0 Kudos
Message 1 of 12
(3,514 Views)

What is the datatype of your global variable?  It would probably help if you attached a sample VI (along with a sample global) that demonstrates the problem.  The Excel Easy Table.vi is a polymorphic VI that has two instances...one instance accepts a 2D array of strings, and the other instance accepts a 2D array of numerics.  Make sure you aren't using one of the polymorphic instances, as opposed to the polymorphic VI itself.  Anyway, if your global variable is a scalar value, or a 1D array, you'll need to use the Build Array function to add dimensionality to your data until it is a 2D array.

So with more information, I'm sure we can help you solve your problem.

-D

0 Kudos
Message 2 of 12
(3,510 Views)
Darren thanks for getting back to me. I'm trying to stuff a variable into a specific cell in excel. It works fine if I stuff in a constant but I'd like to stuff a global variable in as well. The Excel Easy Table/ Text wants to see an "unsigned 8 bit 1D array". I've tried changing the variable to many different types (8bit signed, unsigned, etc...) but I can't get it to accept the link. Any ideas?

Larry

0 Kudos
Message 3 of 12
(3,497 Views)

Please attach a sample VI and a sample global variable (also should be a .vi file) that demonstrate the problem and I should be able to help.

-D

0 Kudos
Message 4 of 12
(3,495 Views)
Darren,

Attached is a simple program that shows the problem. Let me know what you think.

Larry

0 Kudos
Message 5 of 12
(3,492 Views)

Ok, it seems like you need to convert your scalar numeric value from your global variable into a string for the Excel Easy Text.vi.  To do that, go to the String > String/Number Conversion palette and use the Number to Decimal String function.  Wire your global value into that function, and use the string output of that function for the "text" input of the Excel Easy Text.vi.  That should be all you need.

Good luck,
-D

0 Kudos
Message 6 of 12
(3,489 Views)
Darren,

It worked great Thank you! One problem is that it is rounding the number before converting it. Is there a way I can have the actual number come through?
Thanks.

Larry

0 Kudos
Message 7 of 12
(3,486 Views)

Try adjusting the "width" parameter on the Decimal String to Number function.

-D

0 Kudos
Message 8 of 12
(3,481 Views)
Darren,

I've played around with the 'width' node but I don't know what you mean by making it a 'Number function'.
Thanks for the help.

Larry

0 Kudos
Message 9 of 12
(3,475 Views)

Oops, I meant the Number to Decimal String function...got the name switched around.

Anyway, from the VI you attached, it looks like you're dealing with an integer number (I can tell because the global variable is a blue color).  So the number coming out of your global variable won't have any digits after the decimal point because it's an integer.  If you are trying to write decimal data to your global variable, perhaps you should change its datatype to be a floating point value (orange in color) instead of an integer.  You can do that by right-clicking the numeric inside your global VI and choosing Representation, then selecting DBL.  Check the LabVIEW Help if you need more information about data types.

Hope this helps,
-D

 

0 Kudos
Message 10 of 12
(3,470 Views)