Solved

data collection from siemens S7-200 controller using VB and excel

Posted on 2004-04-30
9
723 Views
Last Modified: 2012-05-04
i have a siemens s7-200 controller talking to a VB application. the inputs to the controller shows up on the VB form which ive created.

How can i link an excel spreadsheet to the VB application so that the "date and time" of changes to the values in the VB controls are sent to an excel spreadsheet??
0
Comment
Question by:cckleong
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 2
9 Comments
 
LVL 9

Expert Comment

by:leechoonhwee
ID: 10965915
Well...the excel part can be done out of the VB. Just export your data to a DB and you can use Microsoft Query to query and display the data in excel.
0
 

Author Comment

by:cckleong
ID: 10967505
uhhhh no.....i m using vb as my frontend for the controller.

i want vb to write data from my controller into an already opened excel spreadsheet.
0
 
LVL 9

Expert Comment

by:leechoonhwee
ID: 10973996
I dun think VB can send the data to an open excel cuz it will be locked by excel and an error will be generated. You can however, force the program to open an excel whenever there is an update but I dun think that is productive and operationally viable.
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

Author Comment

by:cckleong
ID: 10979324
u are correct both times. but what about DDE....wouldnt that do it?
0
 

Author Comment

by:cckleong
ID: 10981760
This is as far as i know how to go.......it works but everytime the event changes it overwrites the previous. i want it to go to the next row on the spreadsheet so that i dont lose the previous information.

help me.....please


Dim Message As Variant

Private Sub BtnFreezer1High_Change()

    If BtnFreezer1High.Value = False Then
        Message = "Freezer 1 High"
    Else
        Message = "Freezer 1 OK"
    End If

txtArchive.LinkMode = 0
txtArchive.LinkTopic = "Excel|MyBook.xls"
txtArchive.LinkItem = "R1C1"
txtArchive.LinkMode = 1

txtArchive.Text = Date & " " & Time() & " " & Message

txtArchive.LinkPoke

txtArchive.LinkExecute "[SELECT(""R2C1"")]"

txtArchive.LinkMode = 0

End Sub
0
 

Author Comment

by:cckleong
ID: 10998031
anyone has any idea???
0
 

Author Comment

by:cckleong
ID: 11015306
I SOLVED IT.....
0
 

Accepted Solution

by:
cckleong earned 0 total points
ID: 11078438
My solution using DDE

Dim Message As Variant

Private Sub BtnFreezer1High_Change()

    If BtnFreezer1High.Value = False Then
        Message = "Freezer 1 High"
    Else
        Message = "Freezer 1 OK"
    End If

txtArchive.LinkMode = 0
txtArchive.LinkTopic = "Excel|MyBook.xls"
txtArchive.LinkItem = "R[-1]C1"                'links the cell above the active cell
txtArchive.LinkMode = 1

txtArchive.Text = Date & " " & Time() & " " & Message

txtArchive.LinkPoke

txtArchive.LinkExecute "[SELECT(""R[1]C"")]"                     'makes the cell below active

txtArchive.LinkMode = 0

End Sub
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question