Link to home
Start Free TrialLog in
Avatar of cckleong
cckleong

asked on

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

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??
Avatar of leechoonhwee
leechoonhwee

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.
Avatar of cckleong

ASKER

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.
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.
u are correct both times. but what about DDE....wouldnt that do it?
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
anyone has any idea???
I SOLVED IT.....
ASKER CERTIFIED SOLUTION
Avatar of cckleong
cckleong

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial