|
| Migrate vb.net code to windev - use of the library S7.Net |
| Iniciado por ROMULUS001, 21,jun. 2016 16:18 - No hay respuesta |
| |
| | | |
|
| |
Miembro registrado 352 mensajes |
|
| Publicado el 21,junio 2016 - 16:18 |
Greetings everyone,
I made up a vb.net code, now, I'm trying to migrate it into wlangage. In my project, I'm using this .Net library : https://www.dropbox.com/s/69dffveoxqyh2b2/S7.Net.dll…
And here is the VB.NET code I'm trying to migrate into wlangage :
Dim MyPLC As New Plc MyPLC = New MyPLC(CpuType.S7400, "xxx.xxx.x.x", 0, 3) Dim l_errorPLC As S7.Net.ErrorCode = MyPLC.Open() Select Case l_errorPLC Case ErrorCode.NoError MsgBox("it works!!!") Case ErrorCode.ConnectionError MsgBox("Connection error") Case ErrorCode.IPAddressNotAvailable MsgBox("IP address not found") Case ErrorCode.WrongCPU_Type MsgBox("CPU type error") Case ErrorCode.WrongVarFormat MsgBox("Format error") Case Else MsgBox("Unknown error") End Select
My wlangage code is this code :
gf_PLC is S7.Net.Plc dynamic gf_PLC=new S7.Net.Plc(20,"xxx.xxx.x.x", 0, 3)
I do have a syntax error between Net and Plc. Thanks PS: in vb.net code, I can see CpuType.S7400 is 20 |
| |
| |
| | | |
|
| | | | |
| | |
|