LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data Logging: Where do I start?

Here's what I am trying to do:
 
We have a large automated piece of equipment at our plant.  Basically, it processes spooled tubing in a variety of ways, but the final station is for flow testing.  All of the components are controlled through an Allen Bradley PLC unit.  I have the PLC connected to this computer and RSLinx is being utilitzed for data transfer.
 
There are four tags that I need to have logged in an Excel spreadsheet (Actually, any speadsheet will do).  These four tags/variables are the four test results from the flow test stage:  Four pieces of processed tubing are tested for flow rates and compared to customer-supplied references.  The result is returned as a ratio of Processed Piece Flow to Reference Piece Flow.  So, a perfect piece registers as a 1.000 and a bad piece is anything < .9600 and > 1.0400 for a ratio.
 
Unfortunately, the cycle times differ from job to job.  They range from 21 seconds to 46 seconds per cycle.
 
I can see the tags I want to log in LabView, but I am VERY confused as to how I can log them.  That's all I want to do.  I don't need a computer-based interface for the PLC since we have a touch-screen panel (PanelView Plus 1000 by AB) for that.  Here's an example of a variable location:
 
opc://localhost/RSLinx OPC Server/[PLC NAME]TEST_RESULT_A
Obviously, PLC NAME is the name of the PLC in brackets:  I'm not including it because of company policy.
 
Again, I only want to log these four variables.  That's it.  I want to log them ONCE per cycle. So, I found a variable that changes twice per cycle:  From 0 to 1 and 1 to 0.  This is done when a robot lifts the four pieces to be tested.  When the robot finishes testing, the variable switches to 1.  I want to log the four test-result variables when the end_test variable switches to 1. 
 
First off, is this possible?
Secondly, I can't get Measurement + Automation Explorer to work, so is this something that I can do without it?
 
Any help would be appreciated.
 
Thanks in advance,
Chris
0 Kudos
Message 1 of 12
(2,896 Views)
First of all you don't need MAX (Measurement and Automation Explorer).

Second:

Yes, its possible to do what you want.

As file format I would suggest a Tab-delimited file, since most of the spreadsheet apps can deal with them and its standard.

The "Write to text file.vi" example that comes with LV shows you have to create a tab-delimited file. At least in LV 8.2.

Regards,

André
Regards,
André (CLA, CLED)
0 Kudos
Message 2 of 12
(2,888 Views)
Thanks!  I'll try that right now. 
 
I was worried that not having MAX would affect things, but apparently not.  I downloaded the driver CD yesterday and installed everything as well.
 
I'll let you know how it turns out!
0 Kudos
Message 3 of 12
(2,886 Views)
Wow, I didn't realize that the process was so complicated...
 
In which terminal can I specifiy what tag to pull from the PLC?
0 Kudos
Message 4 of 12
(2,881 Views)
I'm sorry.



@Squirrell wrote:
Wow, I didn't realize that the process was so complicated...
 

Which part of the process to you mean? (Getting the values, writing to file or both)



@Squirrell wrote:
 
In which terminal can I specifiy what tag to pull from the PLC?



I thought you already knew how to get the values of the PLC variables in LV. Which VI are planning to use to get the values?

Regards,

André
Regards,
André (CLA, CLED)
0 Kudos
Message 5 of 12
(2,868 Views)

Hahaha it's no problem that it's complicated...  It's a good way to learn, right?

My dilemma is that I have the address for the variables in LV.  I used Browse to OPC item/server and found the variables I needed.

What is my next step to get LV to even SEE these variables?

Thanks for your help, by the way.

0 Kudos
Message 6 of 12
(2,865 Views)
In version 8 and up you are able to read OPC variables by binding them to a Shared Variable.

Add a new variable to you project and bind it to a network variable, the OPC items should turn up in the list.

Regards,

André
Regards,
André (CLA, CLED)
Message 7 of 12
(2,860 Views)

Ok, I'm doing that now.  I didn't see the OPC items in the list, so I just copied in the tag location I received from "Browse OPC Item" back on the main page...

 

I hope that works...

 

That, and I'm not very familiar with the heirarchy of things in LV.  I mean, there's VIs, LLB, LVProj, etc etc and I think I'm getting way in over my head here.  Smiley Indifferent

 

Still, thanks for your help, and I'll keep trying at this until I get it working!!

0 Kudos
Message 8 of 12
(2,852 Views)
Ok, so here's where I am now:
 
I created a variable.  Unfortunately, the OPC server does not appear in the "browse" option for binding the variable to a OPC tag.  So, I copied that path from the "Browse to OPC item.VI" example.  I can easily find the tag in there, but nowhere else.  I copied the tag path into the bind path.  I tried running this JUST to view the current value and it did not work.
 
Any ideas?
0 Kudos
Message 9 of 12
(2,819 Views)
The OPC items did not show up in the browse list.  I added a new variable called "TEST_RESULT_A" which is also the same name as the tag I want to monitor.
 
I went to the variable's properties and selected "Bind to Source."  I clicked browse and only my computer showed up as a directory (Network Item).
 
What should I do? 
0 Kudos
Message 10 of 12
(2,805 Views)