Abstract:
The present disclosure relates to an apparatus for updating an OS (Operating System) in PLC (Programmable Logic Controller) configured to update an OS in a PLC, and to perform an operation by instantly applying the updated OS to the PLC, and a method using the same, the apparatus including an MPU (Micro Processing Unit), a flash memory, a second working memory, and a switching unit.

Description:
CROSS-REFERENCE TO RELATED APPLICATIONS 
       [0001]    Pursuant to 35 U.S.C. §119(a), this application claims the benefit of earlier filing date and right of priority to Korean Patent Application No. 10-2013-0102920, filed on Aug. 29, 2013, the contents of which are all hereby incorporated by reference herein in its entirety. 
       BACKGROUND OF THE DISCLOSURE 
       [0002]    1. Field of the Disclosure 
         [0003]    The present disclosure relates to an apparatus for updating an OS (Operating System) in PLC (Programmable Logic Controller) configured to update an OS in a PLC, and to perform an operation by instantly applying the updated OS to the PLC, and a method using the same. 
         [0004]    2. Discussion of the Related Art 
         [0005]    The information disclosed in this Discussion of the Related Art section is only for enhancement of understanding of the general background of the present disclosure and should not be taken as an acknowledgement or any form of suggestion that this information forms the prior art already known to a person skilled in the art. 
         [0006]    Various types of apparatuses have emerged for factory automation concomitant with development in automation fields due to sophisticated technologies. As one of apparatuses for factory automation, a PLC uses programmable memories for performing functions such as logics, sequences, timings, counts and operations through digital or analog (I/O) input/output modules. The PLC, an apparatus configured to control various devices, machineries and processes in a factory, is a core element for factory automation, and one of effective means configured to satisfy various requirements for factory automation. 
         [0007]    The PLC can provide, in a module or in a basic unit, various functions such as four fundamental arithmetic operations, input/output of digital signals, input/output of analog signals, communication, position determination and high speed counts. 
         [0008]    OS updates in PLC are frequently generated, even after products are shipped out from a factory, for functional upgrade, bug correction and functional addition, among others. In order to update the OS in PLC, and to allow the PLC to be operated according to an updated OS, power of PLC must be turned off and turned on again, or system reset must be performed to do the initialization, where OS updated in the initialization process is uploaded on a working memory and operation must be performed according to the updated OS. 
         [0009]    Thus, conventionally, it takes many hours to update the OS on the PLC, and to allow the PLC to operate according to the updated OS, whereby productivity of products using the PLC is much decreased. 
       SUMMARY OF THE DISCLOSURE 
       [0010]    This section provides a general summary of the disclosure, and is not a comprehensive disclosure of its full scope or all of its features. Exemplary aspects of the present disclosure are to substantially solve at least the above problems and/or disadvantages and to provide at least the advantages below. 
         [0011]    Accordingly, an aspect of the present disclosure provides an apparatus for updating an OS (Operating System) in PLC configured to allow the PLC to instantly apply and operate an updated OS, instead of turning off and turning on again the power of PLC while the OS is updated on the PLC, and a method thereof. 
         [0012]    It should be emphasized, however, that the present disclosure is not limited to a particular disclosure, as explained above. It should be understood that other technical subjects not mentioned herein may be appreciated by those skilled in the art. 
         [0013]    In one general aspect of the present disclosure, there is provided an apparatus for updating an OS (Operating System) in PLC, the apparatus comprising: 
         [0000]    an MPU (Micro Processing Unit) configured to control download of the OS provided by a PADT (Programming And Debugging Tool) and to perform the operation in response to the uploaded OS;
 
a flash memory stored with a plurality of OSs downloaded in response to control of the MPU;
 
a first working memory uploaded with a latest versioned OS among the OSs stored in the flash memory in response to the control of the MPU;
 
a second working memory uploaded with the OS stored in the flash memory by download of the MPU subsequent to the latest versioned OS being uploaded on the first working memory; and
 
a switching unit configured to switch chip select signals for respectively selecting the first working memory and the second working memory in response to a chip switching signal generated by the MPU and to apply the chip select signals to the first working memory and the second working memory.
 
         [0014]    Preferably, but not necessarily, the flash memory may include a first OS area and a second OS area stored with the OS, and the MPU uploads, in the first working memory, the latest versioned OS by comparing versions of OSs respectively stored in the first OS area and the second OS area. 
         [0015]    Preferably, but not necessarily, the flash memory may include a first OS area and a second OS area stored with OSs, and the MPU stores OSs downloaded from the PADT on an OS area stored with previous version by comparing versions of OSs respectively stored in the first OS area and the second OS area. 
         [0016]    Preferably, but not necessarily, the MPU may download the OS from the PADT by calling a boot program. 
         [0017]    In another general aspect of the present disclosure, there is provided a method for updating an OS (Operating System) in a PLC (Programmable Logic Controller), the method comprising: 
         [0000]    downloading, by a MPU (Micro Processing Unit), an OS from a PADT (Programming And Debugging Tool);
 
storing, by the MPU, a downloaded OS on a first OS area or a second OS area stored a previous version OS by comparing versions of OSs respectively stored in the first OS area and the second OS area of a flash memory;
 
uploading the OS downloaded and stored in the first OS area or the second OS area on a first working memory or a second working memory not stored with OS working on a current work by the MPU in the first working memory and the second working memory; and
 
performing the work, by the MPU, in response to the OS uploaded on the first working memory or the second working memory.
 
         [0018]    Preferably, but not necessarily, the downloading may be realized by a boot program called by the MPU. 
         [0019]    Preferably, but not necessarily, the method may further comprise, subsequent to uploading the OS, applying, to the first working memory or the second working memory, a chip select signal configured to select the first working memory or the second working memory by switching, by a switching unit, in response to a chip switching signal outputted by the MPU. 
         [0020]    Preferably, but not necessarily, the chip select signal may be a signal reversing the chip select signal previously outputted for selecting the first working memory or the second working memory. 
       Advantageous Effects 
       [0021]    The apparatus and method for updating the OS in the PLC have an advantageous effect in that 
         [0000]    the PLC can be instantly operated by applying a newly versioned OS, instead of turning off and turning on a power of the PLC again, while a newly versioned OS provided by the PADT is downloaded and stored, whereby time for updating the OS and time for the PLC to be operated in response to the updated OS can be reduced and whereby productivity of products manufactured by using the PLC can be improved. 
         [0022]    Other exemplary aspects, advantages, and salient features of the disclosure will become more apparent to persons of ordinary skill in the art from the following detailed description, which, taken in conjunction with the annexed drawings, discloses exemplary embodiments of the invention. 
         [0023]    The above and other features of the invention are discussed infra. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0024]    The above and other features of the present invention will now be described in detail with reference to certain exemplary embodiments thereof illustrated in the accompanying drawings which are given hereinafter by way of illustration only, and thus are not limitative of the present invention, and like numbers refer to like elements throughout, 
           [0000]    wherein: 
           [0025]      FIG. 1  is a block diagram illustrating a configuration of an apparatus for updating an OS in a PLC according to prior art; 
           [0026]      FIG. 2  is a signal flowchart illustrating operations of MPU by a method for updating an OS in PLC according to prior art; 
           [0027]      FIG. 3  is a block diagram illustrating a configuration of an apparatus for updating an OS in a PLC according to the present disclosure; 
           [0028]      FIGS. 4   a  and  4   b  are respectively a detailed circuit diagram of a switching unit of  FIG. 3  and a graph showing an operation state; 
           [0029]      FIGS. 5   a  and  5   b  are graphs illustrating uploading operations, to a working memory, a new versioned OS stored in a flash memory in an apparatus for updating an OS in a PLC according to the present disclosure; and 
           [0030]      FIG. 6  is a signal flowchart illustrating an operation of MPU according to a method for updating an OS in a PLC according to the present disclosure. 
       
    
    
       [0031]    Additional advantages, objects, and features of the disclosure will be set forth in part in the description which follows and in part will become apparent to those having ordinary skill in the art upon examination of the following or may be learned from practice of the disclosure. The objectives and other advantages of the disclosure may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings. 
         [0032]    It is to be understood that both the foregoing general description and the following detailed description of the present disclosure are exemplary and explanatory and are intended to provide further explanation of the disclosure as claimed. 
       DETAILED DESCRIPTION 
       [0033]    In describing the present disclosure, detailed descriptions of constructions or processes known in the art may be omitted to avoid obscuring appreciation of the invention by a person of ordinary skill in the art with unnecessary detail regarding such known constructions and functions. Accordingly, the meaning of specific terms or words used in the specification and claims should not be limited to the literal or commonly employed sense, but should be construed or may be different in accordance with the intention of a user or an operator and customary usages. Therefore, the definition of the specific terms or words should be based on the contents across the specification. 
         [0034]    Hereinafter, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings. 
         [0035]      FIG. 1  is a block diagram illustrating a pulse input method of a high speed counter module of PLC according to prior art, where reference numeral  100  is a PADT (Programming And Debugging Tool), and  110  is a PLC. 
         [0036]    The PADT ( 100 ) generates an operation command in response to manipulation of an operator and provides the operation command to the PLC ( 110 ), and when the generated command is a download command of OS, the PADT ( 100 ) provides to the PLC ( 110 ) the OS that is to be downloaded. The PLC ( 110 ) performs a predetermined operation in response to a latest versioned OS among pre-stored OSs, and performs an operation in response to the operation command of the PADT ( 100 ). 
         [0037]    Furthermore, the PLC ( 110 ) downloads the OS provided by the PADT ( 110 ) and stores the OS when there is generated a download command of OS. At this time, the PLC ( 110 ) may include an MPU (Micro Processing Unit,  112 ), a flash memory ( 114 ) and a working memory ( 116 ). 
         [0038]    The MPU ( 112 ) controls in such a manner that the PLC ( 110 ) performs a predetermined work in response to the latest versioned OS among the pre-stored OSs, and performs an operation in response to the operation command of the PADT ( 100 ). Furthermore, the MPU ( 112 ) calls a boot program ( 112   a ) to allow downloading the OS provided by the PADT ( 100 ) when the PADT ( 100 ) generates a download command of OS, and controls the storage and execution of the downloaded OS. 
         [0039]    The flash memory ( 114 ) includes a plurality of OS areas, and stores the OS downloaded by the MPU ( 112 ). For example, the flash memory ( 114 ) may include a first OS area ( 114   a ) and a second OS area ( 114   b ), where the first and second OS areas ( 114   a ,  114   b ) are selectively stored with the OS provided by the PADT ( 100 ) in response to control of the MPU ( 112 ). The working memory ( 116 ) is stored with the latest versioned OS among the OSs stored in the first and second OS areas ( 114   a ,  114   b ) in response to the control of the MPU ( 112 ), and performs a predetermined operation in response to the OS by providing the stored OS to the MPU ( 112 ). 
         [0040]    In the apparatus for updating the OS in the PLC system thus configured according to the prior art, when the power of the PLC ( 110 ) is turned on, the MPU ( 112 ) checks each version of OS stored in the first and second OS areas ( 114   a ,  114   b ) of the flash memory ( 112 ). For example, the MPU ( 112 ) generates a chip select signal (CS 1 ) to activate the first and second OS areas ( 114   a ,  114   b ) of the flash memory ( 112 ). Furthermore, the MPU ( 112 ) generates a read signal (RD) of the flash memory ( 114 ) and generates an address signal through an address bus to read OSs respectively stored in the first and second OS areas ( 114   a ,  114   b ), receives the read OSs through a data bus, and compares versions of received OSs to determine the first or second OS areas ( 114   a ,  114   b ) that is stored with the latest versioned OS. At this time, operation will be explained assuming that the latest versioned OS is stored in the first OS area ( 114   a ). 
         [0041]    When it is determined that the latest versioned OS is stored in the first OS area ( 114   a ), the MPU ( 112 ) reads out the latest versioned OS stored in the first area ( 114   a ) and stored the latest versioned OS in the working memory ( 116 ). For example, the MPU ( 112 ) generates a read signal (RD) of the flash memory ( 114 ) and an address signal while a chip select signal (CS 1 ) is generated to activate the flash memory ( 114 ), and allows the latest versioned OS stored in the first OS area ( 114   a ) of the flash memory ( 116 ) to be outputted through the data bus. 
         [0042]    Furthermore, the MPU ( 112 ) generates a chip select signal (CS 2 ) and a write signal (RD), and send the generated chip select signal (CS 2 ) and write signal (RD) to the working memory ( 116 ), and generates an address signal through an address bus and sends the generated address signal to the working memory ( 116 ). Then, the latest versioned OS stored in the first area ( 114   a ) of the flash memory ( 114 ) is inputted into and stored in the working memory ( 116 ) through the data bus. 
         [0043]    When the latest versioned OS is stored in the working memory ( 116 ) as described above, the MPU ( 112 ) reads out the OS stored in the working memory ( 116 ) and performs a predetermined work in response to the OS read out from the working memory ( 116 ). 
         [0044]    The MPU ( 112 ) determines whether a predetermined operation command has been received from the PADT ( 100 ) while the work is performed in response to the latest versioned OS. When it is determined that the predetermined operation command has been received from the PADT ( 100 ), the MPU ( 112 ) determines whether the operation command is a download command of new versioned OS, and performs a predetermined operation in response to an inputted relevant operation command when the operation command is not a download command of new versioned OS. The MPU ( 112 ) calls a boot program ( 112   a ) to allow downloading the new versioned OS provided by the PADT ( 100 ) when it is determined that the operation command received from the PADT ( 100 ) is a download command of new versioned OS. 
         [0045]    Furthermore, the MPU ( 112 ) checks the versions of OSs stored in the first and second OS areas ( 114   a ,  114   b ) of the flash memory ( 114 ), and when the version of OS stored in the second OS area ( 114   b ) is an earlier version than the OS stored in the first OS area ( 114   a ), the MPU ( 112 ) deletes the OS stored in the second OS area ( 114   b ) and stores a new versioned OS downloaded through the boot program ( 112   a ) in the second OS area ( 114   b ). 
         [0046]    When the new versioned OSs downloaded thus described are stored in the second OS area ( 114   b ), the MPU ( 112 ) turns off the power of PLC ( 110 ) and turns on again or performs a system reset. 
         [0047]    Furthermore, the MPU ( 112 ) checks versions of OSs stored in the first and second OS areas ( 114   a ,  114   b ) of the flash memory ( 114 ) in the initialization work when the PLC ( 110 ) turns on the power or performs an initialization work in response to the system reset, where it is assumed that the version of OS stored in the second OS area ( 114   b ) is later than the version of OS stored in the first OS area ( 114   a ). Then, the MPU ( 112 ) reads out the OS stored in the second OS area ( 114   b ) and stored the read-out OS in the working memory ( 116 ), and performs a predetermined work in response to the latest versioned OS stored in the second OS area ( 114   b ). 
         [0048]      FIG. 2  is a signal flowchart illustrating an operation of MPU by a method for updating an OS in PLC according to prior art. Referring to  FIG. 2 , the MPU ( 112 ) receives a command generated by the PADT ( 110 ) (S 200 ), and determines whether the received command is a command that commands the download of the OS (S 202 ). 
         [0049]    As a result of determination if the received command is not a command that commands the download of the OS, the MPU ( 112 ) performs a predetermined operation in response to the received command (S 204 ). Furthermore, as a result of determination if the received command is a command that commands the download of the OS, the MPU ( 112 ) calls the boot program ( 112   a ) to enable downloading a latest versioned OS (S 206 ) and determines a latest versioned OS among the OSs respectively stored in the first and second OS areas ( 114   a ,  114   b ) of the flash memory ( 114 ) (S 208 ). 
         [0050]    As a result of the determination, if it is determined that the version of OS stored in the first OS area ( 114   a ) is later than the version of OS stored in the second OS area ( 114   b ), the MPU ( 112 ) deletes the OS stored in the second OS area ( 114   b ) (S 210 ). That is, the MPU ( 112 ) deletes a flash sector of the second OS area ( 114   b ). 
         [0051]    Furthermore, the MPU ( 112 ) stores the newly versioned OS received from the boot program ( 112   a ) in the second OS area ( 114   b ) of the flash memory ( 114 ) (S 212 ), and determines if the newly versioned OS is completed in downloading (S 214 ). 
         [0052]    As a result of determination, if it is determined that the newly versioned OS is not completed in downloading, the MPU ( 112 ) returns to the step (S 212 ) to store the newly versioned OS received from the boot program ( 112   a ) in the second OS area ( 114   b ) of the flash memory ( 114 ), and repeats an operation of determining whether the newly versioned OS has been completed in downloading. 
         [0053]    Furthermore, as a result of determination, if it is determined that the version of OS stored in the second OS area ( 114   b ) is later than the version of OS stored in the first OS area ( 114   a ), the MPU ( 112 ) deletes the OS stored in the first OS area ( 114   a ) (S 216 ). Then, the MPU ( 112 ) stores the newly versioned OS received from the boot program ( 112   a ) in the first OS area ( 114   a ) of the flash memory ( 114 ) (S 218 ), and determines if the new versioned OS is completed in downloading (S 220 ). 
         [0054]    As a result of determination, if it is determined that the new versioned OS is not completed in downloading, the MPU ( 112 ) returns to the step (S 218 ) to store the newly versioned OS received from the boot program ( 112   a ) in the first OS area ( 114   a ) of the flash memory ( 114 ), and repeats an operation of determining whether the newly versioned OS has been completed in downloading. Under this state, if it is determined that the newly versioned OS has been completed in downloading, the MPU ( 112 ) turns off the power of the PLC ( 110 ) and turns of the power again, or performs the system reset (S 222 ). 
         [0055]    Then, the MPU ( 112 ) turns on the power of PLC ( 110 ) or performs the initialization operation in response to the system reset, and uploads in the working memory ( 116 ) the latest versioned OS among the OSs respectively stored in the first and second OS areas ( 114   a ,  114   b ) of the flash memory ( 114 ) (S 224 ). 
         [0056]    That is, the MPU ( 112 ) performs the initialization work and checks the versions of OSs respectively stored in the first and second OS areas ( 114   a ,  114   b ) of the flash memory ( 114 ), and reads out the latest versioned OS and uploads the read-out latest versioned OS in the working memory ( 116 ). When the upload of the latest versioned OS is completed, the MPU ( 112 ) executes the latest versioned OS uploaded on the working memory ( 116 ) (S 226 ). 
         [0057]    The PLC ( 110 ) according to the prior art may store the newly versioned OS provided by the PADT ( 110 ) in the flash memory ( 114 ) when a command of downloading the OS is generated from the PADT ( 100 ) while the MPU ( 112 ) executes the current versioned OS. However, in order to execute the newly versioned OS stored in the flash memory ( 114 ), the MPU ( 112 ) must turn off the power of the PLC ( 110 ) and turn on the power again, or execute the system rest to perform the initialization work, and upload the newly versioned OS in the working memory ( 116 ) while performing the initialization work. Thus, it takes much time until the MPU ( 112 ) executes the downloaded newly versioned OS, resulting in generation of problem of decreased productivity of the products. 
         [0058]      FIG. 3  is a block diagram illustrating a configuration of an apparatus for updating an OS in a PLC according to the present disclosure, where reference numeral  300  is a PADT and  310  is a PLC. 
         [0059]    The PADT ( 300 ) generates an operation command in response to manipulation of an operator and provides the operation command to the PLC ( 310 ), and provides an OS to be downloaded by the PLC ( 310 ) when the generated command is a command of downloading an OS. The PLC ( 310 ) performs a predetermined operation in response to a latest versioned OS among a pre-stored OSs. Furthermore, the PLC ( 310 ) downloads the OS provided by the PADT ( 300 ) and stores the downloaded OS when the PADT ( 300 ) generates a command of downloading the OS. 
         [0060]    The PLC ( 310 ) may include an MPU (Micro Processing Unit,  312 ), a flash memory ( 314 ), a first working memory ( 316 ) and a second working memory ( 318 ), and a switching unit ( 320 ). 
         [0061]    The MPU ( 312 ) controls in such a manner that the PLC ( 310 ) performs a predetermined operation in response to the latest versioned OS among pre-stored OSs, and performs an operation in response to an operation command of the PADT ( 300 ). Furthermore, the MPU ( 312 ) calls a boot program ( 312   a ) when the PADT ( 300 ) generates a command of downloading an OS to enable downloading the OS to be provided by the PADT ( 300 ), and controls storage and execution of the downloaded OS. 
         [0062]    The flash memory ( 314 ) may include first and second OS areas ( 314   a ,  314   b ), for example, where the first and second OS areas ( 314   a ,  314   b ) may be selectively stored with OSs provided by the PADT ( 300 ) in response to the control of the MPU ( 312 ). 
         [0063]    One of the first and second working memories ( 316 ,  318 ) may be selected in response to control of the MPU ( 312 ), and may be stored with the latest versioned OS among the OSs stored in the first and second OS areas ( 314   a ,  314   b ), and may perform a predetermined operation by providing the stored OS to the MPU ( 312 ). 
         [0064]    Furthermore, one of the first and second working memories ( 316 ,  318 ) is selected in response to control of the MPU ( 312 ), when the newly versioned OS is updated to be stored in the flash memory ( 314 ), whereby the updated newly versioned OS is uploaded. The switching unit ( 320 ) switches chip select signals (CS 2 , CS 3 ) generated by the MPU ( 312 ) in response to a chip switching signal (MEM_CS) generated by the MPU ( 312 ) to thereby generate a chip select signal (CS 2 ′) of the first working memory ( 316 ) and a chip select signal (CS 3 ′) of the second working memory ( 318 ). 
         [0065]    The apparatus for updating OS in PLC according to the present disclosure thus configured is such that when power of the PLC ( 310 ) is turned on, the MPU ( 312 ) checks each version of OSs stored in the first and second OS areas ( 314   a ,  314   b ) of flash memory ( 314 ), where operation is explained with an assumption that the first OS area ( 314   a ) is stored with the latest versioned OS. 
         [0066]    If it is determined that the first OS area ( 314   a ) is stored with the latest versioned OS, the MPU ( 312 ) reads out the latest versioned OS stored in the first OS area ( 314   a ) and selectively stores the latest versioned OS in the first working memory ( 316 ) or the second working memory ( 318 ). 
         [0067]    Now, operation will be explained with an assumption that the first working memory ( 316 ) is stored with the latest versioned OS. 
         [0068]    The MPU ( 112 ) generates a read signal (RD) and an address signal of the flash memory ( 314 ) while a chip select signal (CS 1 ) is generated to activate the flash memory ( 314 ), to allow the flash memory ( 314 ) to output the latest versioned OS stored in the first OS area ( 314   a ) through the data bus. 
         [0069]    Furthermore, the MPU ( 312 ) generates a chip select signal (CS 2 ) and outputs a chip switch signal (MEM_CS) of logic 1 signal, and enables the first working memory ( 316 ) to be activated by allowing the chip select signal (CS 2 ) to be outputted as a chip select signal (CS 2 ′) through the switching unit ( 320 ) in response to the outputted chip switch signal (MEM_CS) of a logic 1 signal. In addition, the MPU ( 312 ) generates a read signal (RD) of the first working memory ( 316 ) and also generates an address signal through the address bus. Then, the latest versioned OS outputted through the data bus from the first OS area ( 314   a ) of the flash memory ( 314 ) is inputted to the first working memory ( 316 ) and uploaded. 
         [0070]    When the latest versioned OS is uploaded on the first working memory ( 316 ) as explained above, the MPU ( 312 ) reads out the OS uploaded on the first working memory ( 316 ) and performs a predetermined operation in response to the OS read out from the first working memory ( 316 ). 
         [0071]    The MPU ( 112 ) determines whether a predetermined operation command has been received from the PADT ( 300 ) while the MPU ( 312 ) performs the operation in response to the latest versioned OS. When the predetermined operation command is inputted from the PADT ( 300 ), the MPU ( 312 ) determines whether the predetermined command is a command to download a newly versioned OS, and performs a predetermined operation in response to a relevant operation command when the predetermined command is not a command to download a newly versioned OS. 
         [0072]    When the operation command inputted from the PADT ( 300 ) is a command to download a new versioned OS, the MPU ( 312 ) calls the boot program ( 312   a ) to download the newly versioned OS provided by the PADT ( 300 ). Furthermore, the MPU ( 312 ) checks versions of OSs stored in the first and second OS areas ( 314   a ,  314   b ) of the flash memory ( 314 ), and when the version of the OS stored in the second OS area ( 314   b ) is an earlier version than that of the first OS area ( 314   a ), the MPU ( 312 ) deletes the OS stored in the second OS area ( 314   b ) and stores a newly versioned OS downloaded through the boot program ( 312   a ) in the second OS area ( 314   b ). 
         [0073]    When the newly versioned OSs are all stored in the second OS area ( 314   b ) as described above, the MPU ( 312 ) generates a chip select signal (CS 3 ), where the generated chip select signal (CS 3 ) is outputted as the chip switching signal (CS 2 ′) through the switching unit ( 320 ) in response to the chip switch signal (MEM_CS) of a logic 1 signal to activate the second working memory ( 318 ). Furthermore, the MPU ( 312 ) reads out a newly versioned OS stored in the second OS area ( 314   b ) and uploads the newly versioned OS in the second working memory ( 318 ). 
         [0074]    When the second working memory ( 318 ) is uploaded with all the newly versioned OSs stored in the second OS area ( 314   b ), the MPU ( 312 ) does not output the chip select signal (CS 3 ) but outputs the chip switching signal (MEM_CS) as logic 0. Then, the switching unit ( 320 ) activates the second working memory ( 317 ) by outputting the chip select signal (CS 2 ) as chip select signal (CS 3 ′) in response to the logic 0 of chip switching signal (MEM_CS), whereby the MPU ( 312 ) can perform a predetermined operation in response to the newly versioned OS uploaded on the second working memory ( 317 ). 
         [0075]      FIGS. 4   a  and  4   b  are respectively a detailed circuit diagram of a switching unit of  FIG. 3  and a graph showing an operation state. 
         [0076]    Referring to  FIG. 4   a , the switching unit ( 320 ) of the present disclosure enables each chip select signal (CS 2 ′, CS 3 ′) to be outputted from output terminals of buffers (BF 1 , BF 3 )(BF 2 , BF 4 ) by allowing the chip select signals (CS 2 , CS 3 ) to be applied and connected to input terminals of the buffers (BF 1 , BF 3 )(BF 2 , BF 4 ). Furthermore, the chip switching signal (MEM_CS) is applied and connected to a non-inverting control terminal of the buffers (BF 1 , BF 3 ) and the chip switching signal (MEM_CS) is applied and connected to a inverting control terminal of the buffers (BF 2 , BF 4 ). 
         [0077]    The switching unit ( 320 ) thus configured according to the present disclosure is such that the buffers (BF 1 , BF 3 ) operate when the chip switching signal (MEM_CS) is logic 1 but the buffers (BF 2 , BF 4 ) do not operate. Then, the chip select signals (CS 2 , CS 3 ) are respectively outputted as chip select signal (CS 2 ′, CS 3 ′) through the buffers (BF 1 , BF 3 ), as shown in  FIG. 4   b , to be respectively applied to the first and second working memories ( 316 ,  318 ). 
         [0078]    The buffers (BF 1 , BF 3 ) do not operate when the chip switching signal (MEM_CS) is logic 0 but the buffers (BF 2 , BF 4 ) operate. Then, the chip select signals (CS 2 , CS 3 ) are respectively outputted as chip select signal (CS 2 ′, CS 3 ′) through the buffers (BF 2 , BF 4 ), as shown in  FIG. 4   b , to be respectively applied to the first and second working memories ( 316 ,  318 ). 
         [0079]    Thus, as explained above, while the chip select signal (CS 2 ) is generated to activate the first working memory ( 316 ) and operation is performed in response to the OS stored in the first working memory ( 316 ), the MPU ( 312 ) activates the second working memory ( 318 ) by reverting the chip switching signal (MEM_CS) and performs the operation in response to the OS stored in the second working memory ( 318 ). 
         [0080]      FIGS. 5   a  and  5   b  are graphs illustrating uploading operations, to a working memory, a new versioned OS stored in a flash memory in an apparatus for updating an OS in a PLC according to the present disclosure. 
         [0081]    Referring to  FIGS. 5   a  and  5   b , when the current OS operating areas are 0x200000˜0x2FFFFF, the MPU ( 312 ) selects a working memory by using the chip select signal (CS 2 ). At this time, when the MPU ( 312 ) outputs the chip switching signal (MEM_CS) in logic 1, the chip select signal (CS 2 ) is outputted as the chip select signal (CS 2 ′) through the switching unit ( 320 ), whereby the first working memory ( 316 ) is selected, and when the MPU ( 312 ) outputs the chip switching signal (MEM_CS) in logic 0, the chip select signal (CS 2 ) is outputted as the chip select signal (CS 3 ′) through the switching unit ( 320 ), whereby the second working memory ( 318 ) is selected. 
         [0082]    A newly versioned OS that is downloaded in response to an OS downloading command of PADT ( 300 ) is stored in the flash memory ( 314 ). At this time, each version of OSs stored in the first and second OS areas ( 314   a ,  314   b ) is checked by the MPU ( 312 ), and the downloaded newly versioned OS is stored in an area where low versioned OS is stored. 
         [0083]    For example, when version of OS stored in the first OS area ( 314   a ) is V1.0, and version of OS stored in the second OS area ( 314   b ) is V1.1, the MPU ( 312 ) deletes the OS stored in the first OS area ( 314   a ) and stores the downloaded newly versioned OS. When the storage of downloaded newly versioned OS is completed, the newly versioned OS stored in the first OS area ( 314   a ) is uploaded as 0x300000˜0x3FFFFF in the working memory, and a working memory uploaded with the newly versioned OS is selected in response to the chip select signal (CS 3 ). 
         [0084]    For example, when the MPU ( 312 )-operated current OS is uploaded on the first working memory ( 316 ), the second working memory ( 318 ) is selected to upload the newly versioned OS, and when the MPU ( 312 )-operated current OS is uploaded on the second working memory ( 318 ), the first working memory ( 316 ) is selected to upload the newly versioned OS. 
         [0085]    When the newly versioned OS is completed in uploading and the chip switching signal (MEM_CS) is reversed and outputted by the MPU ( 312 ), a working memory stored with the newly versioned OS is activated to allow the OS stored in the MPU ( 312 ) to be provided. 
         [0086]      FIG. 6  is a signal flowchart illustrating an operation of MPU according to a method for updating an OS in a PLC according to the present disclosure. 
         [0087]    Referring to  FIG. 6 , the MPU ( 312 ) receives a command generated by the PADT ( 310 ) (S 600 ), and determines whether the received command is a command of downloading the OS (S 602 ). As a result of the determination, if the received command is not a command to download the OS, the MPU ( 312 ) performs a predetermined operation in response to the received command (S 604 ). As a result of the determination, if the received command is a command to download the OS, the MPU ( 312 ) calls the boot program ( 312   a ) to allow downloading a newly versioned OS (S 606 ), and determines a latest versioned OS among the OSs respectively stored in the first and second OS areas ( 314   a ,  314   b ) (S 608 ). 
         [0088]    As a result of the determination, if the version of OS stored in the first OS area ( 314   a ) is later than that of the second OS area ( 314   b ), the MPU ( 312 ) deletes the OS stored in the second OS area ( 314   b ) (S 610 ). Then, the MPU ( 312 ) stores the newly versioned OS received from the boot program ( 312   a ) in the second OS area ( 314   b ) (S 612 ), and determines whether download of the newly versioned OS is completed (S 614 ). 
         [0089]    When the newly versioned OS is completed in downloading, the MPU ( 312 ) returns to S 612  to store a newly versioned OS received through the boot program ( 312   a ) in the second OS area ( 314   b ) of the flash memory ( 312 ), and to repeat the operation of checking if the newly versioned OS is completed in downloading. Furthermore, as a result of determination at Step S 608 , if the version of OS stored in the second OS area ( 314   b ) is later than that of the first OS area ( 314   a ), the MPU ( 312 ) deletes the OS stored in the first OS area ( 314   a ) (S 616 ). Then, the MPU ( 312 ) stores the newly versioned OS received from the boot program ( 312   a ) in the first OS area ( 314   a ) (S 618 ), and determines whether download of the newly versioned OS is completed (S 620 ). 
         [0090]    When the newly versioned OS is not completed in downloading, the MPU ( 312 ) returns to S 618  to store a newly versioned OS received through the boot program ( 312   a ) in the first OS area ( 314   a ) of the flash memory ( 312 ), and to repeat the operation of checking if the newly versioned OS is completed in downloading. 
         [0091]    When the newly versioned OS is completed in downloading, the MPU ( 312 ) selects the second working memory ( 318 ) when one of the currently not working memories, that is, the first working memory ( 316 ), between the first and second working memories ( 316 ,  318 ), is stored with the MPU ( 312 ) currently operating OS, to upload the newly versioned OS (S 622 ) and reverses and outputs the chip switching signal (MEM_CS). 
         [0092]    Then, the second working memory ( 318 ) stored with the newly versioned OS is activated to allow providing the stored newly versioned OS to the MPU ( 312 ). 
         [0093]    The above-mentioned apparatus and method for updating OS in PLC according to the present disclosure may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Thus, it is intended that embodiments of the present disclosure may cover the modifications and variations of this disclosure provided they come within the scope of the appended claims and their equivalents. 
         [0094]    While particular features or aspects may have been disclosed with respect to several embodiments, such features or aspects may be selectively combined with one or more other features and/or aspects of other embodiments as may be desired.