mirror of
https://github.com/thiagoralves/OpenPLC_v3.git
synced 2026-09-24 07:23:59 +08:00
Added S7 Protocol support
This commit is contained in:
+15
-1
@@ -37,6 +37,10 @@
|
||||
#include "ethercat_src.h"
|
||||
#endif
|
||||
|
||||
#ifdef _snap7
|
||||
#include "oplc_snap7.h"
|
||||
#endif
|
||||
|
||||
#define OPLC_CYCLE 50000000
|
||||
|
||||
extern int opterr;
|
||||
@@ -103,6 +107,7 @@ int main(int argc,char **argv)
|
||||
#endif
|
||||
initializeHardware();
|
||||
initializeMB();
|
||||
|
||||
updateBuffersIn();
|
||||
updateBuffersOut();
|
||||
|
||||
@@ -114,7 +119,11 @@ int main(int argc,char **argv)
|
||||
readPersistentStorage();
|
||||
//pthread_t persistentThread;
|
||||
//pthread_create(&persistentThread, NULL, persistentStorage, NULL);
|
||||
|
||||
|
||||
#ifdef _snap7
|
||||
initializeSnap7();
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifdef __linux__
|
||||
@@ -243,6 +252,11 @@ int main(int argc,char **argv)
|
||||
#ifdef _ethercat_src
|
||||
ethercat_terminate_src();
|
||||
#endif
|
||||
|
||||
#ifdef _snap7
|
||||
finalizeSnap7();
|
||||
#endif
|
||||
|
||||
printf("Disabling outputs\n");
|
||||
disableOutputs();
|
||||
updateBuffersOut();
|
||||
|
||||
Reference in New Issue
Block a user