LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ActiveX Charts in Excel thru Labview 6.0

I have been trying to create charts in Excel thru ActiveX in Labview 6.0 I dont have the luxury of buying LV 7.0+ or the add-on for Office toolkit so will have to do the hard way.
 
Here is the problem that I am running into. (See attached File)
 
I am using the invoke node for the the Chart method SetSourceData to set the data source. The method requires two inputs 'Source' and 'PlotBy'. I am passing on currentsheet.Range refnum to the 'Source' input and a string 'xlRows' to the 'PlotBy' input.
 
Upon execution i get an error. Can someone please let me know what is wrong with the code.
 
Thanks,
Shoaib
0 Kudos
Message 1 of 9
(3,076 Views)

First have you checked out the excel board. I have posted some VI's (that I did not create) that will set up the charts for you. I am sure i have them in 6.0 and you could also find them on the forum just like I did. when I get back to my work PC I will post them in the earliest version I have.

 

For more information and some sample VI's and tool kits, you can go to the excel board




Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 2 of 9
(3,071 Views)

Didnt know about Excel board. let me go look around. I have LV6i or 6.0

The Excel toolkit zip file contains VIs in either LV7.0 or 6.1

0 Kudos
Message 3 of 9
(3,065 Views)
Just figured it out. the problem was that i was passing the sheet refnum to the range method thru the local variable and apparently its not the correct way of doing things. I connected the sheet refnum directly and it worked.
0 Kudos
Message 4 of 9
(3,060 Views)
great to here you got it working. Locals can be a beast.



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 5 of 9
(3,047 Views)
Is there a good document or thread that would list the pitfalls of using local variables?


0 Kudos
Message 6 of 9
(3,043 Views)
shabu,

Essentially the danger in using local variables is that it breaks the data flow model of LabVIEW. For example, when you use wires to connect two elements together, LabVIEW must wait for the first block to return data before the second block can execute. With local variables, there is nothing that would force the second block to wait on valid data from the first block. This is called a race condition.  

For a bit more information on the subject, I would suggest you search these forums for "race condition." There various discussion on where they arise and how to avoid these. I would take a look at this linked forum post that contains a tutorial VI that attempts to explain this concept. Please post back if we can provide any other assistance. Thanks,

Mike D.
National Instruments
Applications Engineer
Message 7 of 9
(3,035 Views)
Makes sense now. Since I was controlling the flow through the Error Cluster I figured I was safe. Thanks for the great link.
0 Kudos
Message 8 of 9
(3,026 Views)
I am happy to help! The error cluster is quite useful for controlling the flow of execution, but as you have seen, this does not affect when local variables are read. If you notice, the LabVIEW shared variable has a terminal for the error cluster; data flow is one of many reasons for this feature. Thank you for your time, and good luck with your application!

Mike D.
National Instruments
Applications Engineer
0 Kudos
Message 9 of 9
(3,003 Views)