VC++ application for PCB machine automation

A

Thread Starter

Anonymous

APPLICATION:
To run two processes simultaneously

Brief Description of Project
64 i/os are interfaced using 8 i/o modules that communicate with PC via RS232/RS485 converter. Modules are microcontroller based which give input data to PC coming from the machine and pass on the output data generated by the PC, back to the machine.

The code is written in VC++ and used multithreading for parallel process. The operation needs some TIMERS for wait process.

Following are the queries:
1. The process demands TIMERS are to be continuously monitored for elapsed time and saved in an .ini file format when thread is in running state. Can anyone suggest the right method of doing so?

2. Only two threads are being used. Here, we are using ‘SwitchToThread()’ function to switch the system resources between two processes. Is this the right method ?

Following is the brief code we have used::

CreateThread() T1 // in SDK DLL
{
Function1(); // To read the .ini file for process 1
{
SwitchToThread();
}
}

CreateThead() T2 // in SDK DLL
{
Function2(); // To read .ini file for process 2
{
SwitchToThread();
}
}

Please spare some time and give me your valuable suggestions.
 
Top