Vai al contenuto
PLC Forum


snap7 & Qt Creator


markolino

Messaggi consigliati

Ciao a tutti,

ho la necessità di usare la mitica libreria snap7 con Qt Creator.

Ora, sul sito di snap7 c'è scritto come fare il rebuild della libreria: fatto, ho snap7.lib e snap7.dll nella relativa cartella.

 

Qualcuno può guidarmi su come andare avanti lato Qt ? Non capisco cosa fare e come aggiungere/usare questi reference nel mio progetto.

 

Grazie a tutti.

Link al commento
Condividi su altri siti


Riporto quanto ho condiviso sul forum ufficiale di Qt Creator. Questa soluzione va bene se utilizzate come SO Windows 

e volete creare una nuova Widget Application.

 

So this are the steps to get it works fine:
1-Compile the library with file .bat to obtain .lib and .dll file.
Follow the instruction on snap7 site, section "rebuild".
2-Copy this 2 file in your folder, where found the exe file of the application
3-Copy the snap7.h and the snap7.cpp file of the library (can you found them in the example folder) in the same folder of your .pro file
3-Add an include snap7.h in your widget.h file and declare a TS7Client object.
4-Add in your .pro file LIBS +="path\to\your\file.dll" and run qmake

 

Remember that if you write or read some data you must swap the byte of the word/longword before you send the request.

 

Spero possa essere di aiuto a qualcuno !

 

 

Modificato: da markolino
Link al commento
Condividi su altri siti

Crea un account o accedi per commentare

Devi essere un utente per poter lasciare un commento

Crea un account

Registrati per un nuovo account nella nostra comunità. è facile!

Registra un nuovo account

Accedi

Hai già un account? Accedi qui.

Accedi ora
×
×
  • Crea nuovo/a...