Merge pull request #63 from justason/master
Add resource finalizing routines.
This commit is contained in:
commit
bc7097e510
|
@ -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
|
// 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
|
// must be updated to reflect the actual Input state. The mutex bufferLock
|
||||||
|
|
|
@ -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)
|
void sendOutput(unsigned char *sendBytes, unsigned char *recvBytes)
|
||||||
{
|
{
|
||||||
long serialTimer;
|
long serialTimer;
|
||||||
|
|
|
@ -269,6 +269,14 @@ void initializeHardware()
|
||||||
searchForIO();
|
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
|
// 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
|
// must be updated to reflect the actual Input state. The mutex bufferLock
|
||||||
|
|
|
@ -822,6 +822,14 @@ void initializeHardware()
|
||||||
pthread_create(&piXtend_thread, NULL, updateLocalBuffers, NULL);
|
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
|
// 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
|
// must be updated to reflect the actual Input state. The mutex buffer_lock
|
||||||
|
|
|
@ -605,6 +605,14 @@ void initializeHardware()
|
||||||
pthread_create(&piXtend_thread, NULL, updateLocalBuffers, NULL);
|
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
|
// 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
|
// must be updated to reflect the actual Input state. The mutex buffer_lock
|
||||||
|
|
|
@ -542,6 +542,14 @@ void initializeHardware()
|
||||||
pthread_create(&piXtend_thread, NULL, updateLocalBuffers, NULL);
|
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
|
// 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
|
// must be updated to reflect the actual Input state. The mutex buffer_lock
|
||||||
|
|
|
@ -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
|
// 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
|
// must be updated to reflect the actual state of the input pins. The mutex buffer_lock
|
||||||
|
|
|
@ -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
|
// 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
|
// must be updated to reflect the actual state of the input pins. The mutex buffer_lock
|
||||||
|
|
|
@ -168,6 +168,14 @@ void initializeHardware()
|
||||||
pthread_create(&thread, NULL, exchangeData, NULL);
|
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
|
// 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
|
// must be updated to reflect the actual Input state. The mutex bufferLock
|
||||||
|
|
|
@ -192,6 +192,14 @@ void initializeHardware()
|
||||||
pthread_create(&ADCthread, NULL, readAdcThread, NULL);
|
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
|
// 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
|
// must be updated to reflect the actual Input state. The mutex buffer_lock
|
||||||
|
|
|
@ -93,6 +93,7 @@ void updateTime();
|
||||||
|
|
||||||
//hardware_layer.cpp
|
//hardware_layer.cpp
|
||||||
void initializeHardware();
|
void initializeHardware();
|
||||||
|
void finalizeHardware();
|
||||||
void updateBuffersIn();
|
void updateBuffersIn();
|
||||||
void updateBuffersOut();
|
void updateBuffersOut();
|
||||||
|
|
||||||
|
|
|
@ -281,6 +281,7 @@ int main(int argc,char **argv)
|
||||||
disableOutputs();
|
disableOutputs();
|
||||||
updateCustomOut();
|
updateCustomOut();
|
||||||
updateBuffersOut();
|
updateBuffersOut();
|
||||||
|
finalizeHardware();
|
||||||
printf("Shutting down OpenPLC Runtime...\n");
|
printf("Shutting down OpenPLC Runtime...\n");
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue