LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

EXCEL Real-Time data

Hi 

Microsoft Excel provide a way to view and update data in real time instead of Dynamic Data Exchange (DDE). Its called real-time data (RTD) and used when you want excel act as an client getting constantly changing data such as measurement data. To be able to do this you must create an RTD server and connect it to you LV application. Is it anyone who knows how to do this? Haven't found any support in LV for it.

 

Thanks

Hans-Olov

 

 

0 Kudos
Message 1 of 10
(5,380 Views)

Hans,

 

due to this guide, RTD is based on DCOM.  This articel refers to how to implement an RTD server in C#.

I haven't done such a thing (because why would i use excel at all if i use LabVIEW?) but i'd asume that you could create a LV application with a proper interface and compile it as DLL with ActiveX configured in order to use that DLL directly as RTD server.

 

hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 2 of 10
(5,359 Views)

Thanks for answer!

I was hoping to be able to implement the server in LV but how do I convert the c# code to Labview? I have seen examples in Visual Basic also but I haven't got a compiler and I'm not fluent on windows programming in text languages.

 

I'm surprised that there is so little demand on this functionality. At our company we always use this when running tests. The datacollecting software (LabView) holds present data when our engineers are able to, in there own excel applications, get choosen live data for evaluation. In the past we have used DDE but that is now obsolete. Maybe NI can provide this functionality in the future?

 

Hans-Olov

0 Kudos
Message 3 of 10
(5,341 Views)

hosk1 wrote:
[...] but how do I convert the c# code to Labview?[...]

Hans,

 

it is not possible to convert C# code in LV code. There are two options:

- Reprogram the application in LV following the approach from the C# example (possibly difficult due to different environments)

- Use the example in LV as .NET Server

 


hosk1 wrote:
[...]I'm surprised that there is so little demand on this functionality.[...]

Well, i am not surprised. Excel is not common to be used as frontend for test applications because Excels origins lies in accounting and spreadsheet analysis. So representation of measurements is no domain of Excel (but possible).

Because LV supplies the developer with many functions and indicators for analysis of measurements, there is simply no need to introduce a second tool where issues in interfacing can occur.

I don't think that NI is going to provide further support for Excel with LV because for environments like yours, there exists Measure. The functionality is limited but maybe it suits better to your needs than LV.

In my opinion, Measure is a niche product....and i doubt that it support RTD.

 

hope this helps,

Norbert 

 

Message Edited by Norbert B on 03-04-2009 02:59 AM
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 10
(5,337 Views)

Unfortunately this has turned to a discussion why instead of how.

I try to explain: At our company with 2300 employees almost everybody have access to Excel. At the development department with 300 employers I'm sure that everybody are quite good at using Excel and for the people involved (approx. 50) in component and prototype testing are very fluid using it. At my department we are responsible to deliver and support measurement equipment. We have developed Labview software adapted for our equipment and usage and we have found that for a interface between us and the mechanical engineers for online evaluation is Excel very good. In the very beginning when we started using Labview for 15 years ago we thought that everybody involved in testing could develop there own applications. In parallell, we at our department developed a library with functions that the laboratory people could use to put together testprogram. That failed because LV is not so easy, people forget and it turned in to be very ineffective.

Well, NI have tools for Excel like Measure but that not sufficient for us.

 

So I'm sitting her, people wants to have online data in there excel cells and I can't deliver it. I can't tell them that "representation of measurements in Excel is not is no domain of Excel" and forced them to build applications in Labview instead. And who will pay for the purchase of high number of LV licenses and training of maybe 50 people. And what about the extra time it will take...............

 

Back to the main issue:

I have build a LV client application that use "shared variables" that work very good over network. Under one tab I have a list with all data and in the next tab the user can configure trends. Is it possible to in a new tab embed an Excel sheet and working with it? I mean, it's possible but does it work? It seems to be limited functionallity.

 

/Hans-Olov   

0 Kudos
Message 5 of 10
(5,314 Views)

Hi again

I have tested the embedded Excel object. It's possible for me to write my LV data in excel cells and there is a button to export contents from the embedded sheet to Excel. Is it possible to configure the applications to exchange data between the web component and the excel application continuously??  If possible that will solve my problem!

 

/Hans-Olov

0 Kudos
Message 6 of 10
(5,310 Views)

Hans,

Unfortunately this has turned to a discussion why instead of how.

Not really. I only stated that i think that the approach using Excel as frontend is not the best. This is mainly because Excel does not support many features which are mandatory for data acquisition and measurement analysis.

 

Nevertheless, given your setup, you have to consider the following points:

a) Excel supports different interfaces: ActiveX, .NET and using VB access to all interfaces available in VB (and of course DDE).

b) LV itself is accessable using ActiveX

c) Shared Variables are available mainly to provide data between different applications capable of accessing them. Excel is not capable of this. Examples for working environments are: LV, OPC,  .NET and CVI using DataSocket.

d) It might be possible to access Shared Variables using DataSocket in VB (this thread might help) in order to display data in Excel. I have never tried this.

e) It might be easier to control Excel from LV, not the other way round. There are plenty of examples available for LV controlling Excel using ActiveX. You'd maybe consider using the office report generation toolkit for this.

 

As a summary:

- LV does not inherently support RTD. If you want to use that interface, you have to implement it. Examples are availble for this in the internet, at least for C#. Those examples have to be reprogrammed using LV.

- There are other ways to interface between Excel and LV. All of them have advantages and disadvantages.

- If the aim is that Excel is the frontend capable of controlling a LV application, i suggest using a VBScript for this.

- If the aim is to represent measurement values in Excel, but the startpoint could be an executable other than Excel.exe, i suggest using LV to open/supply Excel with data using either ActiveX or reporting functions.

 

hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 7 of 10
(5,307 Views)

Why to use excel when you are using labview? Here is the answer: suppose you have a Labview application that is running, and let’s say you want to do some calculation on the data that is being acquired. If the calculation requires some mathematical function and you didn’t implement that function beforehand in labview. To do that calculation, you have to stop labview, implement the calculation, and get the result. What if you need to do another calculation while labview application is running and the functionality was not implemented. Just imagine you are acquiring data from 2 sensors in labview and you want to multiply them. Then what you do is pull out the calculator because if you didn’t specifically implement multiplication function in your labview application, you have no other choice than to resort to the calculator that comes with Windows or to do the multiplication by hand. This is where excel comes in handy and with dde communication between excel and labview, it was very easy. Microsoft doesn’t support dde anymore due to security issues. And the activex functions doesn’t provide smooth communication with excel, if data is updating in excel, unlike dde it simply crashes if the user wants to play with that data in excel. Microsoft says rtdserver is the replacement for dde. It is unfortunate that labview doesn’t provide support for this protocol.

0 Kudos
Message 8 of 10
(1,848 Views)

Hello, 

I understand your situation where not everyone has access to LabView but in general everyone does have access to Excel. Can you use a database that LabVIEW and Excel can both connect to? 

______________________________________________________________
Have a pleasant day and be sure to learn Python for success and prosperity.
0 Kudos
Message 9 of 10
(1,833 Views)

Hi,

I did not write the previous reply because not everyone has access to labVIEW but because I felt like someone said to avoid excel if you are using labview that makes no sense to me. Based on that logic, then we should not even store data acquired in LabVIEW to csv which we generally use excel to analyze even if we have labVIEW. I believe we should take advantage of all the software that we have in our hand.

Of course we can use LabVIEW and Excel that can both connect to depending on the situation but I am not sure if excel is stable when we play with that data in real time. If LabVIEW provided dde support in the past, it would have been nice it would have provided rtd server support as well.  

0 Kudos
Message 10 of 10
(1,792 Views)