One of the major problems in PC supported automation systems is deadlock problem.
Sometimes, systems fall into a deadlock, making it impossible to free up without intervention or you can miss your products without recording their information into database.
In this post, I want to give a poor design sample which may cause a deadlock with a presentation.
Next post, we will make a state analysis for a single task station.
Importance of State Analysis In Automation Systems - Part 1
Case Study: Power Measurement System with Accurate Timing
PC Stability
My graduation thesis was about designing a smart card reader / writer circuit and making necessary software development for it. I have tried to design a low cost reader, so I decided to use parallel port of PC instead of using a micro controller.
My advisor encouraged me to develop the software in Linux, that is the story of 'How I met your Linux'. My first experience on linux was on Mandrake Linux 8.
One day, I have wondered how stable was the PC, and decided to make a little test. I have wrote a small software in C and compiled with GCC to produce square wave with the highest frequency that PC can handle.
I have visualised the wave in oscilloscope. PC was able to produce square wave approximately at 200 kHz. Frequency was decreasing as the CPU was loaded, as I expected.
Then I wondered the result in Windows. Rebooted the PC with Windows 98, wrote an equivalent code in assembly and executed. I was expecting to have a little bit higher frequency because code was written in assembly.
Result was surprising for me, it was impossible to lock to the signal to display it on oscilloscope. Frequency was so unsteady that it was impossible to see with auto trigger or manual trigger.
Then I have tried to close some windows and terminated some background processes such as anti-virus. Frequency become more stable but it was still difficult to catch complete cycles more than five seconds. Finally, screen saver disturbed all the frequency.
I have measured the frequency with a frequency counter and it was nearly same as in Linux version, maximum 200 kHz.
Today, we are developing most of the automation projects on Windows operating system, so I wanted to make a small test before sending this post.
I wrote the following code:






