NI Home > Community > NI Discussion Forums
Reply
Member
dzilber
Posts: 17
0 Kudos

Data Input Into Labview from Excel in real-time

Hello,
  I am trying to send data from one program into excel, and from excel into labview, where I will make real-time calculations on this data. I am pretty new to labVIEW, so I am not sure where to start; I think the right direction is ActiveX controls but Im honestly not sure. Perhaps it would be easier to perform the calculations in excel, and import these into Labview?
 The important thing to accomplish is to have labview read the data from excel in real-time. Can anyone tell me how to do this or show me some useful tutorials?
 
     Thank you for your time.
            David
Active Participant
NathanT
Posts: 713
0 Kudos

Re: Data Input Into Labview from Excel in real-time

Hello David,
     ActiveX is probably the tool that you want to use.  Here is a great starting point for learning more:
Integrating Microsoft Excel with National Instruments Software
I also recommend that you take a look at the Excel shipping examples through Example Finder in LabVIEW (Help>>Find Examples>>Search>>search for "Excel").  The more information that you can provide about your application, the better we can help you find resources to help you, so please tell us more.

Cheers,

NathanT
Member
dzilber
Posts: 17
0 Kudos

Re: Data Input Into Labview from Excel in real-time

Alright,
 I have a PowerLab 4/25 EMG device designed to take electromyography signals from human muscles for data acquisition. The device has an advanced filter and amplifier. The program supplied with the hardware is called "Chart 5", also by AD instruments. My goal is to be able to not only view the signals (which is currently possible in chart 5) but to activate a second device when the signals being read dip below a certain threshold. This is where I feel Labview can be helpful; in comparing the signals with the threshold values and taking the appropriate action at the desired time.

 So I have 2 options. The first is to have Chart 5 export the data in real time to Excel, and from excel have it read into labview. The only problem here is that there are now 3 programs running where there could be 1, and more importantly, there will be a delay in signal transfer...so its not fully real-time.

The other option, which is more difficult but if accomplished will yield better results, is to simply have labview read the measurements. I am not sure how to do this, because the only experience I have with data acquisition in labview is with NI-DAQs. This hardware I am supplied with has a built in DAQ and I cannot access anything but the outputs; which are connected to the computer via USB.

So, what would you do? As stated earlier, the second option is likely to be better, but more difficult for me; do I have to install drivers for Labview to work with the specific DAQ in powerlab? Does Labview have USB reader VIS which work with any USB data transfer?

 Thanks for your help so far,
   David
Active Participant
NathanT
Posts: 713
0 Kudos

Re: Data Input Into Labview from Excel in real-time

David,
      Thanks for the description of your system.  Since this device is not supported by National Instrument's drivers, it would probably be possible to write a USB driver for the 4/25 EMG device, but it would be a lot of work on your part.  What I recommend that you look into is accessing "Chart 5" from LabVIEW using ActiveX, effectively taking Excel out of the picture.

I also recommend that you contact the manufacturer and ask them if they have any LabVIEW drivers for this instrument.  You could also look at this site, and see if they sell drivers for your instrument.

Cheers,

NathanT
Member
dzilber
Posts: 17
0 Kudos

Re: Data Input Into Labview from Excel in real-time

Are you sure I can use ActiveX with the chart5 program? Can you give me further instructions on how to do this?
Active Participant
NathanT
Posts: 713
0 Kudos

Re: Data Input Into Labview from Excel in real-time

David,
     No, I am not certain that you can use ActiveX with the Chart 5 program.  I would recommend that you contact support for Chart 5 and inquire whether or not their Chart 5 can be controlled via ActiveX.  For a LabVIEW application to be controlled by ActiveX, it must be enabled as an ActiveX Server.  I would think that this would be true for other applications.  Is this a senior design project?

Have a great weekend,

NathanT
Member
dzilber
Posts: 17
0 Kudos

Re: Data Input Into Labview from Excel in real-time

HI,
 I still have not been able to solve this problem. All I need now is a way for labview to read ONE cell within an excel spreadsheet, which continously changes as data from the chart program comes in. I tried using an ActiveX vi, but it seems to have difficulties and wont refresh the value until I save the excel spreadsheet. Any ideas?

 Thank you!
Active Participant
SamboNI
Posts: 222
0 Kudos

Re: Data Input Into Labview from Excel in real-time

Hi Dzilber,

It should be possible to read updated Excel values from a given cell using ActiveX. For instructions on how to do this, I recommend that you consult this KB, entitled " How Do I Read or Write to Named Cells or Named Ranges in Excel Using the LabVIEW Report Generation T..."

Best regards,
Member
dzilber
Posts: 17
0 Kudos

Re: Data Input Into Labview from Excel in real-time

As a very inexperienced labVIEW programmer, I must admit that the link you sent me does not help me very much. I have labVIEW student editon, and a quick search within the program leads me to beleive that the version I have is not equipped with the Report Generation Toolkit, but I may be wrong. Is this toolkit the only means possible of accomplishing this task? Is there any way I can do this by modifying existing VIs, so that I can import excel values afer making a connection with Excel, in real time?

Any VI that can read changing excel values, whether in one cell or many, would suffice. I would very much appreciate any help.
 

Thanks so far.
 David
Active Participant
SamboNI
Posts: 222
0 Kudos

Re: Data Input Into Labview from Excel in real-time

Hi David,

My apologies, I did not realize that you might not have it. I would like to direct you to some resources to help you, such that you do not have to reinvent the wheel of doing this, since using ActiveX is not as simple as dropping down a single VI.

With that said, it is worth searching these forums and the developer zone (zone.ni.com) for example programs that people have already done.

In actuality, the report generation toolkit uses ActiveX under the hood, and you do not need it to interact with Excel. A quick dev zone search revealed this example program that does not require any toolkits:

http://zone.ni.com/devzone/cda/epd/p/id/2222

Please let me know if it works for you,

Regards,