RSlinx and Excel

wa5yom

Member
Join Date
Sep 2003
Location
Ardmore, Oklahoma
Posts
138
I am collecting data into excel every 30 seconds.
For all you excel experts: How do I save each data point into a separate cell for charting?

Thanks,
Tim
 
This is one of the VBA scripts I've used in the past

Sub Auto_open()
'
' Auto_open Macro
'
Application.OnTime (Time + TimeValue("00:00:10")), "Auto_open"
x = Sheet1.Range("a1")
x = x + 1
If x > 2884 Then x = 3
Sheet1.Range("a1") = x
Sheet1.Range("b" & x) = Sheet1.Range("b1")
Sheet1.Range("c" & x) = Sheet1.Range("c1")
Sheet1.Range("d" & x) = Sheet1.Range("d1")
Sheet1.Range("e" & x) = Sheet1.Range("e1")
Sheet1.Range("f" & x) = Sheet1.Range("f1")
Sheet1.Range("g" & x) = Sheet1.Range("g1")
Sheet1.Range("h" & x) = Sheet1.Range("h1")
Sheet1.Range("i" & x) = Sheet1.Range("i1")
Sheet1.Range("j" & x) = Sheet1.Range("j1")
Sheet1.Range("k" & x) = Sheet1.Range("k1")
Sheet1.Range("l" & x) = Sheet1.Range("l1")
Sheet1.Range("m" & x) = Sheet1.Range("m1")
Sheet1.Range("n" & x) = Sheet1.Range("n1")
Sheet1.Range("o" & x) = Sheet1.Range("o1")
Sheet1.Range("p" & x) = Sheet1.Range("p1")
Sheet1.Range("q" & x) = Sheet1.Range("q1")
Sheet1.Range("r" & x) = Sheet1.Range("r1")
Sheet1.Range("s" & x) = Sheet1.Range("s1")
Sheet1.Range("t" & x) = Sheet1.Range("t1")
Sheet1.Range("u" & x) = Sheet1.Range("u1")
Sheet1.Range("v" & x) = Now()
End Sub

It just copies the top row on to the rows bellow how ever your newest data will always be at the bottom, how do you want your data formated?
 

Similar Topics

Hi, I'm brand new to the forum and spent some time looking around but could not find an answer to my question. I'm using an excel spreadsheet to...
Replies
3
Views
1,337
Hello! I am trying to help a coworker get access to a company dashboard. It runs on my computer and I have set up similar dashboards myself, so...
Replies
4
Views
2,519
Hello All, I know it is possibile to access data from a PLC directly to excel using a OPC link through RSLinx...
Replies
2
Views
1,749
I use dde/OPC to read tag vaule in excel file its working ok when rslinx running NOT as service but when I run rslinx as service I got an error at...
Replies
5
Views
1,943
Sorry if this is off topic, but this is more of a VBA question. I have some data that needs to be collected weekly. I have an excel sheet so that...
Replies
6
Views
2,152
Back
Top Bottom