LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

logging OPC data

Hi everyone,

 

I'm new to OPC and am currently trying to log OPC data.  I've set up my IO Server (OPC Client), and can successfully read the data from the OPC via shared variables and output the results to graphs.  What I'd like to be able to do is also log the data to a spreadsheet via an event (ie start logging when the "start log" button is pressed on the front panel, and stop logging via a "stop log" button)


I've played with the "write traces to spreadsheet file", which seems to work, however I noticed that it pulls ALL of the data since the OPC server has been on.  Also, I noticed that I cannot stop the logging effectively.  Do I need to use the "flush shared variable data.vi" to stop the data logging?  I was wondering if there was a more elegant and efficient way of doing what I need to do.

 

I've browsed the forums and was not able to find exactly what I need.  

 

Also, as a minor asethetic issue, what is the best way to keep ONLY the "tag name" without the whole path for each tag when written to a spreadsheet?

 

Any and all help would be greatly appreciated.

 

Software: Labview 2012, running on Windows 7 32 bit

DSC module purchased

 

This is a very urgent request as I am abroad in Europe and it is my last day here to implement the data logging so that the end user can start their tests.

0 Kudos
Message 1 of 3
(2,805 Views)

The DSC module should already be logging data into the Citadel database. Then it would be a matter of retrieving the data from that database. That is how I used it with the 7.0 version of the DSC module. My upgrade to 2012 should be here this week!!!

0 Kudos
Message 2 of 3
(2,789 Views)

Hi there, assuming that you have the DSC Module you can check the following example. For the tag name, once you have the variable turned into a string you can use the match pattern or the String subset VI to filter the tag name and log it to the file. I hope this helps

Alejandro C. | National Instruments
0 Kudos
Message 3 of 3
(2,781 Views)