Ciao a tutti,

ho un "vecchio" software in VB6 che comunica con una serie di PLC tramite le librerie APPLICOM, in particolare utilizzando i seguenti metodi:
Declare Sub exitbus Lib "applicom" (stat As Integer)
Declare Sub initbus Lib "applicom" (stat As Integer)
Declare Sub writeword Lib "applicom" (chan As Integer, Nes As Integer, nb As Integer, tadr As Long, tabl As Integer, stat As Integer)
Declare Sub readword Lib "applicom" (chan As Integer, Nes As Integer, nb As Integer, tadr As Long, tabl As Integer, stat As Integer)
Declare Sub readdword Lib "applicom" (chan As Integer, Nes As Integer, nb As Integer, tadr As Long, tabl As Long, stat As Integer)
Declare Sub readpackbyte Lib "applicom" (chan As Integer, Nes As Integer, nb As Integer, tadr As Long, tabl As Byte, stat As Integer)
Declare Sub writepackbyte Lib "applicom" (nchan As Integer, Nes As Integer, nb As Integer, adr As Long, tabl As Byte, stat As Integer)
Declare Sub getpackbyte Lib "applicom" (ncard As Integer, nb As Integer, tadr As Integer, tabl As Byte, stat As Integer)
Declare Sub setpackbyte Lib "applicom" (ncard As Integer, nb As Integer, tadr As Integer, tabl As Byte, stat As Integer)
Declare Sub setword Lib "applicom" (ncard As Integer, nb As Integer, tadr As Integer, tabl As Integer, stat As Integer)

Si è deciso di cambiare l'architettura della rete per motivi di espandibilità e "Switchare" passando alle librerie Siemens OPC.



Avendo tempi stretti vorrei cercare di creare una sorta di Adapter (l'applicativo è scritto con codice procedurale non OO) dei metodi APPLICOM.



Non ho trovato niente per VB6, ma ho trovato un esempio per VBA:
https://support.industry.siemens.com...dti=0&lc=en-WW



Da questo esempio ho visto che non è possibile leggere direttamente il registro num x e che non esistono metodi per leggere direttamente word, packetbyte etc...ma un unico metodo read.

Inoltre dovrei configurare tramite un qualche Software Siemens (Ho installato tutto il contenuto del CD ma non ho bene idea di quale sia il programma da utilizzare tra tutti quelli presenti) "mappare" i PLC ed i vari registri secondo la logica di Gruppi ed GroupItems che "vuole" siemens...



Qualcuno ha idea di come districarmi tra i programmi Siemens?



Vi ringrazio in anticipo!!!