How to use S7ProSimLib

xieyanji

Member
Join Date
Aug 2009
Location
xiamen
Posts
6
Hi All:

I feel puzzle, when I writed the simple code as follow in VB 6.0, it always inform "lock of funtion or variabel".

I don't why, please help me.
Thank you very much! have a nice day.

code:
------------------------------------------------------------
Option Explicit
Private WithEvents S7ProSim1 As S7PROSIMLib.S7ProSim

Private Sub Form_Load()
Dim S7ProSim1 As S7ProSim
MsgBox S7ProSim1.Connect()
End Sub
------------------------------------------------------------

PS: I have already added "S7ProSim COM Object" as a reference.
 
sorry everybody;

i make a mistake in translation
the compiler error is: "Compiler error :Expected Function or Variable"

i hope somebody can help me out.thank you.
 
Hi,
I'm not familiar with VB (I used the S7ProSim only with C#), but why don't you use the sample code from the manual?

Option Explicit
Private WithEvents S7ProSim As S7PROSIMLib.S7ProSim
...
Private Sub Form_Load()
Set S7ProSim = New S7PROSIMLIB.S7ProSim
...
End Sub



Thomas
 
Thank you Thomas,

Actually I also create a program by used the sample code according to the manual, but it still can't work. That’s what makes me puzzle.

But thank you all the same. I will try to get more information from the help files.

Good day!
 
Back
Top Bottom