SlideShare a Scribd company logo
IT-215
         System Software
          Project Report

   Submitted on: 16th April 2012



     Simulation of
manufacture of Sulphuric
         Acid

  Guided By: Prof. Sanjay Chaudhary
   Mentored By: Anadi Chaturvedi




                      Submitted By:
                      Prashant Pandey (201001067)
                      Swena Gupta     (201001104)
Goal
To simulate process automation for a manufacturing plant

Problem Statement
Assume that there is a manufacturing plant, which
manufactures finished products based on processing on raw
materials. There are few machines in the plant. Each
machine inputs raw materials, performs processing and
produces semi-finished product, which is supplied as input
or raw material to another machine. Thus, there is a chain of
machines which are involved in the process inputting raw
materials or semi-finished product and produces semi-
finished product. Finally finished product will be the final
output. Each machine is to be simulated as a process. Various
processes can be initiated independently of each other and
executed in background. Each process may take input from a
specific named pipe and write output as a processed semi-
finished product on some other named pipe. Define the
sequence of actions among 5-7 such machines, define the
flow input and output among them. One machine should be
identified as a machine, which generates finished product,
i.e. gray cloth. Each machine operates under certain
environmental conditions, i.e. machine should be operated
within the range of temperature. If temperature level of any
of the machine is more than the upper limit then it should


                               1
generate signal and send it to the main controlling machine,
which will inform all other machines to stop operations.


Concepts Used
     • Multiple Threading
     • Mutual Exclusion and Condition Variables
     • Inter Process Communication using Pipes
     • Signal Handling and Processing
     • Accessing System time.


Programming Language
C Language inclusive of concepts of Shell Programming.


      used
Tools used
gcc compiler.


Header Files Used
1)     #include <stdio.h>
       This header file contains declarations used in most input
       and output and is typically included in all C programs.
       eg. printf() etc.
2)     #include <stdlib.h>
       This header file contains Utility functions.
       eg. exit() etc.


                                 2
3)    # include <pthread.h>
      This header file defines the threads and its functions.
      eg. pthread_create() etc.
4)    #include <signal.h>
      To catch the various signals implemented in our
      program, we have included <signal.h> because it
      contains sigaction as a structure.
5)     #include <string.h>
      This header file contains String functions.
      eg. strlen()
6)     #include <time.h>
      This header file contains implementation of date and
      time manipulation operations.


Test Programs
a)
time_t now;
time (&now);
printf ("nn%snn", ctime (&now));
//the above code snippet has been used to access system time.
b)
act.sa_handler = catchint;
sigfillset(&(act.sa_mask));
sigaction(SIGINT , &act, NULL);
sigaction(SIGUSR1 , &act, NULL);
void catchint(int signo) // handler for sigaction

                                       3
{
      if(signo==SIGINT)
      printf("nn'Ctrl+C' pressed...Interrupt generated and
ignored!!!nn");
      if(signo==SIGQUIT)
      .
      .
      .
      .
}
// The above code snippet is used to call signals at various
activities of user such as pressing Ctrl+C to generate SIGINT
etc. and to handle them using catchint function.
c)
if(pthread_create(&control_thread, NULL, control_machine, (void *)
quantity)!=0)
{
      printf("Failed to create a threadn");
      exit(1);
}
      pthread_join(control_thread, NULL);


// The above part of program is used to create threads and to
join them
d)
pipe (p);
write (p[1], write_msg, 60);
read(p[0], read_msg, 60);
// the above statements are used to declare and do read-write
operation on a named pipe.
                                        4
e)
pthread_mutex_lock (&count_lock);
while (taskid >= COUNT)
{
     pthread_cond_wait (&count_cond, &count_lock);
}
pthread_cond_broadcast (&count_cond);
pthread_mutex_unlock (&count_lock);


//the above statements are used to put mutual exclusion
amongst all the threads and to make all other threads wait
while one thread is executing.


Assumptions
1.    The Initial & Favourable specifications of machines are
pre-defined as stated in program (while we run the
program, it displays on the console).


2.   According to the code made by us, the specifications has
been set, so that if the required amount is > 3 litres, all the 5
stage proccess machines gets overheated & production of 4th
lts onwards acid needs to cool each machine. This has been
shown appropriately while production of 4th litre and
onwards acid production.




                                    5
3.     This has been done deliberately to introduce and
show the concept of temperature in our machine automated
manufacturing-plant system.


4.     Following SIGNALS have been handled in our program
         a. SIGINT : signal called for handling Ctrl+C.
         b. SIGQUIT : signal called for handling Ctrl+
         c. SIGALRM : signal called for production of next litre
of acid.
         d. SIGWINCH: signal called when output terminal
window size is changed.
         e. SIGTSTP : signal called for handling Ctrl+Z.
         f. SIGUSR1 : signal called if the user enters invalid
input.


List of Programs

     • final_manufacture.c

Log Files
     • log_for_3_litres_prodn
     • log_for_6_litres_prodn
     • log_for_9_litres_prodn
     • log_for_wrong_user_input
     • log_with_all_signals_handled_6_litres


                                  6

More Related Content

What's hot (17)

PPTX
How c program execute in c program
Rumman Ansari
 
PPTX
C++20 features
LogeekNightUkraine
 
PDF
20BCE1734.pdf
Mridul Jadon
 
PPTX
Programming in C
Nishant Munjal
 
PPT
Removal Of Recursion
Richa Sharma
 
PPTX
Signal
Mohammed Sikander
 
DOCX
Assignment no 5
nancydrews
 
PPTX
03. operators and-expressions
Stoian Kirov
 
PPTX
3 operators-expressions-and-statements-120712073351-phpapp01
Abdul Samee
 
PPTX
Loops in c
shubhampandav3
 
PPTX
Synapse india dotnet development overloading operater part 3
Synapseindiappsdevelopment
 
PPTX
My first program in c, hello world !
Rumman Ansari
 
PDF
[CCC'21] Evaluation of Work Stealing Algorithms
Universidad de los Andes
 
PPTX
1 introduction to c program
NishmaNJ
 
PPTX
Tail Recursion in data structure
Rumman Ansari
 
PPTX
C program to write c program without using main function
Rumman Ansari
 
How c program execute in c program
Rumman Ansari
 
C++20 features
LogeekNightUkraine
 
20BCE1734.pdf
Mridul Jadon
 
Programming in C
Nishant Munjal
 
Removal Of Recursion
Richa Sharma
 
Assignment no 5
nancydrews
 
03. operators and-expressions
Stoian Kirov
 
3 operators-expressions-and-statements-120712073351-phpapp01
Abdul Samee
 
Loops in c
shubhampandav3
 
Synapse india dotnet development overloading operater part 3
Synapseindiappsdevelopment
 
My first program in c, hello world !
Rumman Ansari
 
[CCC'21] Evaluation of Work Stealing Algorithms
Universidad de los Andes
 
1 introduction to c program
NishmaNJ
 
Tail Recursion in data structure
Rumman Ansari
 
C program to write c program without using main function
Rumman Ansari
 

Viewers also liked (9)

PDF
Современные материалы для пассивного дома
Ingvar Lav
 
PPS
Sweet life
Hiba Alessa
 
PDF
Lab report 201001067_201001104
swena_gupta
 
PDF
Lab report 201001067_201001104
swena_gupta
 
PPTX
Incorporating multimedia in differentiated instruction
ewalterjr
 
PPTX
CakePHP3使ってみて
Tatsuya Inamura
 
PPT
умный дом презентация
Ingvar Lav
 
DOCX
Manual epson
Diego Fernando Perea
 
PDF
применение солнечной энергии для теплоснабжения объектов
Ingvar Lav
 
Современные материалы для пассивного дома
Ingvar Lav
 
Sweet life
Hiba Alessa
 
Lab report 201001067_201001104
swena_gupta
 
Lab report 201001067_201001104
swena_gupta
 
Incorporating multimedia in differentiated instruction
ewalterjr
 
CakePHP3使ってみて
Tatsuya Inamura
 
умный дом презентация
Ingvar Lav
 
Manual epson
Diego Fernando Perea
 
применение солнечной энергии для теплоснабжения объектов
Ingvar Lav
 
Ad

Similar to Lab report 201001067_201001104 (20)

PDF
Os lab final
LakshmiSarvani6
 
PPT
Linux_C_LabBasics.ppt
CharuJain396881
 
PDF
Write a program in C or C++ which simulates CPU scheduling in an opera.pdf
sravi07
 
ODP
Introduction to MPI
yaman dua
 
DOCX
Programming Assignment #2CSci 430 Spring 2019Dates.docx
stilliegeorgiana
 
DOCX
Programming Assignment #2CSci 430 Spring 2019Dates.docx
denneymargareta
 
PPTX
Raspberry pi Part 6
Techvilla
 
PDF
Activity 5
Heidi Owens
 
PDF
Flow based programming in golang
Anton Stepanenko
 
PDF
Module 1_Chapter 2_PPT (1)sasaddsdsds.pdf
anilcsbs
 
PDF
Help Needed!UNIX Shell and History Feature This project consists.pdf
mohdjakirfb
 
PDF
Parallel programming using MPI
Ajit Nayak
 
DOCX
Implementing of classical synchronization problem by using semaphores
Gowtham Reddy
 
PPTX
System Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbs
ashukiller7
 
PDF
CP MATERIAL.pdf Computer Programming Material
smceramu
 
DOCX
System programmin practical file
Ankit Dixit
 
DOCX
LP-Unit3.docx
SeetharamNageshAppe1
 
DOCX
15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx
felicidaddinwoodie
 
PPT
Parallel computing(2)
Md. Mahedi Mahfuj
 
PDF
Global Interpreter Lock: Episode I - Break the Seal
Tzung-Bi Shih
 
Os lab final
LakshmiSarvani6
 
Linux_C_LabBasics.ppt
CharuJain396881
 
Write a program in C or C++ which simulates CPU scheduling in an opera.pdf
sravi07
 
Introduction to MPI
yaman dua
 
Programming Assignment #2CSci 430 Spring 2019Dates.docx
stilliegeorgiana
 
Programming Assignment #2CSci 430 Spring 2019Dates.docx
denneymargareta
 
Raspberry pi Part 6
Techvilla
 
Activity 5
Heidi Owens
 
Flow based programming in golang
Anton Stepanenko
 
Module 1_Chapter 2_PPT (1)sasaddsdsds.pdf
anilcsbs
 
Help Needed!UNIX Shell and History Feature This project consists.pdf
mohdjakirfb
 
Parallel programming using MPI
Ajit Nayak
 
Implementing of classical synchronization problem by using semaphores
Gowtham Reddy
 
System Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbs
ashukiller7
 
CP MATERIAL.pdf Computer Programming Material
smceramu
 
System programmin practical file
Ankit Dixit
 
LP-Unit3.docx
SeetharamNageshAppe1
 
15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx
felicidaddinwoodie
 
Parallel computing(2)
Md. Mahedi Mahfuj
 
Global Interpreter Lock: Episode I - Break the Seal
Tzung-Bi Shih
 
Ad

Recently uploaded (20)

PDF
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
PPTX
Simple and concise overview about Quantum computing..pptx
mughal641
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PPTX
Agile Chennai 18-19 July 2025 | Workshop - Enhancing Agile Collaboration with...
AgileNetwork
 
PPTX
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
introduction to computer hardware and sofeware
chauhanshraddha2007
 
PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
Market Insight : ETH Dominance Returns
CIFDAQ
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PDF
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PPTX
The Future of AI & Machine Learning.pptx
pritsen4700
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
Simple and concise overview about Quantum computing..pptx
mughal641
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
Agile Chennai 18-19 July 2025 | Workshop - Enhancing Agile Collaboration with...
AgileNetwork
 
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
The Future of Artificial Intelligence (AI)
Mukul
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
introduction to computer hardware and sofeware
chauhanshraddha2007
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
Market Insight : ETH Dominance Returns
CIFDAQ
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
The Future of AI & Machine Learning.pptx
pritsen4700
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 

Lab report 201001067_201001104

  • 1. IT-215 System Software Project Report Submitted on: 16th April 2012 Simulation of manufacture of Sulphuric Acid Guided By: Prof. Sanjay Chaudhary Mentored By: Anadi Chaturvedi Submitted By: Prashant Pandey (201001067) Swena Gupta (201001104)
  • 2. Goal To simulate process automation for a manufacturing plant Problem Statement Assume that there is a manufacturing plant, which manufactures finished products based on processing on raw materials. There are few machines in the plant. Each machine inputs raw materials, performs processing and produces semi-finished product, which is supplied as input or raw material to another machine. Thus, there is a chain of machines which are involved in the process inputting raw materials or semi-finished product and produces semi- finished product. Finally finished product will be the final output. Each machine is to be simulated as a process. Various processes can be initiated independently of each other and executed in background. Each process may take input from a specific named pipe and write output as a processed semi- finished product on some other named pipe. Define the sequence of actions among 5-7 such machines, define the flow input and output among them. One machine should be identified as a machine, which generates finished product, i.e. gray cloth. Each machine operates under certain environmental conditions, i.e. machine should be operated within the range of temperature. If temperature level of any of the machine is more than the upper limit then it should 1
  • 3. generate signal and send it to the main controlling machine, which will inform all other machines to stop operations. Concepts Used • Multiple Threading • Mutual Exclusion and Condition Variables • Inter Process Communication using Pipes • Signal Handling and Processing • Accessing System time. Programming Language C Language inclusive of concepts of Shell Programming. used Tools used gcc compiler. Header Files Used 1) #include <stdio.h> This header file contains declarations used in most input and output and is typically included in all C programs. eg. printf() etc. 2) #include <stdlib.h> This header file contains Utility functions. eg. exit() etc. 2
  • 4. 3) # include <pthread.h> This header file defines the threads and its functions. eg. pthread_create() etc. 4) #include <signal.h> To catch the various signals implemented in our program, we have included <signal.h> because it contains sigaction as a structure. 5) #include <string.h> This header file contains String functions. eg. strlen() 6) #include <time.h> This header file contains implementation of date and time manipulation operations. Test Programs a) time_t now; time (&now); printf ("nn%snn", ctime (&now)); //the above code snippet has been used to access system time. b) act.sa_handler = catchint; sigfillset(&(act.sa_mask)); sigaction(SIGINT , &act, NULL); sigaction(SIGUSR1 , &act, NULL); void catchint(int signo) // handler for sigaction 3
  • 5. { if(signo==SIGINT) printf("nn'Ctrl+C' pressed...Interrupt generated and ignored!!!nn"); if(signo==SIGQUIT) . . . . } // The above code snippet is used to call signals at various activities of user such as pressing Ctrl+C to generate SIGINT etc. and to handle them using catchint function. c) if(pthread_create(&control_thread, NULL, control_machine, (void *) quantity)!=0) { printf("Failed to create a threadn"); exit(1); } pthread_join(control_thread, NULL); // The above part of program is used to create threads and to join them d) pipe (p); write (p[1], write_msg, 60); read(p[0], read_msg, 60); // the above statements are used to declare and do read-write operation on a named pipe. 4
  • 6. e) pthread_mutex_lock (&count_lock); while (taskid >= COUNT) { pthread_cond_wait (&count_cond, &count_lock); } pthread_cond_broadcast (&count_cond); pthread_mutex_unlock (&count_lock); //the above statements are used to put mutual exclusion amongst all the threads and to make all other threads wait while one thread is executing. Assumptions 1. The Initial & Favourable specifications of machines are pre-defined as stated in program (while we run the program, it displays on the console). 2. According to the code made by us, the specifications has been set, so that if the required amount is > 3 litres, all the 5 stage proccess machines gets overheated & production of 4th lts onwards acid needs to cool each machine. This has been shown appropriately while production of 4th litre and onwards acid production. 5
  • 7. 3. This has been done deliberately to introduce and show the concept of temperature in our machine automated manufacturing-plant system. 4. Following SIGNALS have been handled in our program a. SIGINT : signal called for handling Ctrl+C. b. SIGQUIT : signal called for handling Ctrl+ c. SIGALRM : signal called for production of next litre of acid. d. SIGWINCH: signal called when output terminal window size is changed. e. SIGTSTP : signal called for handling Ctrl+Z. f. SIGUSR1 : signal called if the user enters invalid input. List of Programs • final_manufacture.c Log Files • log_for_3_litres_prodn • log_for_6_litres_prodn • log_for_9_litres_prodn • log_for_wrong_user_input • log_with_all_signals_handled_6_litres 6