diff --git a/webserver/core/hardware_layers/blank.cpp b/webserver/core/hardware_layers/blank.cpp index 1bdf091..62b2a20 100755 --- a/webserver/core/hardware_layers/blank.cpp +++ b/webserver/core/hardware_layers/blank.cpp @@ -41,6 +41,14 @@ void initializeHardware() { } +//----------------------------------------------------------------------------- +// This function is called by the main OpenPLC routine when it is finalizing. +// Resource clearing procedures should be here. +//----------------------------------------------------------------------------- +void finalizeHardware() +{ +} + //----------------------------------------------------------------------------- // This function is called by the OpenPLC in a loop. Here the internal buffers // must be updated to reflect the actual Input state. The mutex bufferLock diff --git a/webserver/core/hardware_layers/fischertechnik.cpp b/webserver/core/hardware_layers/fischertechnik.cpp index 34996db..4b02783 100755 --- a/webserver/core/hardware_layers/fischertechnik.cpp +++ b/webserver/core/hardware_layers/fischertechnik.cpp @@ -58,6 +58,14 @@ void initializeHardware() } } +//----------------------------------------------------------------------------- +// This function is called by the main OpenPLC routine when it is finalizing. +// Resource clearing procedures should be here. +//----------------------------------------------------------------------------- +void finalizeHardware() +{ +} + void sendOutput(unsigned char *sendBytes, unsigned char *recvBytes) { long serialTimer; diff --git a/webserver/core/hardware_layers/neuron.cpp b/webserver/core/hardware_layers/neuron.cpp index 5613fbc..4916470 100755 --- a/webserver/core/hardware_layers/neuron.cpp +++ b/webserver/core/hardware_layers/neuron.cpp @@ -269,6 +269,14 @@ void initializeHardware() searchForIO(); } +//----------------------------------------------------------------------------- +// This function is called by the main OpenPLC routine when it is finalizing. +// Resource clearing procedures should be here. +//----------------------------------------------------------------------------- +void finalizeHardware() +{ +} + //----------------------------------------------------------------------------- // This function is called by the OpenPLC in a loop. Here the internal buffers // must be updated to reflect the actual Input state. The mutex bufferLock diff --git a/webserver/core/hardware_layers/pixtend.cpp b/webserver/core/hardware_layers/pixtend.cpp index df1a113..c2097ff 100755 --- a/webserver/core/hardware_layers/pixtend.cpp +++ b/webserver/core/hardware_layers/pixtend.cpp @@ -822,6 +822,14 @@ void initializeHardware() pthread_create(&piXtend_thread, NULL, updateLocalBuffers, NULL); } +//----------------------------------------------------------------------------- +// This function is called by the main OpenPLC routine when it is finalizing. +// Resource clearing procedures should be here. +//----------------------------------------------------------------------------- +void finalizeHardware() +{ +} + //----------------------------------------------------------------------------- // This function is called by the OpenPLC in a loop. Here the internal buffers // must be updated to reflect the actual Input state. The mutex buffer_lock diff --git a/webserver/core/hardware_layers/pixtend2l.cpp b/webserver/core/hardware_layers/pixtend2l.cpp index 072c7e4..90e5687 100644 --- a/webserver/core/hardware_layers/pixtend2l.cpp +++ b/webserver/core/hardware_layers/pixtend2l.cpp @@ -605,6 +605,14 @@ void initializeHardware() pthread_create(&piXtend_thread, NULL, updateLocalBuffers, NULL); } +//----------------------------------------------------------------------------- +// This function is called by the main OpenPLC routine when it is finalizing. +// Resource clearing procedures should be here. +//----------------------------------------------------------------------------- +void finalizeHardware() +{ +} + //----------------------------------------------------------------------------- // This function is called by the OpenPLC in a loop. Here the internal buffers // must be updated to reflect the actual Input state. The mutex buffer_lock diff --git a/webserver/core/hardware_layers/pixtend2s.cpp b/webserver/core/hardware_layers/pixtend2s.cpp index f8e7218..3afe013 100755 --- a/webserver/core/hardware_layers/pixtend2s.cpp +++ b/webserver/core/hardware_layers/pixtend2s.cpp @@ -542,6 +542,14 @@ void initializeHardware() pthread_create(&piXtend_thread, NULL, updateLocalBuffers, NULL); } +//----------------------------------------------------------------------------- +// This function is called by the main OpenPLC routine when it is finalizing. +// Resource clearing procedures should be here. +//----------------------------------------------------------------------------- +void finalizeHardware() +{ +} + //----------------------------------------------------------------------------- // This function is called by the OpenPLC in a loop. Here the internal buffers // must be updated to reflect the actual Input state. The mutex buffer_lock diff --git a/webserver/core/hardware_layers/raspberrypi.cpp b/webserver/core/hardware_layers/raspberrypi.cpp index 4ce6759..8ddcd9f 100755 --- a/webserver/core/hardware_layers/raspberrypi.cpp +++ b/webserver/core/hardware_layers/raspberrypi.cpp @@ -99,6 +99,14 @@ void initializeHardware() } } +//----------------------------------------------------------------------------- +// This function is called by the main OpenPLC routine when it is finalizing. +// Resource clearing procedures should be here. +//----------------------------------------------------------------------------- +void finalizeHardware() +{ +} + //----------------------------------------------------------------------------- // This function is called by the OpenPLC in a loop. Here the internal buffers // must be updated to reflect the actual state of the input pins. The mutex buffer_lock diff --git a/webserver/core/hardware_layers/raspberrypi_old.cpp b/webserver/core/hardware_layers/raspberrypi_old.cpp index 34436ea..2560ae5 100755 --- a/webserver/core/hardware_layers/raspberrypi_old.cpp +++ b/webserver/core/hardware_layers/raspberrypi_old.cpp @@ -99,6 +99,14 @@ void initializeHardware() } } +//----------------------------------------------------------------------------- +// This function is called by the main OpenPLC routine when it is finalizing. +// Resource clearing procedures should be here. +//----------------------------------------------------------------------------- +void finalizeHardware() +{ +} + //----------------------------------------------------------------------------- // This function is called by the OpenPLC in a loop. Here the internal buffers // must be updated to reflect the actual state of the input pins. The mutex buffer_lock diff --git a/webserver/core/hardware_layers/simulink.cpp b/webserver/core/hardware_layers/simulink.cpp index b0b486f..727356b 100755 --- a/webserver/core/hardware_layers/simulink.cpp +++ b/webserver/core/hardware_layers/simulink.cpp @@ -168,6 +168,14 @@ void initializeHardware() pthread_create(&thread, NULL, exchangeData, NULL); } +//----------------------------------------------------------------------------- +// This function is called by the main OpenPLC routine when it is finalizing. +// Resource clearing procedures should be here. +//----------------------------------------------------------------------------- +void finalizeHardware() +{ +} + //----------------------------------------------------------------------------- // This function is called by the OpenPLC in a loop. Here the internal buffers // must be updated to reflect the actual Input state. The mutex bufferLock diff --git a/webserver/core/hardware_layers/unipi.cpp b/webserver/core/hardware_layers/unipi.cpp index 146a992..558324b 100755 --- a/webserver/core/hardware_layers/unipi.cpp +++ b/webserver/core/hardware_layers/unipi.cpp @@ -192,6 +192,14 @@ void initializeHardware() pthread_create(&ADCthread, NULL, readAdcThread, NULL); } +//----------------------------------------------------------------------------- +// This function is called by the main OpenPLC routine when it is finalizing. +// Resource clearing procedures should be here. +//----------------------------------------------------------------------------- +void finalizeHardware() +{ +} + //----------------------------------------------------------------------------- // This function is called by the OpenPLC in a loop. Here the internal buffers // must be updated to reflect the actual Input state. The mutex buffer_lock diff --git a/webserver/core/ladder.h b/webserver/core/ladder.h index 9944476..44b846b 100755 --- a/webserver/core/ladder.h +++ b/webserver/core/ladder.h @@ -93,6 +93,7 @@ void updateTime(); //hardware_layer.cpp void initializeHardware(); +void finalizeHardware(); void updateBuffersIn(); void updateBuffersOut(); diff --git a/webserver/core/main.cpp b/webserver/core/main.cpp index 6436ed4..ab99cea 100755 --- a/webserver/core/main.cpp +++ b/webserver/core/main.cpp @@ -281,6 +281,7 @@ int main(int argc,char **argv) disableOutputs(); updateCustomOut(); updateBuffersOut(); + finalizeHardware(); printf("Shutting down OpenPLC Runtime...\n"); exit(0); }