WO2016075721A1 - 命令実行制御システム及び命令実行制御方法 - Google Patents

命令実行制御システム及び命令実行制御方法 Download PDF

Info

Publication number
WO2016075721A1
WO2016075721A1 PCT/JP2014/005663 JP2014005663W WO2016075721A1 WO 2016075721 A1 WO2016075721 A1 WO 2016075721A1 JP 2014005663 W JP2014005663 W JP 2014005663W WO 2016075721 A1 WO2016075721 A1 WO 2016075721A1
Authority
WO
WIPO (PCT)
Prior art keywords
instruction
dummy
output
bus
unit
Prior art date
Application number
PCT/JP2014/005663
Other languages
English (en)
French (fr)
Inventor
宏一朗 野口
修 岡崎
帰山 隼一
浩一 野瀬
Original Assignee
ルネサスエレクトロニクス株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by ルネサスエレクトロニクス株式会社 filed Critical ルネサスエレクトロニクス株式会社
Priority to CN201480082409.0A priority Critical patent/CN107111523B/zh
Priority to PCT/JP2014/005663 priority patent/WO2016075721A1/ja
Priority to JP2016558442A priority patent/JP6314246B2/ja
Priority to US15/513,544 priority patent/US20170300329A1/en
Publication of WO2016075721A1 publication Critical patent/WO2016075721A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline or look ahead
    • G06F9/3836Instruction issuing, e.g. dynamic instruction scheduling or out of order instruction execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/30076Arrangements for executing specific machine instructions to perform miscellaneous control operations, e.g. NOP
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/30076Arrangements for executing specific machine instructions to perform miscellaneous control operations, e.g. NOP
    • G06F9/30087Synchronisation or serialisation instructions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline or look ahead
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores

Definitions

  • the present invention relates to an instruction execution control system and an instruction execution control method, and more particularly to a technique for executing instructions in parallel.
  • Patent Document 1 discloses a technique for securing the execution order of instructions in a system having an instruction overtaking function in memory access.
  • the instruction execution control device sets the pre-barrier flag of the instruction registered in the storage unit to one.
  • the instruction execution control device registers the instruction in the storage unit, and ensures the order guarantee control of the registered instruction and the instruction whose pre-barrier flag is 1. It is determined whether or not it is a combination of instruction types to be executed.
  • the instruction execution control device sets an overtaking prohibition flag of an instruction whose front-barrier flag is 1 to 1 when the instruction is a combination of instruction types to be subjected to order guarantee control.
  • the instruction execution control unit executes an instruction, it clears the pre-barrier flag and the overtaking prohibition flag of the instruction. Then, the instruction execution control device suspends the execution of the later registered instruction until the overtaking prohibition flag is cleared. This guarantees the execution order of the instructions.
  • Patent Document 1 does not disclose a technique for guaranteeing the execution order of instructions in a system in which a plurality of instruction execution units independently execute instructions in parallel.
  • the instruction execution control system when the inputted instruction is a dummy instruction inserted between the instructions to be kept in the execution order, stores the inputted instruction in a plurality of instruction storage units.
  • the instruction is distributed to all of the plurality of instruction storage units until the output of all the instruction storage units becomes a dummy instruction, and the output of the instruction from the instruction storage unit, which is a dummy instruction, is inhibited from outputting the instruction to the instruction execution unit It is.
  • the execution order of instructions can be guaranteed.
  • FIG. 1 is a block diagram of a module control system according to a first embodiment.
  • FIG. 2 is a block diagram of an interface board and an external computer according to Embodiment 1;
  • FIG. 2 is a diagram showing a software configuration and a hardware configuration of an external computer 3 according to the first embodiment.
  • FIG. 5 is a diagram showing an execution order of instructions according to Embodiment 1.
  • 5 is a flowchart showing an operation of the module control system according to Embodiment 1;
  • 5 is a flowchart showing an operation of the external computer according to the first embodiment.
  • 5 is a flowchart showing the operation of the interface board (transmission control function and dummy instruction detection function) according to the first embodiment.
  • FIG. 5 is a flowchart showing the operation of the interface board (timing adjustment function) according to the first embodiment.
  • FIG. 6 is a block diagram clearly showing the reception function of the interface board according to Embodiment 1; It is a figure which shows the example which can not keep the execution order of an instruction
  • FIG. 7 is a block diagram of a modification 1 of the module control system according to the first embodiment.
  • FIG. 10 is a block diagram of a modification 2 of the module control system according to the first embodiment.
  • 5 is a configuration diagram of an interface board and an external computer according to Embodiment 2.
  • FIG. FIG. 16 is a block diagram of a modification of the module control system according to the second embodiment.
  • FIG. 14 is a configuration diagram of an interface board and an external computer according to Embodiment 3;
  • FIG. 18 is a diagram showing an execution order of instructions according to Embodiment 3.
  • 15 is a flowchart showing an operation of the interface board (timing adjustment function) according to the third embodiment.
  • FIG. 16 is a block diagram of an interface board and an external computer according to a fourth embodiment.
  • FIG. 18 is a diagram showing an execution order of instructions according to a fourth embodiment.
  • FIG. 18 is a configuration diagram of a modification of the module control system according to the fourth embodiment.
  • FIG. 18 is a block diagram of an interface board and an external computer according to a fifth embodiment.
  • FIG. 18 is a diagram showing an execution order of instructions according to a fifth embodiment.
  • FIG. 21 is a flowchart showing the operation of the interface board (timing adjustment function) according to the fifth embodiment.
  • FIG. 18 is a configuration diagram of an interface board and an external computer according to a sixth embodiment.
  • FIG. 18 is a configuration diagram of an interface board and an external computer according to a seventh embodiment.
  • FIG. 18 is a configuration diagram of an interface board and an external computer according to Embodiment 8;
  • FIG. 18 is a diagram showing the execution order of instructions according to Embodiment 8.
  • FIG. 31 is a flowchart showing the operation of the interface board (transmission control function and dummy instruction detection function) according to the eighth embodiment.
  • FIG. 20 is a configuration diagram of a module control system according to Embodiment 9;
  • FIG. 20 is a configuration diagram of a module control system according to Embodiment 9;
  • FIG. 20 is a configuration diagram of a module control system according to Embodiment 9;
  • FIG. 18 is a diagram showing an execution order of instructions according to a ninth embodiment.
  • FIG. 21 is a configuration diagram of a module control system according to a tenth embodiment.
  • FIG. 21 is a configuration diagram of a module control system according to a tenth embodiment.
  • FIG. 21 is a configuration diagram of a module control system according to a tenth embodiment.
  • FIG. 18 is a diagram showing the execution order of instructions according to the tenth embodiment.
  • the module control system 1 has an interface board 2, an external computer 3, and a plurality of modules 4.
  • the interface board 2 is connected to the external computer 3 via the communication path 90. Further, the interface board 2 is connected to the plurality of modules 4 via the buses 91 to 93. At least one module 4 is connected to each of the buses 91 to 93. Strictly speaking, the buses 91 to 93 are formed by connecting the interface board 2 and the plurality of modules 4 to each other and connecting their internal signal lines. In the first embodiment, an example in which the number of buses 91 to 93 connecting the interface board 2 and the module 4 is three is described, but the number of buses is not limited to this.
  • the interface board 2 receives an instruction from the external computer 3 via the communication path 90.
  • the interface board 2 distributes the received instruction to each of the buses 91 to 93.
  • the interface board 2 transmits the received instruction to the bus to which the module 4 which is the execution target of the instruction is connected.
  • the external computer 3 generates an instruction to be executed by the module 4.
  • the external computer 3 transmits the generated instruction to the interface board 2 via the communication path 90.
  • the external computer 3 is typically, for example, a PC (Personal Computer).
  • Each of the plurality of modules 4 executes an instruction received from the interface board 2.
  • the plurality of modules 4 can be connected to one another to configure one operating gadget.
  • the gadget may be, for example, an electronic device such as a home appliance, or a transport device such as an automobile.
  • Each of the plurality of modules 4 executes an instruction to realize the operation of the gadget.
  • Each of the plurality of modules 4 has a microcomputer 40, a sensor 41, and a motor 42, as shown in FIG. 1, for example.
  • the module 4 may have any one of the sensor 41 and the motor 42.
  • the microcomputer 40 executes an instruction received from the interface board 2. For example, when the received command is a sensor value acquisition command, the microcomputer 40 executes a process of acquiring a sensor value from the sensor 41 and transmitting it to the interface board 2.
  • the interface board 2 transmits the sensor value received from the module 4 to the external computer 3.
  • the microcomputer 40 executes a process of driving the motor 42 when the received command is a motor drive command.
  • the motor drive command is generated, for example, based on the sensor value obtained by the external computer 3 from the module 4. That is, strictly speaking, the execution of the instruction in the first embodiment means that the module 4 executes the process according to the instruction. In other words, the instruction in the present embodiment can be said to be information for instructing the module 4 to perform processing.
  • the movement is realized by driving the motor 42 based on the sensor value generated by the sensor 41 as described above.
  • the configuration of the module 4 is not limited to this.
  • the module 4 may have information acquiring means other than the sensor 41, and may have operation realizing means other than the motor 42.
  • connection method may be adopted for connection between the module 4 and another module 4 or the interface board 2.
  • the connection method may be, for example, a method of connecting indirectly via a cable or a connecting part, or a method of connecting directly without using a cable or the like.
  • two or more of those connection methods may be mixed.
  • the external computer 3 can control more modules 4 by configuring the external computer 3 to control the plurality of modules 4 via the interface board 2 as described above. That is, by connecting the external computer 3 and the plurality of modules 4 via the interface board 2 to which the modules 4 can be connected by the plurality of buses 91 to 93, it is possible to connect more than directly connecting by a single bus. Connection of module 4 is enabled.
  • the module 4 group connected to the bus 91, the module 4 group connected to the bus 92, and the module 4 group connected to the bus 93 are independently and parallelly operated.
  • the instruction is executed. Therefore, if the independence is not taken into consideration, the instruction to be executed later is executed first when the instruction to be kept in the execution order is sent to different modules 4 of the connected bus. There is a problem that there is a problem.
  • These modules 4 function as an instruction execution unit.
  • the plurality of modules 4 are executed by the functions described below. We guarantee the order of the instruction.
  • the external computer 3 has a dummy instruction generation function 30.
  • the dummy instruction generation function 30 generates a dummy instruction, and inserts a plurality of instructions sequentially transmitted to the interface board 2 between the instructions whose execution order is to be maintained. That is, when there is a first instruction and a second instruction to be executed after the first instruction among a plurality of instructions, a dummy instruction is placed between the first instruction and the second instruction. Is inserted.
  • the external computer 3 transmits the first instruction, the dummy instruction, and the second instruction to the interface board 2 in this order.
  • the first instruction corresponds to a sensor value acquisition instruction
  • the second instruction corresponds to a motor drive instruction generated based on the sensor value acquired by the sensor value acquisition instruction.
  • the types of instructions that should follow the execution order are not limited to the sensor value acquisition instruction and the motor drive instruction illustrated in the present embodiment. The order of the other types of instructions may be guaranteed as will be described later.
  • the interface board 2 has a transmission control function 20, a dummy instruction detection function 21, a plurality of bus instruction buffers 22a to 22c, and a timing adjustment function 23.
  • bus instruction buffer 22 the bus instruction buffers 22a to 22c will be simply referred to as “bus instruction buffer 22" unless limited to one of them.
  • the transmission control function 20 distributes or distributes the instruction received from the external computer 3 to the bus instruction buffers 22a to 22c. In other words, the transmission control function 20 stores the instruction received from the external computer 3 in the bus instruction buffers 22a to 22c. More specifically, when the received instruction is a dummy instruction, the transmission control function 20 outputs the dummy instruction to all the bus instruction buffers 22a to 22c. On the other hand, when the received instruction is not a dummy instruction, the transmission control function 20 outputs the instruction to any one of the bus instruction buffers 22a to 22c. More specifically, the transmission control function 20 outputs the instruction to the bus instruction buffer 22 corresponding to the bus to which the module 4 for executing the instruction is connected.
  • the transmission control function 20 recognizes whether or not the received command is a dummy command based on the detection result of the dummy command detection function 21.
  • the dummy instruction detection function 21 determines whether the instruction received from the external computer 3 is a dummy instruction. That is, the dummy instruction detection function 21 determines whether the instruction input to the transmission control function 20 is a dummy instruction. Then, when it is determined that the instruction received from the external computer 3 is a dummy instruction, the dummy instruction detection function 21 notifies the transmission control function 20 of detection of the dummy instruction.
  • the transmission control function 20 and the dummy instruction detection function 21 are realized by, for example, a circuit described below.
  • the dummy instruction detection function 21 outputs a broadcast instruction signal to a broadcast terminal of the transmission control function 20 when the instruction input to the transmission control function 20 is a dummy instruction.
  • the broadcast instruction signal corresponds to a signal indicating the detection result of the above-mentioned dummy instruction.
  • the dummy instruction detection function 21 does not output the broadcast instruction signal to the broadcast terminal of the transmission control function 20.
  • the transmission control function 20 distributes the input instruction to all the bus instruction buffers 22a to 22c.
  • the transmission control function 20 distributes the input instruction to any one of the bus instruction buffers 22a to 22c.
  • the dummy instruction after all the first instruction is for all the bus instruction buffers 22a to 22c.
  • the second instruction is stored in any one of the bus instruction buffers 22a to 22c after the dummy instruction.
  • the transmission control function 20 and the dummy instruction detection function 21 function as an instruction control unit.
  • Each of bus instruction buffers 22a to 22c can store a plurality of instructions.
  • Each of bus instruction buffers 22a to 22c stores an instruction input from transmission control function 20.
  • Each of bus instruction buffers 22a to 22c stores instructions in a first in first out (FIFO) manner. Therefore, the instructions stored in each of the bus instruction buffers 22a to 22c are sequentially taken out in the stored order, and transmitted to the buses 91 to 93, respectively.
  • FIFO first in first out
  • the bus instruction buffer 22 a is connected to the bus 91
  • the bus instruction buffer 22 b is connected to the bus 92
  • the bus instruction buffer 22 c is connected to the bus 93. Therefore, the instruction stored in the bus instruction buffer 22 a is output to the module 4 via the bus 91.
  • the instruction stored in the bus instruction buffer 22 b is output to the module 4 via the bus 92.
  • the instruction stored in the bus instruction buffer 22 c is output to the module 4 via the bus 93.
  • the timing adjustment function 23 controls the output of the instruction from each of the bus instruction buffers 22a to 22c to the module 4 using the dummy instruction, to guarantee the order of the instruction.
  • the timing adjustment function 23 functions as an output control unit.
  • the timing adjustment function 23 monitors the instruction output from each of the bus instruction buffers 22a to 22c, and stops operation of the bus instruction buffer 22 when detecting the bus instruction buffer 22 that outputs a dummy instruction. . In other words, the timing adjustment function 23 stops the output of the instruction from the bus instruction buffer 22 to the module 4. Even after that, the timing adjustment function 23 stops the operation of the bus instruction buffer 22 each time it detects a new bus instruction buffer 22 that outputs a dummy instruction. Then, when the instruction outputted by all the bus instruction buffers 22a to 22c becomes a dummy instruction, the timing adjustment function 23 resumes the operation of the bus instruction buffer 22 which has been stopped. That is, the timing adjustment function 23 resumes the output of the instruction to the module 4 from the bus instruction buffer 22 which has been stopped.
  • the output of the instruction after the dummy instruction to the module 4 is stopped until the dummy instructions are aligned with the outputs from all the bus instruction buffers 22a to 22c. Therefore, when there is a first instruction and a second instruction to be executed after the first instruction, at least the first instruction is output, and a dummy instruction after the first instruction is output. The second instruction after the dummy instruction is not output until the second instruction. That is, the order of the first instruction and the second instruction is guaranteed.
  • the bus instruction buffers 22a to 22c and the timing adjustment function 23 are realized by, for example, a circuit described below.
  • the timing adjustment function 23 outputs the stop signal to the stop signal input terminal of the bus instruction buffer 22 for outputting the dummy instruction until all the bus instruction buffers 22a to 22c output the dummy instruction.
  • the bus instruction buffer 22 stops its operation. More specifically, the bus instruction buffer 22 stops the output operation of the instruction to the module 4 in response to the stop signal from the timing adjustment function 23.
  • the transfer sequence of data (instructions) on the bus from the bus instruction buffer 22 to the module 4 is interrupted. This transfer sequence conforms to the communication standard on the buses 91 to 93.
  • the bus instruction buffer 22 stops the transfer sequence of instructions to the module 4 by stopping the operation of the bus instruction buffer 22.
  • the method of interrupting has been described, the present invention is not limited to this method, and other methods may be used.
  • the timing adjustment function 23 temporarily acquires an instruction output from the bus instruction buffer 22, and if the acquired instruction is a dummy instruction, transmission of the instruction is suppressed, and if not, the instruction is issued to the module 4. You may make it transmit.
  • the timing adjustment function 23 When the timing adjustment function 23 detects the output of the dummy instruction from all the bus instruction buffers 22a to 22c, it stops the output of the stop signal. When the stop signal is not input from the timing adjustment function 23, the bus instruction buffer 22 that has stopped the operation resumes its operation. More specifically, in response to the release of the stop signal from the timing adjustment function 23, the bus instruction buffer 22 resumes the output operation of the instruction to the module 4. Here, as described later, the dummy instruction is discarded at this time. Therefore, for the instruction following the dummy instruction, the transfer sequence of the instruction from the bus instruction buffer 22 to the module 4 is started. That is, transmission of instructions from all of the bus instruction buffers 22a to 22c to the module 4 is resumed.
  • FIG. 2 shows the configurations of the transmission control function 20 and the timing adjustment function 23 provided in the interface board 2 in more detail.
  • the transmission control function 20 includes an instruction distribution unit 201, an instruction distribution unit 202, and an inverter 209.
  • the timing adjustment function 23 includes dummy instruction detection units 231a to 231c and an AND circuit 232.
  • the dummy instruction detection units 231a to 231c will be simply referred to as “dummy instruction detection unit 231" when not limited to any one.
  • the instruction input to the transmission control function 20 is input to both the instruction distribution unit 201 and the instruction distribution unit 202.
  • the instruction distribution unit 201 distributes the input instruction to any one of the bus instruction buffers 22a to 22c according to the destination.
  • the instruction distribution unit 202 distributes the input instruction to all of the bus instruction buffers 22a to 22c.
  • the instruction distribution unit 201 and the instruction distribution unit 202 operate complementarily depending on whether a broadcast instruction signal is input from the dummy instruction detection function 21 to the transmission control function 20.
  • the instruction distribution unit 201 operates and the instruction distribution unit 202 stops its operation.
  • the instruction distribution unit 201 stops its operation, and the instruction distribution unit 202 operates.
  • the instruction distribution unit 201 and the instruction distribution unit 202 operate, for example, as described below.
  • the dummy instruction detection function 21 outputs, to the instruction distribution unit 201 and the instruction distribution unit 202, a signal which can be switched between high level and low level.
  • the dummy instruction detection function 21 outputs a high level signal.
  • the dummy instruction detection function 21 outputs a low level signal.
  • This signal is input to the instruction distribution unit 202 as it is, and a signal inverted via the inverter 209 is input to the instruction distribution unit 201.
  • the instruction distribution unit 201 and the instruction distribution unit 202 operate when a high level signal is input, and stop the operation when a low level signal is input. That is, the high level signal corresponds to the broadcast instruction signal.
  • Each of the dummy instruction detection units 231a to 231c monitors an instruction output from each of the bus instruction buffers 22a to 22c, and detects an output of the dummy instruction.
  • the dummy instruction detection unit 231a monitors the bus instruction buffer 22a.
  • the dummy instruction detection unit 231b monitors the bus instruction buffer 22b.
  • the dummy instruction detection unit 231c monitors the bus instruction buffer 22c.
  • the dummy instruction detection unit 231a When the dummy instruction is output from the bus instruction buffer 22a, the dummy instruction detection unit 231a outputs a stop signal to the bus instruction buffer 22a and the AND circuit 232.
  • the dummy instruction detection unit 231b When the dummy instruction is output from the bus instruction buffer 22b, the dummy instruction detection unit 231b outputs a stop signal to the bus instruction buffer 22b and the AND circuit 232.
  • the dummy instruction detection unit 231 c outputs a stop signal to the bus instruction buffer 22 c and the AND circuit 232 when the dummy instruction is output from the bus instruction buffer 22 c.
  • the AND circuit 232 outputs a signal generated by an AND operation of the signals input from each of the dummy instruction detection units 231a to 231c to each of the dummy instruction detection units 231a to 231c.
  • the AND circuit 232 outputs a clear signal to each of the dummy instruction detection units 231a to 231c when the stop signal is input from all of the dummy instruction detection units 231a to 231c.
  • the AND circuit 232 does not output the clear signal to each of the dummy instruction detection units 231a to 231c when the stop signal is not input from at least one of the dummy instruction detection units 231a to 231c.
  • the dummy instruction detection units 231a to 231c and the AND circuit 232 operate as described below, for example.
  • Each of the dummy instruction detection units 231a to 231c outputs a signal to be switched between the high level and the low level to each of the bus instruction buffers 22a to 22c and the AND circuit 232.
  • Each of the dummy instruction detection units 231a to 231c outputs a high level signal when the dummy instruction is output from each of the bus instruction buffers 22a to 22c.
  • each of the dummy instruction detection units 231a to 231c outputs a low level signal.
  • Each of the bus instruction buffers 22a to 22c operates when a high level signal is input, and stops the operation when a low level signal is input. That is, the high level signal corresponds to the stop signal.
  • the AND circuit 232 outputs a high level signal to each of the dummy instruction detection units 231a to 231c when a high level signal is input from all of the dummy instruction detection units 231a to 231c.
  • the AND circuit 232 outputs a low level signal to each of the dummy instruction detection units 231a to 231c when the low level signal is input from at least one of the dummy instruction detection units 231a to 231c.
  • each of the dummy instruction detection units 231a to 231c switches the signal output to the bus instruction buffers 22a to 22c and the AND circuit 232 from the high level to the low level. .
  • each of the dummy instruction detection units 231a to 231c does not switch the level of the signal output to the bus instruction buffers 22a to 22c and the AND circuit 232. . That is, the high level signal output from the AND circuit 232 corresponds to the clear signal.
  • FIG. 2 shows the configuration of the external computer 3 in more detail.
  • the external computer 3 has an instruction generation unit 31 and an execution order determination unit 32 in addition to the dummy instruction generation function 30.
  • the instruction generation unit 31 generates a plurality of instructions to be executed by the plurality of modules 4.
  • the execution order determination unit 32 determines whether or not there is an instruction to maintain the execution order among the plurality of instructions generated by the instruction generation unit 31.
  • the dummy instruction generation function 30 generates a dummy instruction and inserts it between the instructions which should maintain the execution order detected by the execution order determination unit 32.
  • the external computer 3 includes a central processing unit (CPU) 300, a memory 301, a hard disk 302, and a communication controller 303.
  • CPU central processing unit
  • memory 301 a hard disk 302
  • communication controller 303 a communication controller
  • the CPU 300 centrally controls the external computer 3.
  • the CPU 300 loads the interpreter 310 stored in the hard disk 302 into the memory 301 and executes it to interpret the source program 311 stored in the hard disk 302 and generate an executable program.
  • the CPU 300 generates an instruction and transmits it to the interface board 2 by executing the generated executable program.
  • the interpreter 310 and the executable program generated by interpreting the source program 311 execute various processes as the dummy instruction generation function 30, the instruction generation unit 31, and the execution order determination unit 32 to the CPU 300. Contains code to make it happen.
  • the memory 301 temporarily stores information used by the CPU 300. This information also includes the interpreter 310 and the source program 311 etc. loaded from the hard disk 302 as described above.
  • the memory 301 is a volatile storage device such as, for example, a dynamic random access memory (DRAM) and a static random access memory (SRAM).
  • DRAM dynamic random access memory
  • SRAM static random access memory
  • the hard disk 302 stores various information such as the interpreter 310 and the source program 311.
  • a non-volatile storage device such as the hard disk 302
  • another storage device such as a flash memory may be used instead of the hard disk 302.
  • the memory 301 and the hard disk 302 function as a storage unit in which information used by the external computer 3 is stored. Note that the number and combination of storage devices functioning as the storage unit are not limited to the above-described example.
  • the communication controller 303 converts the information output from the CPU 300 into a format that can be transmitted to the interface board 2 and transmits it.
  • the format after conversion conforms to the communication standard between the external computer 3 and the interface board 2.
  • the communication controller 303 also receives information from the interface board 2, converts the information into a format that can be processed in the external computer 3, and outputs the converted information to the CPU 300.
  • the interpreter 310 has a function of generating dummy instructions.
  • the source program (source code, atomic program) 311 describes a code that controls the plurality of modules 4.
  • the CPU 300 is executed in a plurality of modules 4 by executing an executable program (load module, machine language program, object code) generated by interpreting (also referred to as sequential compilation) the source program 311 sequentially by the interpreter 310.
  • An instruction is generated and sequentially transmitted to the plurality of modules 4 via the interface board 2.
  • the CPU 300 when generating and transmitting an instruction which should follow the execution order, the CPU 300 generates and transmits a dummy instruction between those instructions.
  • the interpreter 310 adds a code that generates and transmits dummy instructions between those codes and causes the CPU 300 to execute the code.
  • the external computer 3 can insert dummy instructions between the instructions that should follow the execution order and send those instructions to the interface board 2.
  • the method of controlling the plurality of modules 4 is not limited to the example in which the executable program generated by sequentially interpreting the source program 311 by the interpreter 310 is executed as described above.
  • a compiler may be stored in the hard disk 302 instead of the interpreter 310, and the CPU 300 may execute an executable program generated by the compiler interpreting the source program 311 collectively (also referred to as batch compilation).
  • the compiler causes the CPU 300 to execute a process of generating an executable program by adding a code for generating and transmitting a dummy instruction between codes for generating and transmitting an instruction to be kept in execution order.
  • the CPU 300 it is possible to cause the CPU 300 to execute a process of generating a dummy instruction while checking the order of instructions by providing an executable program itself with an instruction determination function and a dummy instruction generation function that should keep the execution order.
  • dummy instructions are inserted between the instructions that should follow the execution order, and these instructions are transmitted to the interface board 2.
  • FIG. 4 illustrates an example in which the instruction generation unit 31 of the external computer 3 generates instructions in order of instructions A to F.
  • the instruction C, the instruction D, and the instruction F are instructions for which the execution order should be maintained. That is, it is assumed that the instruction D needs to be executed after the execution of the instruction C, and the instruction F needs to be executed after the execution of the instruction D.
  • the dummy instruction generation function 30 inserts the dummy instruction A between the instruction C and the instruction D, and inserts the dummy instruction B between the instruction D and the instruction F. Therefore, as shown by “data of communication path 90” in FIG. 4, the external computer 3 sequentially executes instruction A, instruction B, instruction C, dummy instruction A, instruction D, instruction E, dummy instruction B, and instruction F. The instructions are sequentially transmitted to the interface board 2 via the communication path 90 one by one.
  • the communication speed of the communication path 90 is preferably higher than the communication speed of the buses 91 to 93.
  • a plurality of instructions (instructions A to F and dummy instructions A and B) can be transmitted on the communication path 90 within the time of transmitting one instruction on the buses 91 to 93.
  • FIG. 4 shows an example in which at least eight instructions can be transmitted on the communication path 90 within the time of transmitting one instruction on the buses 91 to 93, the relationship of the number of instructions is not limited to this. .
  • Such a relationship between the communication path 90 and the plurality of buses 91 to 93 enables continuous transmission of instructions to the module 4 without exhaustion of the instructions on the buses 91 to 93. It becomes.
  • instruction A, instruction B, and instruction C are instructions executed by module 4 connected to bus 91
  • instruction D is an instruction executed by module 4 connected to bus 92
  • E and instruction F are instructions to be executed by the module 4 connected to the bus 93.
  • each of the bus instruction buffers 22a to 22c transmits an instruction to each of the buses 91 to 93. That is, the bus instruction buffer 22a stores instructions in the order of the instruction A, the instruction B, the instruction C, the dummy instruction A, and the dummy instruction B, and transmits the instructions in that order.
  • the bus instruction buffer 22b stores instructions in the order of the dummy instruction A, the instruction D, and the dummy instruction B, and transmits the instructions in that order.
  • the bus instruction buffer 22c stores instructions in the order of the dummy instruction A, the instruction E, the dummy instruction B, and the instruction F, and transmits the instructions in that order.
  • the states of the buses 91 to 93 according to the passage of time in this case will be described.
  • the instruction A stored in the bus instruction buffer 22 a is transmitted to the bus 91.
  • the module 4 connected to the bus 91 receives and executes the instruction A transmitted from the bus instruction buffer 22a.
  • the instruction transmitted from the bus instruction buffer 22a is not the dummy instruction A, but the instruction transmitted from the bus instruction buffers 22b and 22c is the dummy instruction A. Therefore, the timing adjustment function 23 stops the operation of the bus instruction buffers 22 b and 22 c for transmitting the dummy instruction A.
  • reception by the module 4 of the dummy instruction A transmitted from the bus instruction buffers 22b and 22c is not completed.
  • the instruction B stored in the bus instruction buffer 22 a is transmitted to the bus 91.
  • the module 4 connected to the bus 91 receives and executes the instruction B transmitted from the bus instruction buffer 22a.
  • the instruction transmitted from the bus instruction buffer 22a is not the dummy instruction A, but the instruction transmitted from the bus instruction buffers 22b and 22c is the dummy instruction A. Therefore, the timing adjustment function 23 continues to stop the operation of the bus instruction buffers 22b and 22c for transmitting the dummy instruction A.
  • the instruction C stored in the bus instruction buffer 22 a is transmitted to the bus 91.
  • the module 4 connected to the bus 91 receives and executes the instruction C transmitted from the bus instruction buffer 22a.
  • the instruction transmitted from the bus instruction buffer 22a is not the dummy instruction A, but the instruction transmitted from the bus instruction buffers 22b and 22c is the dummy instruction A. Therefore, the timing adjustment function 23 continues to stop the operation of the bus instruction buffers 22b and 22c for transmitting the dummy instruction A.
  • the instruction transmitted from the bus instruction buffers 22b and 22c is not the dummy instruction B, but the instruction transmitted from the bus instruction buffer 22a is the dummy instruction B. Therefore, the timing adjustment function 23 stops the operation of the bus instruction buffer 22a that transmits the dummy instruction B.
  • the dummy instruction B stored in the bus instruction buffer 22 b is also transmitted to the bus 92.
  • the dummy instruction B stored in the bus instruction buffer 22 c is also transmitted to the bus 93. Therefore, the instruction transmitted from all of the bus instruction buffers 22a to 22c is the dummy instruction B. Therefore, the timing adjustment function 23 resumes the operation of the bus instruction buffer 22a.
  • the order execution of instruction execution is guaranteed even among the group of modules 4 that execute instructions independently and in parallel. be able to.
  • the CPU 300 of the external computer 3 creates the source program 311 according to the input from the user (S1).
  • code for controlling the plurality of modules 4 is described.
  • a code that generates a sensor value acquisition command and a motor drive command and transmits the command to the module 4 is described.
  • the input from the above-mentioned user is implemented by operating the input device (not shown) which the external computer 3 has.
  • the input device is, for example, a keyboard and a mouse.
  • the CPU 300 of the external computer 3 executes the interpreter 310 to sequentially interpret the source program 311 to generate and execute an executable program (S2).
  • various instructions are generated by the external computer 3 and sequentially transmitted to the plurality of modules 4 through the interface board 2.
  • the operation of the gadget configured by the plurality of modules 4 is realized (S3).
  • the operation of the external computer 3 according to the first embodiment will be described with reference to FIG.
  • the external computer 3 interprets the source program 311 sequentially and executes an executable program by executing the interpreter 310, the external computer 3 repeatedly executes the processing of the following steps S11 to S14.
  • the execution order determination unit 32 determines the order between the instruction generated by the code of the i-th line to be interpreted and the instruction generated by the code before the i-1 line (including the i-1 line). It is determined whether or not there is a restriction (S11) (i is an arbitrary positive integer).
  • the execution order determination unit 32 analyzes, for example, the source code 311, and the instruction generated in the code before the i-1th line is a sensor value acquisition instruction, and the instruction generated in the i-th line is the sensor In the case of a motor drive instruction based on the sensor value acquired by the value acquisition instruction, it is determined that the order of the both is restricted.
  • any method among the following methods (1) to (4) may be adopted.
  • This execution method determination unit 32 sequentially investigates from the i-1 line to the line where the dummy instruction was generated immediately before.
  • the execution order determination unit 32 examines lines from the (i-1) -th line to lines that trace back the predetermined line number.
  • the dummy instruction generation function 30 Generate (S12).
  • a dummy instruction is inserted between the code corresponding to the i-th line and the code corresponding to the line determined to be restricted in order before the i-1st line. The code to be sent is inserted.
  • the dummy instruction generation function 30 determines that the order of the instruction on the i-th row and the instruction on or before the i-th row is not restricted by the execution order determination unit 32 (S11: No) No instruction is generated.
  • the instruction generating unit 31 When the process of transmitting an instruction to the module 4 is described in the i-th line of the source program 311, the instruction generating unit 31 generates an instruction from the description in the i-th line of the source program 311 (S13).
  • the instruction generation unit 31 adds, to the generated instruction, target bus information indicating a bus to which the instruction is to be transmitted (S14).
  • the bus to which the instruction is to be transmitted is determined based on the corresponding data indicating the module 4 and the bus to which the module 4 is connected.
  • the corresponding data is stored in advance in the hard disk 302, for example.
  • the code for generating the instruction indicates the module 4 to which the instruction is to be sent. Therefore, based on the corresponding data, the instruction generation unit 31 generates, from the module 4 to which the instruction is transmitted, target bus information indicating a bus to which the instruction is to be transmitted, and adds the object bus information to the instruction.
  • the transmission control function 20 instruction distribution unit 201 of the interface board 2 receives an instruction from the external computer 3, the transmission instruction function 22 for the bus corresponding to the bus indicated by the target bus information added to the instruction Assign the instruction.
  • the transmission control function 20 instruction distribution unit 201) can correctly distribute the instruction to the bus instruction buffer 22 corresponding to the transmission destination.
  • the dummy instruction generation function 30 when it is determined that there is a restriction on the order between the instruction on the i-th row and the instructions on or before the i-1th row, the dummy instruction generation function 30 generates a dummy instruction in step S12. After transmission, the instruction generation unit 31 generates and transmits an instruction in step S13. On the other hand, when it is determined that there is no restriction on the order between the instruction on the i-th row and the instructions on or before the i-1th row, no dummy instruction is transmitted, and only the instruction generation unit 31 performs the instruction in step S13. Generate and send
  • the sensor value acquisition instruction and the sensor value acquisition instruction and the motor drive instruction having a restricted order are transmitted to different buses, the sensor value acquisition instruction and the motor drive instruction A dummy instruction can be inserted between and sent. Therefore, the control using the dummy instruction in the interface board 2 can prevent the motor drive instruction from overtaking and executing the sensor value acquisition instruction as described with reference to FIG. 4. Therefore, for example, a malfunction such as driving the motor based on the sensor value one cycle before can be avoided.
  • the dummy instruction detection function 21 determines whether the instruction received from the external computer 3 is a dummy instruction (S21). When it is determined that the instruction received from the external computer 3 is not a dummy instruction (S21: No), the transmission control function 20 causes the instruction allocation unit 201 to transmit the instruction to the bus indicated by the target bus information included in the instruction. It distributes (S22). On the other hand, when it is determined that the command received from the external computer 3 is a dummy command (S21: Yes), the transmission control function 20 causes the command distribution unit 202 to distribute the command to all the buses 91 to 93 ( S23).
  • the dummy instruction detection units 231a to 231c of the timing adjustment function 23 determine whether the instruction output from the corresponding bus instruction buffer 22a to 22c is a dummy instruction (S31). When the dummy instruction detection units 231a to 231c determine that the instruction output from the bus instruction buffers 22a to 22c is not a dummy instruction (S31: No), the output of the instruction from the bus instruction buffers 22a to 22c to the bus Is allowed (S32).
  • the dummy instruction detection units 231a to 231c determine that the instruction output from the bus instruction buffers 22a to 22c corresponding to the dummy instruction detection unit 231 is a dummy instruction (S31: Yes)
  • the output of the instruction from the instruction buffers 22a to 22c to the bus is stopped (S33).
  • the timing adjustment function 23 determines whether dummy instructions are output from all the bus instruction buffers 22a to 22c (S34). That is, the dummy instruction detection unit 231 determines whether the clear signal is input.
  • the timing adjustment function 23 determines that the dummy instruction is output from all the bus instruction buffers 22a to 22c (S34: Yes), the dummy instruction of the bus instruction buffers 22a to 22c is discarded (S35). ).
  • the discarding of the dummy instruction is performed by discarding the instruction output by each of the bus instruction buffers 22a to 22c at the timing at which the output of the stop instruction from each of the dummy instruction detecting units 231a to 231c is canceled. Do.
  • the instructions output from the bus instruction buffers 22a to 22c are not dummy instructions (S31: No), and the instructions are output from the bus instruction buffers 22a to 22c (S32).
  • the timing adjustment function 23 determines that dummy instructions are not output from all the bus instruction buffers 22a to 22c (S34: No)
  • discarding of dummy instructions for those bus instruction buffers 22a to 22c is Not implemented
  • the interface board 2 has a transmission control function 20, a dummy instruction detection function 21, a bus instruction buffer 22a to 22c, and a transmission function 200 having a timing adjustment function 23. , Reception function 220.
  • the reception function 220 has a reception control function 221 and instruction buffers for reception bus 222a to 222c.
  • Each of reception bus instruction buffers 222a to 222c can store a plurality of instructions.
  • Each of reception bus instruction buffers 222a to 222c stores an instruction received from module 4 via each of buses 91 to 93.
  • Each of the receive bus instruction buffers 222a to 222c stores instructions in a first-in first-out (FIFO) manner. Therefore, each of the reception bus instruction buffers 222a to 222c sequentially outputs instructions to the reception control function 221 in the order of storage.
  • FIFO first-in first-out
  • the reception control function 221 sequentially transmits the instructions input from the reception bus instruction buffers 222a to 222c to the external computer 3 one by one in the order of arrival via the communication path 90. That is, when the communication path 90 and the buses 91 to 93 are occupied by an instruction transmitted from the module 4 to the external computer 3 similarly to the instruction for occupying the communication path 90 and the buses 91 to 93 shown in FIG. There is also a possibility.
  • the command sent from the module 4 to the external computer 3 is not limited to the command itself that the module 4 instructs the external computer 3 to perform processing, and the information to which the module 4 responds in response to the command from the external computer 3 Also included.
  • This information is, for example, a sensor value that the module 4 transmits to the external computer 3 in response to a sensor value acquisition command.
  • the module control system 1 sequentially receives the bus instruction buffers 22a to 22c for outputting the instructions on a first-in first-out basis to the buses 91 to 93 (module 4 group), respectively. And a timing control function 23 for controlling the output of instructions from the bus instruction buffers 22a to 22c.
  • the transmission control function 20 applies the input instruction to all of the bus instruction buffers 22a to 22c. Distribute. Then, the timing adjustment function 23 operates the bus (module 4 group) from the bus instruction buffer 22 for which the instruction to be output is a dummy instruction until the instruction to be output for all the bus instruction buffers 22a to 22c becomes a dummy instruction. Suppress the output of instructions to
  • the instruction A to the instruction F shown in FIG. 4 are transmitted without implementing control by the dummy instruction according to the first embodiment, the instruction A to the instruction F are transmitted as shown in FIG. That is, the interface board 2 immediately distributes each of the instructions A to F received from the external computer 3 via the communication path 90 to each of the buses 91 to 93 for transmission.
  • the instruction A is transmitted to the bus 91
  • the instruction D is transmitted to the bus 92
  • the instruction E is transmitted to the bus 93.
  • the instruction B is transmitted to the bus 91
  • the instruction F is transmitted to the bus 93.
  • the instruction C is transmitted to the bus 91.
  • the instruction D to be executed after the instruction C is sent to the module 4 prior to the instruction C and executed.
  • the order of the instructions can be ensured as shown in FIG.
  • the module control system 1 is not limited to a mode in which the external computer 3 and the interface board 2 are directly connected as shown in FIGS. 1 and 2, and as shown in FIG. 11, the external computer 3 and the interface board 2 are processed You may make it connect via 5.
  • the external computer 3 is connected to the processing device 5 via the communication path 90.
  • the processing device 5 is connected to the interface board 2 via the communication path 95.
  • the processing device 5 is, for example, a microcomputer board.
  • the processing device 5 has an instruction memory 50.
  • the instruction memory 50 temporarily stores the instruction received from the external computer 3.
  • the instruction memory 50 is a volatile storage device such as a DRAM and an SRAM. Then, the processing device 5 may temporarily store the instruction received from the external computer 3 in the instruction memory 50 and then sequentially transmit the instruction to the interface board 2.
  • the instruction memory 50 also stores instructions in a first-in first-out (FIFO) manner.
  • the method of using the processing device 5 is not limited to only relaying the instruction transmitted from the external computer 3 as described above, and as shown in FIG. 12, the external computer 3 collectively interprets the source program 311 by the compiler.
  • the instructions may be transmitted to the interface board 2 by executing the executable program generated in the above in the processing device 5.
  • the external computer 3 has a program generation unit 320.
  • the CPU 300 of the external computer 3 functions as the program generation unit 320 by taking charge of the function of the above-mentioned compiler.
  • the program generation unit 320 further includes an execution order determination unit 32. When the execution order determination unit 32 detects an instruction that should maintain the execution order, the program generation unit 320 generates and transmits a dummy instruction between the codes that generate and transmit the instruction that should maintain the execution order. Add code to create an executable program.
  • the external computer 3 transmits the generated executable program to the processing device 5.
  • the processing device 5 includes a program execution unit 321.
  • the CPU (not shown) of the processing device 5 functions as the program execution unit 321 by executing the executable program received from the external computer 3.
  • the program execution unit 321 further includes a dummy instruction generation function 30 and an instruction generation unit 31.
  • the execution of the executable program by the CPU of the processing device 5 generates instructions sequentially and transmits them to the interface board 2. Also, at this time, a dummy instruction is generated and inserted between the instructions whose execution order is to be maintained. That is, the CPU of the processing device 5 functions as the instruction generation function 30 and the instruction generation unit 31 by executing the executable program.
  • the processing device 5 may be stored in the storage device of the processing device 5 and executed at an arbitrary timing without immediately executing the executable program upon reception. According to this, it is possible to control by connecting only the processing device 5 and the interface board 2 to the plurality of modules 4 without connecting the external computer 3. Therefore, the restriction of the operation range of the gadget configured by the plurality of modules 4 can be eliminated. For example, in the state where the external computer 3 and the interface board 2 are connected by a cable, the length of the cable limits the operation range of the gadget.
  • the processing device 5 for example, microcomputer board
  • the interface board 2 are smaller than the external computer 3 (for example, PC) Therefore, the processing apparatus 5 and the interface board 2 can be operated with no restriction on the operation range while being mounted on the gadget.
  • the interface board 2 according to the second embodiment further includes an overflow detection unit 24 as compared to the interface board 2 according to the first embodiment.
  • the overflow detection unit 24 detects an overflow of each of the bus instruction buffers 22a to 22c. When the overflow is detected in at least one of the bus instruction buffers 22a to 22c, the overflow detection unit 24 transmits, to the external computer 3, a notification signal for notifying the detection of the overflow.
  • the dummy instruction generation function 30 and the instruction generation unit 31 of the external computer 3 stop the generation / transmission of the instruction in response to the notification signal from the interface board 2.
  • the external computer 3 may restart the transmission of the command after restoring the interface board 2 by resetting the interface board 2 or the like.
  • the overflow detection unit 24 detects that the bus instruction buffer 22 has overflowed, and notifies the external computer 3 as an input source of the instruction. According to this, the external computer 3 can suppress the continuation of the operation in the state where the bus instruction buffers 22a to 22c of the interface board 2 overflow in response to the notification. Therefore, it is possible to prevent the operation from being continued when an abnormality occurs.
  • the interface board 2 includes the overflow detection unit 24 that detects overflow of the bus instruction buffers 22a to 22c, but the present invention is not limited to this.
  • the interface board 2 may have a buffer full detection unit for detecting buffer fullness of the bus instruction buffers 22a to 22c (when the bus instruction buffer 22 is full).
  • the buffer full detection unit when the buffer full detection unit detects that at least one of the bus instruction buffers 22a to 22c becomes buffer full, a notification signal notifying the detection of buffer full is sent to the external computer 3 Send.
  • the dummy instruction generation function 30 and the instruction generation unit 31 of the external computer 3 stop the generation / transmission of the instruction in response to the notification signal from the interface board 2.
  • the buffer full detection unit may cancel the transmission of the communication signal to the external computer 3 when the buffer full of the bus instruction buffers 22a to 22c is eliminated. In this case, the dummy instruction generation function 30 and the instruction generation unit 31 of the external computer 3 may resume the generation / transmission of the instruction in response to the cancellation of the transmission of the notification signal from the interface board 2.
  • the overflow of the bus instruction buffers 22a to 22c of the interface board 2 can be prevented. Therefore, control can be prevented from being continued when an abnormality occurs.
  • module control system 1 connects the external computer 3 and the interface board 2 via the processing device 5 as in the example shown in FIG. 11. You may do so.
  • the overflow detection unit 24 transmits a notification signal to the processing device 5.
  • the processing device 5 stops transmission of the instruction stored in the instruction memory 50.
  • a buffer full detection unit may be provided instead of the overflow detection unit 24, a buffer full detection unit may be provided.
  • the external computer 3 executes an executable program generated by the compiler interpreting the source program 311 at one time by the processing device 5 to execute an instruction to the interface board 2. You may make it transmit. In this case, the CPU of the processing device 5 stops the transmission of the instruction in response to the notification signal by including the process of stopping the transmission of the instruction in response to the notification signal from the interface board 2 in the executable program. You may In addition, abnormal processing is included in the executable program, and when the CPU of the processing device 5 receives a notification signal when this executable program is executed, the interface board 2 is reset as abnormal processing, etc. After the board 2 is restored, the transmission of the instruction may be resumed.
  • the configurations of the interface board and the external computer according to the third embodiment will be described with reference to FIG.
  • the interface board 2 according to the third embodiment is different from the interface board 2 according to the first embodiment in that a timer 25 is further provided.
  • the timer 25 is a circuit that outputs, to the AND circuit 232, a notification signal that periodically notifies that a predetermined period of time has elapsed. Therefore, the AND circuit 232 according to the third embodiment receives the stop signal from all of the dummy instruction detection units 231a to 231c, and receives the notification signal from the timer 25. A clear signal is output to all of 231a to 231c. On the other hand, when at least one of the stop signal from each of the dummy instruction detection units 231a to 231c and the stop signal from the timer 25 is not input, the clear signal is output to the dummy instruction detection units 231a to 231c. do not do.
  • the timer 25 outputs, to the AND circuit 232, a pulse signal that becomes high level for a predetermined period of time each time a predetermined period of time elapses. Therefore, this pulse signal (high level signal) corresponds to a notification signal.
  • the AND circuit 232 outputs a high level signal to all of the dummy instruction detection units 231a to 231c when a high level signal is input from all of the dummy instruction detection units 231a to 231c and the timer 25.
  • AND circuit 232 outputs a low level signal to all of dummy instruction detection units 231a to 231c. Output.
  • the operation of the bus instruction buffers 22a to 22c and the dummy instruction detection units 231a to 231c depending on whether the input signal is high level or low level is as described in the first embodiment.
  • FIG. 16 illustrates an example in which the instruction generation unit 31 of the external computer 3 generates instructions in the order of instructions A to F, as in the example shown in FIG. 4 in the first embodiment.
  • the cycle in which the timer 25 outputs the notification signal is every five unit time, and is assumed to be "time 5" and "time 10".
  • the states of the buses 91 to 93 in “time 1” to “time 3” are the same as those in FIG.
  • the timer 25 sends a timer notification of a fixed cycle to the timing adjustment function 23. Therefore, since the instruction transmitted from all the bus instruction buffers 22a to 22c is the dummy instruction A and the timer notification is performed from the timer 25, the timing adjustment function 23 resumes the operation of the bus instruction buffers 22a to 22c. Let At this time, the bus instruction buffers 22a to 22c discard the dummy instruction A.
  • the dummy instruction B stored in the bus instruction buffer 22 a is transmitted to the bus 91.
  • the bus instruction buffer 22 b transmits the instruction D to the bus 92.
  • the bus instruction buffer 22 c also transmits the instruction E to the bus 93.
  • the dummy instruction B stored in the bus instruction buffer 22 b is transmitted to the bus 92.
  • the dummy instruction B stored in the bus instruction buffer 22 c is transmitted to the bus 93.
  • timer notification from the timer 25 to the timing adjustment function 23 is not performed.
  • the timing adjustment function 23 stops the operation of the bus instruction buffers 22a to 22c transmitting the dummy instruction B.
  • the timer 25 notifies the timing adjustment function 23 of the elapse of a fixed period of time. Therefore, since the instruction transmitted from all of the bus instruction buffers 22a to 22c is the dummy instruction B and the timer notification is performed from the timer 25, the timing adjustment function 23 resumes the operation of the bus instruction buffers 22a to 22c. Let At this time, the bus instruction buffers 22a to 22c discard the dummy instruction B. Thus, the bus instruction buffer 22c transmits the instruction F to the bus 93. The module 4 connected to the bus 93 receives and executes the instruction F transmitted from the bus instruction buffer 22c.
  • the module control system 1 by setting the cycle of the timer 25 as a control cycle, it is possible to control the module 4 for each control cycle. Further, according to the module control system 1 according to the third embodiment, it is possible to divide an instruction to be executed for each control cycle. For example, instructions from dummy instruction A to dummy instruction B can be executed in a period from time 5 to time 9, and instructions after dummy instruction B can be executed in a period from time 10 to time.
  • the instructions D and E are sensor value acquisition instructions and the instruction F is a motor drive instruction
  • the sensor value acquisition instruction is executed in the period from time 5 to time 9, and the motor in time 10 to the period
  • An instruction can be divided and executed every control cycle, such as executing a driving instruction.
  • step S36 is added.
  • the timing adjustment function 23 determines whether dummy instructions are output from all the bus instruction buffers 22a to 22c and the output of the timer 25 is 1 (high level) (S34, 36). .
  • the timing adjustment function 23 determines that the dummy instruction is output from all the bus instruction buffers 22a to 22c and the output of the timer 25 is 1 (high level) (S34: Yes, S36: Yes) And the dummy instructions of the bus instruction buffers 22a to 22c are discarded (S35).
  • S32 the output of instructions from the bus instruction buffers 22a to 22c to the buses 91 to 93 is resumed
  • the timing adjustment function 23 keeps the instruction output in all the bus instruction buffers 22a to 22c as a dummy instruction and the timer 25 outputs a notification signal.
  • the output of the instruction from the bus instruction buffer 22 in which the instruction to be output is a dummy instruction is suppressed. According to this, it is possible to execute the instruction following the dummy instruction at each cycle of the timer 25.
  • control of the module 4 can be performed in a predetermined control cycle.
  • instructions between dummy instructions are divided and executed every cycle of the timer 25. That is, instructions can be divided and executed for each control cycle.
  • the external computer 3 and the interface board 2 may be connected via the processing device 5 as in the example shown in FIG. Further, also in the third embodiment, as in the example shown in FIG. 12, the instructions are executed by the processing device 5 executing an executable program generated by the external computer 3 collectively interpreting the source program 311 by the compiler. May be sent to the interface board 2.
  • the configurations of the interface board 2 and the external computer 3 according to the fourth embodiment will be described with reference to FIG.
  • the external computer 3 according to the fourth embodiment further includes a dummy instruction detection unit 33 in comparison with the external computer 3 according to the third embodiment.
  • the dummy instruction detection unit 33 detects a dummy instruction N ahead of the dummy instruction detected by the timing adjustment function 23 (N is a predetermined positive integer). That is, the dummy instruction detection unit 33 detects the Nth dummy instruction (not including the first dummy instruction) from the transmission of the first dummy instruction transmitted to the interface board 2. In other words, the dummy instruction detection unit 33 detects the dummy instruction transmitted to the N + 1th from the transmission start of the instruction.
  • the dummy instruction detection unit 33 stops the operation of the dummy instruction generation function 30, the instruction generation unit 31, and the execution order determination unit 32 when detecting a dummy instruction N ahead. In other words, the dummy instruction generation function 30 and the instruction generation unit 31 stop the generation / transmission of the instruction.
  • the AND circuit 232 according to the fourth embodiment further includes the dummy instruction detection unit 33 of the external computer 3 in comparison with the AND circuit 232 according to the third embodiment. Also sends a clear signal.
  • the dummy instruction detection unit 33 In response to the reception of the clear signal from the AND circuit 232, the dummy instruction detection unit 33 resumes the operations of the dummy instruction generation function 30, the instruction generation unit 31, and the execution order determination unit 32. In other words, the dummy instruction generation function 30 and the instruction generation unit 31 resume the generation / transmission of the instruction.
  • the external computer 3 when waiting for the output of the x-th dummy instruction in the timing adjustment function 23, the external computer 3 suppresses the transmission of the instructions after the x + N-th dummy instruction. Therefore, only the instruction transmitted between the xth dummy instruction and the x + Nth dummy instruction is stored in the bus instruction buffers 22a to 22c. Therefore, the number of instructions stored in bus instruction buffers 22a-22c can be suppressed, and overflow of bus instruction buffers 22a-22c can be prevented.
  • the dummy instruction detection unit 33 resumes the operations of the dummy instruction generation function 30, the instruction generation unit 31, and the execution order determination unit 32, and is then transmitted to the interface board 2 next.
  • a dummy instruction one dummy instruction
  • the operations of the dummy instruction generation function 30, the instruction generation unit 31, and the execution order determination unit 32 may be stopped.
  • the instruction transmissions and transmission restarts of the instruction are repeated for each dummy instruction one by one. It is possible to maintain the stored state of the instruction transmitted between the dummy instruction of and the x + Nth dummy instruction.
  • the states of buses 91 to 93 are the same as the example shown in FIG. 16 in the third embodiment, but the state of communication path 90 is different.
  • the external computer 3 stops the generation and transmission of the instruction. Therefore, on the communication path 90, transmission of the dummy instruction B is not completed. As described above, this state is continued until "time 5" when the dummy instruction A is transmitted to all the buses 91 to 93 and the timer 25 outputs a pulse signal.
  • the transmission of the instruction to the buses 92 and 93 is stopped until the dummy instruction A is transmitted to the bus 91.
  • the instruction buffer for buses 22b and 22c corresponding to the buses 92 and 93 is stopped. Only stores the instruction generated between the dummy instruction A and the dummy instruction B. Therefore, the overflow of the bus instruction buffers 22b and 22c can be prevented.
  • the dummy instruction detection unit 33 interrupts the input of an instruction to the interface board 2 in response to the input of the predetermined number of dummy instructions to the interface board 2.
  • the timing adjustment function 23 outputs a clear signal to the external computer 3 when the instruction output in all the bus instruction buffers 22a to 22c is a dummy instruction and the notification signal is output from the timer 25. Then, in response to the output of the notification signal from the timing adjustment function 23, the dummy instruction detection unit 33 resumes the input of the interrupted instruction.
  • the number of instructions stored in the bus instruction buffers 22a to 22c is limited to only the instructions between the first dummy instruction and the predetermined number of dummy instructions. Therefore, the number of instructions stored in bus instruction buffers 22a-22c can be suppressed, and overflow of bus instruction buffers 22a-22c can be prevented.
  • the module control system 1 connects the external computer 3 and the interface board 2 via the processing device 5 as in the example shown in FIG. Good.
  • the processing device 5 may have a dummy instruction detection unit 33 instead of the external computer 3.
  • the processing device 5 stops transmission of the instruction stored in the instruction memory 50. Further, in response to the reception of the clear signal by the dummy instruction detection unit 33, the processing device 5 resumes transmission of the instruction stored in the instruction memory 50.
  • the processing unit 5 executes an executable program generated by the external computer 3 collectively interpreting the source program 311 by the compiler, thereby interfacing the instruction. It may be transmitted to the board 2.
  • the CPU of the processing device 5 transmits the dummy instruction N times ahead by including the processing for stopping the transmission of the instruction when the executable program detects the transmission of the dummy ahead N times. Stop sending instructions accordingly.
  • the CPU of the processing device 5 resumes the transmission of the instruction in response to the clear signal.
  • the embodiment can be implemented in a form in which the interface board 2 does not have the timer 25 (a form in which the dummy instruction detection unit 33 is further included in the first embodiment).
  • the interface board 2 according to the fifth embodiment is different from the interface board 2 according to the fourth embodiment in that the order command detection unit 211 is replaced with the dummy command detection function 21; The difference is that the periodic instruction detection unit 212 and the OR circuit 213 are included.
  • the order instruction detection unit 211 outputs a broadcast instruction signal to the OR circuit 213 when the instruction input to the transmission control function 20 is an order instruction.
  • the periodic instruction detection unit 212 outputs a broadcast instruction signal to the OR circuit 213.
  • the OR circuit 213 outputs the signal generated by the logical sum operation of the signals input from each of the order command detection unit 211 and the periodic command detection unit 212 to the broadcast terminal of the transmission control function 20. In other words, the OR circuit 213 outputs the broadcast instruction signal to the transmission control function 20 when the broadcast instruction signal is input from at least one of the order instruction detection unit 211 and the periodic instruction detection unit 212. On the other hand, the OR circuit 213 does not output the broadcast instruction signal when the broadcast instruction signal is not input from any of the order instruction detection unit 211 and the periodic instruction detection unit 212.
  • the order instruction detection unit 211 and the periodic instruction detection unit 212 are realized, for example, as circuits to be described next.
  • Each of the order command detection unit 211 and the cycle command detection unit 212 outputs, to the transmission control function 20, a signal that can be switched to either the high level or the low level.
  • the order command detection unit 211 When the order command is input to the transmission control function 20, the order command detection unit 211 outputs a high level signal.
  • the order instruction detection unit 211 outputs a low level signal.
  • the periodic instruction detection unit 212 outputs a high level signal.
  • the periodic instruction detection unit 212 outputs a low level signal. That is, the high level signal corresponds to the broadcast instruction signal.
  • the OR circuit 213 outputs a high level signal to the transmission control function 20 when a high level signal is input from at least one of the order instruction detection unit 211 and the periodic instruction detection unit 212.
  • the OR circuit 213 outputs a low level signal to the transmission control function 20 when a low level signal is input from both the order command detection unit 211 and the periodic command detection unit 212.
  • an order instruction and a periodic instruction exist as dummy instructions.
  • the order instruction (1) functions as a dummy instruction in the case of simply keeping the order of the instruction.
  • the periodic instruction (2) functions as a dummy instruction in the case where it is desired to divide the instruction every control period.
  • the interface board 2 according to the fifth embodiment is different from the interface board 2 according to the fourth embodiment in determining dummy instructions instead of the dummy instruction detecting portions 231a to 231c.
  • the difference is that parts 233a to 233c are included.
  • And 237 are different.
  • Each of the dummy instruction determination units 233 a to 233 c includes an order instruction detection unit 2331, a periodic instruction detection unit 2332, and an OR circuit 2333.
  • Each of the dummy instruction determination units 233a to 233c monitors an instruction output from each of the bus instruction buffers 22a to 22c, and detects an output of a dummy instruction (order instruction and periodic instruction).
  • the dummy instruction determination unit 233a monitors the bus instruction buffer 22a
  • the dummy instruction determination unit 233b monitors the bus instruction buffer 22b
  • the dummy instruction determination unit 233c monitors the bus instruction buffer 22c.
  • the dummy instruction determination unit 233a outputs a stop signal to the bus instruction buffer 22a when the sequential instruction or the periodic instruction is output from the bus instruction buffer 22a.
  • the dummy instruction determination unit 233b outputs a stop signal to the bus instruction buffer 22b.
  • the dummy instruction determination unit 233c outputs a stop signal to the bus instruction buffer 22c.
  • each of the dummy instruction determination units 233a to 233c outputs a stop signal to the AND circuit 234 when the sequential instruction is output from each of the bus instruction buffers 22a to 22c.
  • Each of dummy instruction determination units 233a to 233c outputs a stop signal to OR circuit 236 when the cycle instruction is output from each of bus instruction buffers 22a to 22c.
  • order instruction detection unit 2331 when an order instruction is output from corresponding bus instruction buffer 22, order instruction detection unit 2331 outputs a stop signal to OR circuit 2333. Further, when the periodic instruction is output from the corresponding bus instruction buffer 22, the periodic instruction detection unit 2332 outputs a stop signal to the OR circuit 2333 and the OR circuit 236.
  • OR circuit 2333 outputs a signal generated by OR operation of the signals input from each of order instruction detection unit 2331 and periodic instruction detection unit 2332 to corresponding bus instruction buffer 22 and AND circuit 234. .
  • the OR circuit 2333 outputs the stop signal to the OR circuit 2333 and the OR circuit 236 when the stop signal is input from at least one of the order command detection unit 2331 and the cycle instruction detection unit 2332.
  • the OR circuit 2333 does not output the stop signal when the stop signal is not input from both the order command detection unit 2331 and the periodic command detection unit 2332.
  • the order instruction detection unit 2331, the cycle instruction detection unit 2332, and the OR circuit 2333 are realized, for example, as a circuit described below.
  • Each of the order command detection unit 2331 and the cycle command detection unit 2332 outputs, to the transmission control function 20, a signal that can be switched to either high level or low level.
  • the sequential instruction detection unit 2331 When the sequential instruction is output from the corresponding bus instruction buffer 22, the sequential instruction detection unit 2331 outputs a high level signal. On the other hand, when the sequential instruction is not output from the corresponding bus instruction buffer 22, the sequential instruction detection unit 2331 outputs a low level signal.
  • the periodic instruction detection unit 2332 outputs a high level signal.
  • the periodic instruction detection unit 212 outputs a low level signal. That is, the high level signal corresponds to the stop signal.
  • OR circuit 2333 when a high level signal is input from at least one of sequential instruction detection unit 2331 and periodic instruction detection unit 2332, OR circuit 2333 outputs a high level to the corresponding bus instruction buffer and AND circuit 234. Output a signal.
  • OR circuit 2333 when a low level signal is input from both of order command detection unit 2331 and periodic command detection unit 2332, OR circuit 2333 sends a low level signal to the corresponding bus command buffer and AND circuit 234. Output.
  • the AND circuit 234 outputs, to the AND circuit 235 and the selection circuit 237, a signal generated by an AND operation of the signals input from each of the dummy instruction determination units 233a to 233c.
  • the AND circuit 234 outputs a stop signal to the AND circuit 235 when the stop signal is input from all of the dummy instruction determination units 233a to 233c. This stop signal functions as a clear signal.
  • the AND circuit 232 does not output the clear signal to the AND circuit 235 and the selection circuit 237 when the stop signal is not input from at least one of the dummy instruction determination units 233a to 233c.
  • the AND circuit 235 outputs, to the selection circuit 237, a signal generated by an AND operation of the signals input from each of the AND circuit 234 and the timer 25.
  • the AND circuit 235 outputs a clear signal to the selection circuit 237.
  • the AND circuit 235 does not output the clear signal to the selection circuit 237.
  • the OR circuit 236 outputs, to the signal selection terminal of the selection circuit 237, a signal generated by an AND operation of the signals input from each of the dummy instruction determination units 233a to 233c.
  • the OR circuit 236 outputs a selection signal for selecting the clear signal of the AND circuit 235 to the selection circuit 237 when the stop signal is input from at least one of the dummy instruction determination units 233a to 233c.
  • the OR circuit 236 outputs a selection signal for selecting the clear signal of the AND circuit 234 to the selection circuit 237 when the stop signal is not input from any of the dummy instruction determination units 233a to 233c.
  • the selection circuit 237 selects the clear signal input from the AND circuit 234 and outputs it to the dummy instruction determination units 233a to 233c.
  • the selection circuit 237 selects the clear signal inputted from the AND circuit 235 and sends it to the dummy instruction determination unit 233a to 233c. Output.
  • the AND circuits 234 and 235, the OR circuit 236, and the selection circuit 237 operate as described below.
  • the AND circuit 234 outputs a high level signal to the AND circuit 235 and the selection circuit 237 when a high level signal is input from all of the dummy instruction determination units 233a to 233c.
  • the AND circuit 234 outputs a low level signal to the AND circuit 235 and the selection circuit 237 when a low level signal is input from at least one of the dummy instruction determination units 233a to 233c.
  • the AND circuit 235 outputs a high level signal to the AND circuit 235 and the selection circuit 237 when a high level signal is input from all of the AND circuit 234 and the timer 25.
  • the AND circuit 234 outputs a low level signal to the AND circuit 235 and the selection circuit 237.
  • the OR circuit 236 outputs a high level signal to the selection circuit 237 when a high level signal is input from at least one of the dummy instruction determination units 233a to 233c.
  • the OR circuit 236 outputs a low level signal to the selection circuit 237 when a low level signal is input from all of the dummy instruction determination units 233a to 233c.
  • the selection circuit 237 When a high level signal is input from the OR circuit 236, the selection circuit 237 outputs the signal input from the AND circuit 235 to each of the dummy instruction determination units 233a to 233c. On the other hand, when the low level signal is input from the OR circuit 236, the selection circuit 237 outputs the signal input from the AND circuit 234 to each of the dummy instruction determination units 233a to 233c.
  • the high level signal output from the OR circuit 236 corresponds to a selection signal for selecting the clear signal of the AND circuit 235.
  • the low level signal output from the OR circuit 236 corresponds to a selection signal for selecting the clear signal of the AND circuit 234.
  • the high level signals output from the AND circuits 234 and 235 and the selection circuit 237 correspond to the clear signal.
  • the output of the instruction from the bus instruction buffer 22 can be stopped. Thereafter, when the outputs from all the bus instruction buffers 22a to 22c become the sequential instruction or the periodic instruction, the output of the instruction from the stopped bus instruction buffer 22 can be resumed.
  • the dummy instruction is a periodic instruction
  • the output of the instruction from the bus instruction buffer 22 can be resumed only when the timer 25 notifies of the elapse of the constant period.
  • the dummy instruction is an order instruction
  • the output of the instruction from the bus instruction buffer 22 can be resumed without being limited to whether or not the elapse of a fixed cycle is notified from the timer 25.
  • the execution order of instructions can be guaranteed by simply inserting the order instruction between the instructions whose order of instruction is to be maintained by the external computer 3. Then, in addition to guaranteeing the execution order of the instructions, the external computer 3 divides the predetermined control cycle of these instructions by inserting a periodical instruction between the instructions to be executed by dividing by predetermined control cycles. Is also possible.
  • the external computer 3 according to the fifth embodiment is different from the external computer 3 according to the fourth embodiment in that the periodic instruction detection unit 34 is substituted for the dummy instruction detection unit 33. It differs in that it has
  • the cycle instruction detection unit 34 detects a cycle instruction N times ahead of the cycle instruction detected by the timing adjustment function 23 (N is a predetermined positive integer). That is, although the periodic instruction detection unit 34 operates in the same manner as the dummy instruction detection unit 33 according to the fourth embodiment, a dummy instruction detects only the periodic instruction out of the order instruction and the periodic instruction. It is different from part 33.
  • the AND circuit 235 also outputs a signal to the cycle instruction detection unit 34 of the external computer 3. Therefore, the dummy instruction detection unit 33 according to the fourth embodiment resumes the operations of the dummy instruction generation function 30, the instruction generation unit 31, and the execution order determination unit 32 in response to the clear signal from the AND circuit 232.
  • the periodic instruction detection unit 34 resumes the operation of the dummy instruction generation function 30, the instruction generation unit 31, and the execution order determination unit 32 in response to the clear signal from the AND circuit 235.
  • the number of instructions stored in the bus instruction buffers 22a to 22c can be suppressed, and overflow of the bus instruction buffers 22a to 22c can be prevented.
  • the execution order of instructions according to the fifth embodiment will be described with reference to FIG.
  • FIG. 22 an example in which the instruction generation unit 31 of the external computer 3 generates instructions in order of instructions A to G will be described.
  • the instruction E and the instruction F are instructions which should follow the execution order.
  • the instruction C, the instruction D, and the instruction G are instructions that are desired to be divided and executed at predetermined intervals.
  • the number of N is 1 as in the example shown in FIG. 19 in the fourth embodiment.
  • the cycle in which the timer 25 outputs the notification signal is every five unit time, and is “time 5” and “time 10”.
  • the dummy instruction generation function 30 inserts a periodic instruction between instruction C and instruction D, inserts an ordered instruction between instruction E and instruction F, and inserts a periodic instruction between instruction D and instruction G.
  • the external computer 3 executes the instruction A, the instruction B, the instruction C, the periodic instruction A, the instruction D, the instruction E, the order instruction, the instruction F, the periodic instruction B
  • the instruction is sequentially transmitted to the interface board 2 via the communication path 90 one by one in order of.
  • the states in “time 1” to “time 4” are the same as the example shown in FIG. 19 except that the dummy instruction becomes a periodic instruction, and therefore the description will be omitted.
  • the timer 25 sends a timer notification of a fixed cycle to the timing adjustment function 23. Therefore, since the instruction transmitted from all of the bus instruction buffers 22a to 22c becomes a periodic instruction and the timer notification is performed from the timer 25, the timing adjustment function 23 resumes the operation of the bus instruction buffers 22a to 22c. .
  • the order instruction stored in the bus instruction buffer 22 a is transmitted to the bus 91.
  • the instruction D stored in the bus instruction buffer 22 b is transmitted to the bus 92.
  • the bus instruction buffer 22 c also transmits the instruction E to the bus 93.
  • the periodic instruction stored in the bus instruction buffer 22 c is transmitted to the bus 93. Although the instruction transmitted from all of the bus instruction buffers 22a to 22c is a periodic instruction, timer notification from the timer 25 to the timing adjustment function 23 is not performed.
  • the dummy instruction determination units 233a to 233c of the timing adjustment function 23 stop the operation of the bus instruction buffers 22a to 22c transmitting the periodic instruction.
  • the timer 25 notifies the timing adjustment function 23 of the timer. Therefore, since the instruction transmitted from all of the bus instruction buffers 22a to 22c becomes a periodic instruction and the timer notification is performed from the timer 25, the timing adjustment function 23 resumes the operation of the bus instruction buffers 22a to 22c. . Thus, the bus instruction buffer 22b transmits the instruction G to the bus 92.
  • the module control system 1 according to the fifth embodiment described above, as exemplified here, (1) if you simply want to keep the order of the instructions, and (2) if you want to divide the instructions for each control cycle It is possible to mix and implement.
  • the instruction D is a sensor value acquisition instruction and the instruction G is a motor drive instruction
  • the instruction to be executed in each control cycle can be divided into a sensor value acquisition instruction and a motor drive instruction.
  • the instruction E and the instruction F it is also possible to execute in consideration of only the order.
  • the operation of the timing adjustment function 23 of the interface board 2 according to the fifth embodiment is a step after step S33 instead of steps S34 to S35.
  • the difference is that S36 to S40 are executed.
  • the timing adjustment function 23 determines whether or not the order instruction is output from all the bus instruction buffers 22a to 22c (S37). If the timing adjustment function 23 determines that the sequential instruction is output from all the bus instruction buffers 22a to 22c (S37: Yes), it discards the sequential instruction of the bus instruction buffers 22a to 22c (S41). As a result, the output of instructions from the bus instruction buffers 22a to 22c to the buses 91 to 93 is resumed (S32). On the other hand, when the timing adjustment function 23 determines that the sequential instruction is not output from all the bus instruction buffers 22a to 22c (S37: No), it does not discard the sequential instruction of the bus instruction buffers 22a to 22c.
  • the timing adjustment function 23 determines whether a cycle instruction is output from all the bus instruction buffers 22a to 22c and whether the output of the timer 25 is 1 (high level) (S38, 39). .
  • the timing adjustment function 23 determines that the cycle instruction is output from all the bus instruction buffers 22a to 22c and the output of the timer 25 is 1 (high level) (S38: Yes, S39: Yes).
  • the periodic instructions of the bus instruction buffers 22a to 22c are discarded (S40).
  • the output of instructions from the bus instruction buffers 22a to 22c to the buses 91 to 93 is resumed (S32).
  • the periodic instruction of the bus instruction buffers 22a to 22c is not discarded.
  • the timing adjustment function 23 when the dummy instruction is an order instruction, the timing adjustment function 23 not only outputs the notification signal from the timer 25 but all the bus instruction buffers 22a to 22c.
  • the instruction output from the bus instruction buffer 22a which is an ordered instruction, is inhibited from outputting the instruction until the instruction to be output is an ordered instruction.
  • the timing adjustment function 23 outputs the instruction until all the instructions output from the bus instruction buffers 22a to 22c become the periodic instruction and the notification signal is output from the timer. Prevents the output of the instruction from the bus instruction buffer 22a, which is a periodic instruction.
  • the dummy instruction is an ordered instruction, as described in the first and second embodiments, (1) it is possible to simply carry out control in the case of wanting to keep the order of instructions, dummy instruction
  • the cycle instruction is a cycle instruction, as described in the third and fourth embodiments, (2) control can be performed when it is desired to divide an instruction for each control cycle. Therefore, it is possible to mix (1) control for simply keeping the order of instructions and (2) control for separately dividing instructions for each control cycle.
  • the module control system 1 may connect the external computer 3 and the interface board 2 via the processing device 5.
  • the processing device 5 may have the periodic instruction detection unit 34 instead of the external computer 3.
  • the processing device 5 stops the transmission of the instruction stored in the instruction memory 50 when the periodic instruction detection unit 34 detects a dummy instruction N ahead. Further, in response to the reception of the clear signal by the periodic instruction detection unit 34, the processing device 5 resumes transmission of the instruction stored in the instruction memory 50.
  • the processing unit 5 executes an executable program generated by the external computer 3 collectively interpreting the source program 311 by the compiler, thereby interfacing the instruction. It may be transmitted to the board 2.
  • the CPU of the processing device 5 transmits the N-th cycle instruction by including the process of stopping the transmission of the N-th cycle instruction in the executable program. In response, the transmission of the instruction is to be stopped. Also, by including the process of resuming the transmission of the instruction in response to the clear signal from the interface board 2 in the executable program, the CPU of the processing device 5 resumes the transmission of the instruction in response to the clear signal. Do.
  • Embodiment 6 A sixth embodiment will now be described. Hereinafter, the same contents as those of the first to fifth embodiments will be omitted as appropriate.
  • a sequential instruction and a periodic instruction are prepared as dummy instructions. Since the order instruction and the periodic instruction are normally distributed to all the bus instruction buffers 22a to 22c in the order transmitted from the external computer 3 via the transmission control function 20, the bus instruction buffers 22a to 22c Sequential commands and periodic commands do not coexist as dummy commands output at the same time. However, if a processing error occurs due to power supply noise or the like, there is a possibility that the sequential instruction and the periodic instruction are mixed as dummy instructions output from the bus instruction buffers 22a to 22c at the same time. In this case, in the fifth embodiment, there is a problem that the output stop of the instruction from the bus instruction buffers 22a to 22c is not canceled, and the state is a freeze state. Therefore, in the sixth embodiment, a method of avoiding the freeze state will be described.
  • the interface board 2 according to the sixth embodiment is different from the interface board 2 according to the fifth embodiment in that it further includes an OR circuit 238 and an AND circuit 239.
  • the order instruction detection unit 2331 of each of the dummy instruction determination units 233a to 233c further outputs a signal to the OR circuit 238. Further, the OR circuit 236 further outputs a signal to the AND circuit 239.
  • dummy instruction determination unit 233 determines whether the instruction output from the corresponding bus instruction buffer 22 is an order instruction or a periodic instruction. Dummy instruction determination unit 233 outputs a stop signal to OR circuit 238 when the instruction is an order instruction, and outputs a stop signal to OR circuit 236 when the instruction is a periodic instruction. .
  • the OR circuit 238 outputs, to the AND circuit 239, a signal generated by the logical sum operation of the signals input from the order instruction detection unit 2331 of each of the dummy instruction determination units 233a to 233c.
  • the OR circuit 238 outputs a notification signal to the AND circuit 239 when the notification signal is input from at least one of the dummy instruction determination units 233a to 233c.
  • the OR circuit 238 does not output the notification signal to the AND circuit 239 when the notification signal is not input from any of the dummy instruction determination units 233a to 233c.
  • the AND circuit 239 transmits, to the external computer 3, a signal generated by an AND operation of the signals input from each of the OR circuit 236 and the OR circuit 238.
  • the AND circuit 239 outputs a notification signal to the external computer 3 when a notification signal is input from all of the OR circuit 236 and the OR circuit 238.
  • the AND circuit 239 does not output the notification signal to the external computer 3 when the notification signal is not input from at least one of the OR circuit 236 and the OR circuit 238. That is, the AND circuit 239 transmits a notification signal to the external computer 3 when there is a mismatch in the determination result as to whether the dummy instruction in each of the dummy instruction determination units 233a to 233c is the sequential instruction or the periodic instruction.
  • the OR circuit 238 and the AND circuit 239 operate as described below.
  • the OR circuit 238 outputs a high level signal to the AND circuit 239 when a high level signal is input from at least one of the dummy instruction determination units 233a to 233c.
  • the OR circuit 238 outputs a low level signal to the AND circuit 239 when a low level signal is input from all of the dummy instruction determination units 233a to 233c.
  • the AND circuit 235 outputs a high level signal to the external computer 3 when a high level signal is input from all of the OR circuit 236 and the OR circuit 238.
  • the AND circuit 235 outputs a low level signal to the external computer 3 when a low level signal is input from at least one of the OR circuit 236 and the OR circuit 238. Therefore, the high level signal functions as a notification signal.
  • the notification signal from the AND circuit 239 functions as a signal for notifying the external computer 3 of an abnormality.
  • an abnormality is notified to the external computer 3 of the instruction.
  • the external computer 3 can reset the interface board 2 in response to the notification signal from the AND circuit 239 of the interface board 2. Therefore, the freeze state of the interface board 2 can be eliminated in a configuration in which all of the dummy instruction determination units 233a to 233c align one of the sequential instruction and the periodic instruction.
  • the external computer 3 and the interface board 2 may be connected via the processing device 5, and instead of the external computer 3, the processing device 5 has a period
  • the instruction detecting unit 34 may be provided, or the processor 5 may execute an executable program generated by the external computer 3 collectively interpreting the source program 311 by the compiler.
  • the seventh embodiment will be described next. Hereinafter, the same contents as in the first embodiment will be appropriately omitted.
  • the configurations of the interface board 2 and the external computer 3 according to the module control system 1 according to the seventh embodiment will be described with reference to FIG.
  • the interface board 2 according to the seventh embodiment further includes an error signal detection unit 26 and an instruction issuance information collection unit 27 in comparison with the interface board 2 according to the first embodiment.
  • the error signal detection unit 26 monitors the buses 91 to 93. When the error occurrence is detected on the buses 91 to 93, the error signal detection unit 26 outputs a notification signal for notifying the occurrence of an error to the command issuance information collection unit 27. For example, when an error packet is defined in the communication standards of the buses 91 to 93, the error signal detection unit 26 determines that an error has occurred when the error packet is detected. If no error packet is defined in the communication standard of the buses 91 to 93, for example, when the module 4 detects an abnormality in communication, the user-defined error packet is transmitted to detect the error packet. It may be determined that an error has occurred when the
  • the instruction issuance information collection unit 27 collects information on the instructions stored in each of the bus instruction buffers 22a to 22c. The collection of this information may be performed on all of the bus instruction buffers 22a to 22c, and is performed only on the bus instruction buffer 22 corresponding to the bus for which an error is detected by the error signal detection unit 26. You may do so. Then, the command issuance information collection unit 27 transmits, to the external computer 3, notification information for notifying the occurrence of an error.
  • the notification information includes the collected information. This information is, for example, information indicating the type and number of instructions stored in each of the bus instruction buffers 22a to 22c.
  • the error signal detection unit 26 detects an abnormality in the buses 91 to 93 between the bus instruction buffers 22a to 22c and the module 4 group. Then, when the error signal detection unit 26 detects an abnormality, the instruction issuance information collection unit 27 collects information related to the instructions stored in the bus instruction buffers 22a to 22c.
  • the external computer 3 can grasp in what kind of command transmission status an error has occurred. Therefore, for example, the external computer 3 can reset the bus instruction buffers 22a to 22c of the interface board 2 and execute recovery processing such as re-sending an instruction from an instruction in which an error occurs.
  • the module control system 1 may connect the external computer 3 and the interface board 2 via the processing device 5 as in FIG.
  • the instruction issuance information collection unit 27 also transmits the notification information to the processing device 5 (not shown).
  • the processing device 5 stops transmission of the instruction stored in the instruction memory 50.
  • the external computer 3 may reset the bus instruction buffers 22a to 22c of the interface board 2 and the instruction memory 50 of the processing device 5, and execute recovery processing such as retransmitting an instruction from an instruction in which an error occurs.
  • the external computer 3 executes an executable program generated by the compiler interpreting the source program 311 at one time by the processing device 5 to transmit an instruction to the interface board 2.
  • the CPU of the processing device 5 stops the transmission of the instruction in response to the notification signal by including the process of stopping the transmission of the instruction in response to the notification signal from the interface board 2 in the executable program.
  • the abnormal process is included in the executable program, and when the CPU of the processing device 5 receives the notification signal at the time of execution of the executable program, the bus instruction buffer 22 a to 22 c of the interface board 2 is processed as abnormal process. May be reset, and recovery such as re-sending an instruction from an instruction in which an error occurs may be performed.
  • Embodiment 8 Subsequently, an eighth embodiment will be described. Hereinafter, the same contents as in the first embodiment will be appropriately omitted.
  • the interface board 2 according to the eighth embodiment is different from the interface board 2 according to the first embodiment in that the interface board 2 further has a trigger instruction detection function 28 and an OR circuit 214.
  • the transmission control function 20 according to the eighth embodiment is different from the transmission control function 20 according to the first embodiment in that a dummy instruction generation unit 203 is further included.
  • trigger instruction detection function 28 outputs a broadcast instruction signal to dummy instruction generation unit 203 and OR circuit 214, and the input instruction is a trigger instruction. If not, the broadcast instruction signal is not output.
  • the OR circuit 214 outputs, to the instruction distribution unit 201 and the instruction distribution unit 202, the signals generated by the logical sum operation of the signals input from the dummy instruction detection function 21 and the trigger instruction detection function 28, respectively. That is, in the eighth embodiment, compared with the first embodiment, the signal output from dummy instruction detection function 21 is input to OR circuit 214 instead of instruction distribution unit 201 and instruction distribution unit 202. .
  • the OR circuit 214 outputs a broadcast signal to the instruction distribution unit 201 and the instruction distribution unit 202 when the broadcast signal is input from at least one of the dummy instruction detection function 21 and the trigger instruction detection function 28.
  • OR circuit 214 outputs a broadcast instruction signal to instruction distribution unit 201 and instruction distribution unit 202 when the broadcast instruction signal is not input from either dummy instruction detection function 21 or trigger instruction detection function 28. do not do.
  • the dummy instruction generation unit 203 When the broadcast instruction signal is input from the trigger instruction detection function 28, the dummy instruction generation unit 203 generates a dummy instruction and outputs the dummy instruction to the instruction distribution unit 201 and the instruction distribution unit 202. That is, the broadcast instruction signal from trigger instruction detection function 28 to dummy instruction generation unit 203 functions as a dummy instruction generation instruction signal.
  • the instruction distribution unit 202 distributes the dummy instruction input from the dummy instruction generation unit 203 to the bus instruction buffers 22a to 22c, and then transmits the trigger instruction input from the external computer 3 to the buffers 22a to 22c. Distribute to 22c.
  • the trigger instruction detection function 28 outputs a high level signal to the OR circuit 214 when the instruction input to the transmission control function 20 is a trigger instruction.
  • the trigger command detection function 28 outputs a low level signal to the OR circuit 214.
  • the OR circuit 214 When the signal input from at least one of the dummy instruction detection function 21 and the trigger instruction detection function 28 is a high level signal, the OR circuit 214 outputs a high level to the instruction distribution unit 201 and the instruction distribution unit 202. Output a signal.
  • the OR circuit 214 When the signal input from both of the dummy instruction detection function 21 and the trigger instruction detection function 28 is a low level signal, the OR circuit 214 outputs a low level to the instruction distribution unit 201 and the instruction distribution unit 202. Output a signal. As described in the first embodiment, this signal is input to the instruction distribution unit 202 as it is, and the signal inverted by the inverter 209 is input to the instruction distribution unit 201.
  • the dummy instruction generation unit 203 generates a dummy instruction when a high level signal is input from the trigger instruction detection function 28. That is, the high level signal corresponds to the broadcast instruction signal.
  • the dummy instruction is stored in all of bus instruction buffers 22a to 22c, and the trigger instruction is stored next to the dummy instruction. can do.
  • the outputs from the bus instruction buffers 22a to 22c are queued with dummy instructions to guarantee the order of the instructions. Therefore, the instruction following the dummy instruction is simultaneously transmitted to each of the buses 91 to 93, and the execution timing of the instruction can be adjusted. Therefore, in the eighth embodiment, the instruction generation unit 31 of the external computer 3 transmits an instruction whose execution timing is to be matched in the module 4 as a trigger instruction, so that the execution timing of the instruction can be matched.
  • FIG. 27 illustrates an example in which the instruction generation unit 31 of the external computer 3 generates instructions in the order of instructions A to C, a trigger instruction, and instructions D to F.
  • the instruction D and the instruction F are instructions that should follow the execution order.
  • the dummy instruction generation function 30 of the external computer 3 inserts a dummy instruction between the instruction D and the instruction F. Therefore, as shown by “data of communication path 90” in FIG. 4, the external computer 3 executes the instruction in the order of instruction A, instruction B, instruction C, trigger instruction, instruction D, instruction E, dummy instruction, instruction F. It transmits one by one to the interface board 2 via the communication path 90 one by one.
  • the dummy instruction generation unit 203 inserts a dummy instruction before the instruction C and the trigger instruction. Accordingly, the states of the buses 91 to 93 in “time 1” to “time 4” are the same as those in the example shown in FIG.
  • the trigger command detection function 28 determines whether the command received from the external computer 3 is a trigger command (S24). When it is determined that the instruction received from the external computer 3 is a trigger instruction (S24: Yes), the dummy instruction generation unit 203 generates a dummy instruction and inserts it in front of the trigger instruction (S25). The transmission control function 20 causes the instruction distribution unit 202 to distribute the dummy instruction and the trigger instruction to all the buses (S26).
  • Step S23 is executed. If the instruction received from the external computer 3 is not a trigger instruction but a dummy instruction (S24: No, S21: Yes), Step S23 is executed. If the instruction received from the external computer 3 is neither a trigger instruction nor a dummy instruction (S24: No, S21: No), the process of step S22 is executed.
  • the transmission control function 20 when the input instruction is a trigger instruction, the transmission control function 20 inserts a dummy instruction before the trigger instruction and uses the trigger instruction for the bus. It is distributed to all of the instruction buffers 22a to 22c.
  • the trigger instruction is simultaneously executed by simultaneously transmitting the trigger instruction to all the buses 91 to 93 using the mechanism that the output of the dummy instruction is aligned in all of the bus instruction buffers 22a to 22c. can do.
  • the external computer 3 and the interface board 2 may be connected via the processing device 5 as in the example shown in FIG. Further, also in the third embodiment, as in the example shown in FIG. 12, the instructions are executed by the processing device 5 executing an executable program generated by the external computer 3 collectively interpreting the source program 311 by the compiler. May be sent to the interface board 2.
  • the transmission control function 20 generates and inserts a dummy instruction for aligning the execution timing of the trigger instruction
  • the present invention is not limited to this.
  • the dummy instruction generation function 30 may generate a dummy instruction and insert it before the trigger instruction. According to this, in the transmission control function 20, the dummy instruction generation unit 203 becomes unnecessary.
  • the module control system 1 has an interface board 2, an external computer 3, a plurality of modules 4, a processing device 5, and a server 6.
  • the server 6 has a community providing unit 61, an online shop providing unit 62, and a storage unit 63.
  • the server 6 is connected to the external computer 3 via the Internet.
  • the community providing unit 61 provides the external computer 3 with an internet community service.
  • the online shop providing unit 62 provides an online shop service to the external computer 3.
  • the storage unit 63 stores module data 601, design data 602, and the like. That is, the storage unit 63 includes a storage device capable of storing the data 601 and 602. The storage device is, for example, a memory and a hard disk.
  • Module data 601 is data of module 4.
  • the module data 601 indicates, for example, the shape, weight, and physical characteristics of the module 4.
  • Module data 601 is prepared for only the type of module 4.
  • Design data 602 is data indicating a virtual model of the gadget constructed by the plurality of modules 4.
  • the user of the external computer 3 can share, for example, the design data 602 created by the server 6 with other users by using the community provided by the community providing unit 61. it can. Also, the user of the external computer 3 can purchase the design data 602, the software for creating the design data, the module 4 and the like from the online shop provided by the online shop providing unit 62.
  • the external computer 3 has a design function 330 and a USB (Universal Serial Bus) communication function 337.
  • the design function 330 has a storage function 331, a graphical user interface (GUI) -based module assembly function 332, a display function 333, a physical simulation function 334, a programming environment 335, and a control design tool 336.
  • the external computer 3 has a design function 330 in which the functions 331 to 336 are linked to provide an environment where the user can design the gadget and a program for operating the gadget comfortably.
  • the storage function 331 stores module data 601, design data 602, and the like acquired from the server 3.
  • the storage function 331 includes a storage device capable of storing these data 601 and 602.
  • the storage device is, for example, a memory and a hard disk.
  • the module assembly function 332 provides a function for the user to virtually assemble the module 4 based on GUI and create a virtual model of a gadget.
  • Design data 602 indicating a virtual model created in this manner is stored in the storage function 331. The user can create a virtual model by operating the input device of the external computer 3.
  • the display function 333 displays virtual models of the module 4 and the gadget in three-dimensional computer graphics. More specifically, the display function 333 is realized by the CPU of the external computer 3 displaying those images on the display device of the external computer 3.
  • the physical simulation function 334 provides a function to perform operation simulation of the gadget by the virtual model indicated by the design data 602.
  • the physical simulation function 334 can perform operation simulation in consideration of the shape of the module 4 and the like by using the module data 601 of the module 4 configuring the gadget.
  • the programming environment 335 provides the user with an environment for creating the source program 311 described above.
  • the programming environment 335 is, for example, an integrated development environment.
  • the user uses the programming environment 335 to create the source program 311 by operating the input device of the external computer 3.
  • the control design tool 336 is an automatic generation tool of the source program 311 that controls the plurality of modules 4.
  • the control design tool 336 may be a tool that automatically generates the source program 311 based on the design data 602.
  • the USB communication function 337 is a function to realize communication according to the USB communication standard with the interface board 2. That is, in the ninth embodiment, an example in which the communication path 90 connecting the external computer 3 and the interface board 2 is a USB bus will be described.
  • the processing device 5 has a processing function 51, a USB communication function 52, an SPI communication function 53, a voltage conversion unit 54, an analog input / output unit 55, and a digital input / output unit 56. .
  • the processing function 51 controls the processing device 5 in an integrated manner.
  • the processing function 51 has a CPU, a memory and the like (not shown), and the CPU executes a program stored in the memory to realize the function as the processing device 5.
  • the processing function 51 receives an instruction from the external computer 3 via the USB communication function 52.
  • the processing function 51 transmits the received instruction to the interface board 2 via a serial peripheral interface (SPI) communication function 53.
  • SPI serial peripheral interface
  • the memory included in the processing function 51 functions as the instruction memory 50.
  • the processing function 51 can also function as the program execution unit 301 by causing the CPU to execute an executable program stored in the memory.
  • the USB communication function 52 is a function for realizing communication according to the USB communication standard with the external computer 3.
  • the SPI communication function 53 is a function that implements communication with the interface board 2 according to the SPI communication standard. That is, in the ninth embodiment, an example in which the communication path 95 connecting the processing device 5 and the interface board 2 is an SPI bus will be described.
  • the voltage conversion unit 54 converts the voltage supplied from the battery 80 into a voltage that can be supplied to the interface board 2.
  • the Vdd output unit 541 supplies the voltage converted by the voltage conversion unit 54 to the interface board 2 as a power supply voltage.
  • the Gnd output unit 542 supplies a ground voltage to the interface board 2.
  • the analog input / output unit 55 receives an input of an arbitrary analog signal from a device connected to the connector of the analog input / output unit 55.
  • the analog input / output unit 55 outputs the input analog signal to the processing function 51 and the interface board 2.
  • the digital input / output unit 56 receives an input of an arbitrary digital signal from a device connected to the connector of the digital input / output unit 56.
  • the digital input / output unit 56 outputs the input digital signal to the processing function 51 and the interface board 2.
  • the interface board 2 has a transmitting function 200, a receiving function 220, an SPI communication function 290, a plurality of I2C communication functions 291a to 291d, and connectors 292a to 292h.
  • the transmission function 200 and the reception function 220 are as described in the first to eighth embodiments.
  • the SPI communication function 290 is a function that implements communication with the processing device 5 according to the SPI communication standard.
  • Each of the I2C communication functions 291a to 291d is a function to realize communication with the module 4 according to the I2C communication standard via the connectors 292a to 292h.
  • FIG. 30 an example in which the module 4 is connected to each of the four connectors 292a to 292d will be described.
  • the connectors 292a to 292h are typically 4-pin connectors.
  • each of the buses 91 to 94 includes two signal lines, one power supply voltage line, and one ground voltage line.
  • the power supply voltage output from the Vdd output unit 541 is supplied to the power supply voltage line.
  • the ground voltage output from the Gnd output unit 542 is supplied to the ground voltage line.
  • the transmission function 200 can distribute or distribute the instruction received from the processing device 5 via the transmission control function 20 to the buses 91 to 94 and transmit it.
  • the transmission function 200, the reception function 220, the SPI communication function 290, and the I2C communication functions 291a to 291d are realized by the microcomputer 2000, for example.
  • the module 4 has a microcomputer 40 and a connector 48. As described above, by connecting the connectors 292a to 292d of the interface board 2 and the connectors 48 of the plurality of modules 4, the buses 91 to 94 are formed.
  • the microcomputer 40 operates with the power supply voltage and the ground voltage supplied from the interface board 2 through the connector 48. Further, the microcomputer 40 receives and executes an instruction according to a signal supplied from the interface board 2 through the connector 48.
  • the module 4 can take various aspects. For example, as shown in FIG. 31, one of the sensor 41, AC (Alternating Current) motor 43, DC (Direct Current) motor 44, analog input / output module 45, digital input / output module 46, and communication standard compliant module 47. It may have more than one.
  • the sensor 41 is as described in the first embodiment.
  • the AC motor 43 is driven by an alternating current supplied from an AC power supply 81.
  • the DC motor 44 is driven by direct current supplied from the battery 80.
  • the plurality of modules 4 is not limited to the example in which the module 4 having the AC motor 43 and the module 4 having the DC motor 44 are mixed. Only one of the module 4 having the AC motor 43 and the module 4 having the DC motor 44 may be used.
  • the AC current from the AC power supply 81 is converted into DC current by the AC / DC converter 82 and supplied to the device in the module 4 (analog input / output module 45 in the example of FIG. 31). You may do so.
  • the analog input / output module 45 inputs / outputs an external device by an analog signal.
  • the digital input / output module 46 inputs and outputs digital signals to and from an external device.
  • the module 4 may operate by connecting to an external device and transmitting / receiving any signal to / from the external device.
  • the communication standard compliant module 47 transmits and receives information to and from an external device through communication according to an arbitrary communication standard. Note that this communication may be wired or wireless. Thus, the module 4 may operate by transmitting and receiving information to and from an external device.
  • control period for example, 10 msec
  • a cycle command, sensor value acquisition commands A to F, and motor drive commands A to G are transmitted from the processing device 5 to the interface board 2 by SPI communication. It shall be.
  • the timing adjustment function 23 waits until the instruction for each of the buses 91 to 94 becomes a periodic instruction. Therefore, sensor value acquisition instructions A to F and motor drive instructions A to G following the periodic instruction are simultaneously transmitted from the timing when the periodic instruction is aligned on each of the buses 91 to 94 and executed by the module 4.
  • each of the sensor values A to F acquired by the sensor value acquisition instructions A to F is transmitted from the module 4 to the processing device 5 by SPI communication as needed. Furthermore, this sensor value is transmitted from the processing device 5 to the external computer 3.
  • the external computer 3 calculates command values in motor drive instructions A to I in the next second control cycle based on the sensor values A to F transmitted from the module 4.
  • a periodic command, sensor value acquisition commands A to E, and motor drive commands A to I are transmitted from the processing device 5 to the interface board 2 by SPI communication. It shall be.
  • the timing adjustment function 23 waits until the instruction for each of the buses 91 to 94 becomes a periodic instruction. Therefore, sensor value acquisition instructions A to E and motor drive instructions A to I following the periodic instruction are simultaneously transmitted from the timing when the periodic instruction is aligned on each of the buses 91 to 94, and executed by the module 4.
  • the instruction can be divided for each control period. Then, the gadget (module 4) can be controlled by repeatedly executing those instructions. This is suitable, for example, for motor control based on sensor values as shown in FIG. In motor control, acquisition of a sensor value and drive of a motor by the sensor value are repeated. On the other hand, according to control using a cycle command, acquisition of a sensor value and drive of a motor can be repeated for every control cycle, and suitable motor control can be realized. In addition, as described here, by simultaneously executing the motor drive instruction and the sensor value acquisition instruction for acquiring the sensor value to be used for generation of the motor drive instruction in the next control period in the control period, Motor drive can be performed continuously in each control cycle.
  • the contents described in the first to eighth embodiments can be implemented without any problem even in an integrated system in which a development environment is incorporated as in the module control system 1 according to the ninth embodiment. It is possible.
  • a tenth embodiment will be described.
  • a more specific second configuration example of the module control system 1 will be described.
  • the configuration of a module control system 1 according to the tenth embodiment will be described with reference to FIGS. 33 to 35.
  • the server 6 is not shown in FIG. 33, the server 6 may of course be included in the module control system 1 according to the tenth embodiment.
  • the external computer 3 according to the tenth embodiment differs from the external computer 3 according to the ninth embodiment in that the external computer 3 further has a connection module list display function 340.
  • the connection module list display function 340 displays a list of the plurality of modules 4 connected to the interface board 2 by the display function 333.
  • the processing apparatus 5 according to the tenth embodiment further includes an I2C communication function 57, an interrupt function 58, and a Vdd output function 543 as compared with the processing apparatus 5 according to the ninth embodiment. The point of having it is different.
  • the I2C communication function 57 is a function that implements communication with the interface board 2 according to the I2C communication standard. That is, the tenth embodiment has a communication path for transmitting an instruction separately from the communication path 95 based on the SPI communication standard.
  • the interrupt function 58 is a function of receiving an interrupt signal from the interface board 2.
  • the Vdd output unit 543 supplies the voltage converted by the voltage conversion unit 54 to the interface board 2 as a power supply voltage.
  • the voltage conversion unit 54 according to the tenth embodiment converts the voltage supplied from the battery 80 to generate a first voltage and a second voltage different from the first voltage.
  • the Vdd output unit 541 supplies a first voltage to the interface board 2, and the Vdd output unit 542 supplies a second voltage to the interface board 2.
  • connection module list acquisition function 510 acquires a list of a plurality of modules 4 connected to the interface board 2, and transmits list information indicating a list of the plurality of modules 4 to the external computer 3.
  • the connection module list display function 340 of the external computer 3 can display a list of the plurality of modules 4 based on the list information received from the processing device 5. According to this, the user can easily confirm the plurality of modules 4 configuring the gadget.
  • the connection module list acquisition function 510 transmits a module information reply command to each of the plurality of modules 4 to acquire a list of the plurality of modules 4.
  • Each of the plurality of modules 4 responds to the processing device 5 with information specifying itself in response to a module information reply command from the processing device 5.
  • This information is, for example, a module ID uniquely assigned to each module 4.
  • a list of module IDs of the plurality of modules 4 is acquired as the list of the plurality of modules 4.
  • the acquisition of the list of modules 4 is realized, for example, by including the process of transmitting a module information reply command to the above-mentioned executable program, and the processing function 51 executing the executable program.
  • the interface board 2 according to the tenth embodiment further includes a plurality of interrupt detection units 250a to 250d, an OR circuit 251, and the interface board 2 according to the ninth embodiment.
  • a stop instruction function 260 a plurality of error detectors 261a to 261d, a plurality of overcurrent detectors 262a to 262d, an overcurrent detector 263, selection circuits 293 and 294, a distribution circuit 295, a plurality of voltages And conversion units 296a to 296d.
  • the interface board 2 according to the tenth embodiment has an RS 485 communication function 297 instead of the I2C communication function 291 d.
  • Each of the plurality of interrupt detection units 250a to 250d detects an interrupt packet transmitted to each of the buses 91 to 94.
  • each of the plurality of interrupt detection units 250a to 250d outputs an interrupt signal to the OR circuit 251.
  • the OR circuit 251 transmits, to the interrupt function 58 of the processing device 5, a signal generated by the logical sum operation from each of the plurality of interrupt detection units 250a to 250d. That is, the OR circuit 251 transmits an interrupt signal to the interrupt function 58 of the processing device 5 when an interrupt signal is input from at least one of the plurality of interrupt detection units 250a to 250d.
  • module 4 sends an interrupt packet when it detects an event that requires urgent action. According to this, when the processing function 51 receives an interrupt signal based on the interrupt packet through the interrupt function 58, it can promptly cope with the event.
  • the stop instruction function 260 transmits a stop instruction to the processing device 5 when an error is detected by the error detection units 261a to 261d and an overcurrent is detected by the overcurrent detection units 262a to 262d and 263. Do.
  • the processing device 5 carries out an abnormal process.
  • the abnormal process is, for example, resetting the interface board 2 or stopping the gadget (plural modules 4). According to this, it is possible to prevent the malfunction of the gadget.
  • Each of the plurality of error detection units 261a to 261d detects an error packet transmitted to each of the buses 91 to 94 as the above-mentioned error.
  • Each of the plurality of overcurrent detection units 262a to 262d detects an overcurrent of the signal supplied from each of the voltage conversion units 296a to 296d to each of the buses 91 to 94 as the above-mentioned error.
  • the overcurrent detection unit 263 detects an overcurrent of the current supplied together with the power supply voltage from the Vdd output units 541 and 543 to the buses 91 to 94 through the selection circuit 293 as the above-mentioned error.
  • the selection unit 293 selects one of the voltage supplied from the Vdd output unit 541 and the voltage supplied from the Vdd output unit 543, and supplies the selected one to the buses 91 to 94 as a power supply voltage.
  • which voltage is selected is switched by a signal input to the selection unit 293 by the processing function 51 of the processing device 5.
  • the processing function 51 selects an appropriate voltage in accordance with the operating voltage of the module 4 to be used.
  • the selection unit 294 selects one of the instruction transmitted from the I2C communication function 57 of the processing device 5 and the instruction transmitted from the I2C communication function 291 a of the interface board 2 and transmits the selected one to the bus 91.
  • which instruction is selected is switched by a signal input to the selection unit 294 by the processing function 51 of the processing device 5. According to this, when it is desired to debug the operation of the module 4, an arbitrary instruction can be directly transmitted to the module 4 via the I2C communication function 57 without passing through the transmission function 200.
  • the distribution unit 295 distributes the command transmitted from the transmission function 200 to any one of the I2C communication function 291 c and the RS485 communication function 297. According to this, it becomes possible to mix modules 4 of different communication standards in a plurality of modules 4. For example, when it is desired to use not only the module 4 compatible with I2C communication but also the module 4 compatible with RS485 communication, the module 4 is connected not to the end of the connector 292c but to the end of the connector 292d. According to this, it is possible to control a gadget composed of the module 4 corresponding to I2C communication connected to the connectors 292a and 292b and the module 4 corresponding to RS485 communication connected to the connector 292d.
  • the module 4 may be connected to the end of the connector 292 c instead of the end of the connector 292 d.
  • which of the I2C communication function 291c and the RS485 communication function 297 the distribution unit 295 distributes the command is switched by the signal input to the distribution unit 295 by the processing function 51 of the processing device 5.
  • Each of voltage conversion units 296a to 296d converts the voltage input from selection unit 293 into a voltage that can be used for the signals on buses 91 to 94.
  • the RS 485 communication function 292 is a function that implements communication with the module 4 according to the RS 485 communication standard.
  • the RS 485 communication function 297 implements communication with the bus 94 connected to the connector 292 d.
  • the module 4 includes a microcomputer 40, a motor 42, a connector 48, and an error detection unit 49.
  • the connector 48 and the motor 42 are as described in the first to ninth embodiments.
  • the microcomputer 40 has a processing function 400 and a storage device 410.
  • the processing function 400 includes an operation control unit 401 and error handling control units 402 and 403.
  • the operation control unit 401 executes control of the motor 42 in a normal state in which an abnormality of the motor 42 is not detected.
  • the error handling control units 402 and 403 execute control of the motor 42 in the abnormal state in which the abnormality of the motor 42 is detected.
  • the storage device 410 stores in advance selection information indicating which of the error handling control unit 402 and the error handling control unit 403 is to execute control in an abnormal state.
  • the processing function 400 determines which of the error handling control unit 402 and the error handling control unit 403 is to perform control in accordance with the selection information stored in the storage device 410, and performs the determined control. Do. According to this, for example, it is possible to change which of the error handling control unit 402 and the error handling control unit 403 is to execute control in an abnormal state according to the gadget in which the module 4 is used.
  • the error detection unit 49 detects an abnormality of the motor 42 described above.
  • the error detection unit 49 notifies the processing function 400 when an abnormality of the motor 42 is detected.
  • control period for example, 10 msec
  • the timing adjustment function 23 waits until the instruction for each of the buses 91 to 94 becomes a periodic instruction. Therefore, the sensor value acquisition instructions A to F and the motor drive instructions A to G following the periodic instruction are simultaneously transmitted at the timing when the periodic instruction is aligned on the buses 91 to 94.
  • the processing device 5 executes control according to this abnormality. For example, as shown in FIG. 36, a motor drive command for stopping the motor 42 may be transmitted to the module.
  • the processing device 5 may resume the transmission of the sensor value acquisition command and the motor drive command as usual from the second control period.
  • the instruction can be divided for each control period. Then, the gadget (module 4) can be controlled by repeatedly executing those instructions. In the tenth embodiment, even if an abnormality occurs at this time, the abnormality can be detected by the stop instruction function 260 and notified to the processing device 5. Therefore, as described above, in response to the notification from the stop instruction function 260 of the interface board 2, the processing device 5 can restore the abnormal state and resume the control.
  • the contents described in the first to eighth embodiments can be implemented without hindrance even in a system in which various abnormality detection functions are incorporated as in the module control system 1 according to the tenth embodiment. It is.
  • the dummy instructions when dummy instructions are provided in all the bus instruction buffers 22, the dummy instructions are discarded.
  • the present invention is not limited to this. Even when dummy instructions are provided in all the bus instruction buffers 22, the dummy instructions may be transmitted to the module 4 without discarding them.
  • the dummy instruction may be an instruction that does not affect the control of the module 4.
  • this instruction may be an instruction that does not execute any process even if the module 4 receives the instruction.
  • unnecessary instruction transmission can be eliminated by discarding the dummy instruction as described above.
  • the present invention is not limited thereto. At least a part of the functions may be realized by executing a program that causes at least a part of the functions to be executed by the CPU of the microcomputer 2000 of the interface board 2. That is, also in the first to eighth embodiments, as described in the ninth embodiment, the transmission function 200 and the reception function 220 may be realized by the microcomputer 2000.
  • connection scheme in the communication path between the interface board 2 and the module 4 may be a peer-to-peer connection.
  • the communication path may be wired or wireless.
  • Condition 1 (number of communication paths between interface board 2 and module 4 ⁇ speed of the communication path) ⁇ speed condition of communication path between external computer 3 and interface board 2 2: between interface board 2 and module 4

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Advance Control (AREA)
  • Programmable Controllers (AREA)
  • Executing Machine-Instructions (AREA)

Abstract

 本発明に係る命令実行制御システム(1)は、命令を実行する複数の命令実行部のそれぞれに命令を先入れ先出しで出力する複数の命令記憶部(22)と、順次入力される命令を複数の命令記憶部(22)のいずれかに振り分ける命令制御部(20)と、複数の命令記憶部からの命令の出力を制御する出力制御部(23)とを有する。命令制御部(20)は、入力された命令が、実行順序を守るべき命令の間に挿入されるダミー命令である場合には、入力された命令を複数の命令記憶部(22)の全てに分配する。出力制御部(23)は、複数の命令記憶部(22)の全てにおいて出力する命令がダミー命令となるまで、出力する命令がダミー命令となっている命令記憶部(22)から命令実行部への命令の出力を抑止する。

Description

命令実行制御システム及び命令実行制御方法
 本発明は、命令実行制御システム及び命令実行制御方法に関し、特に並列的に命令を実行する技術に関する。
 特許文献1には、メモリアクセスにおける命令の追い越し機能を備えたシステムにおいて、命令の実行順序を保障するための技術が開示されている。この技術では、命令実行制御装置は、命令発行装置から発行された命令がバリア命令である場合、記憶部に登録されている命令のバリア前フラグを1に設定する。一方、命令実行制御装置は、命令発行装置から発行された命令がバリア命令でない場合、その命令を記憶部に登録し、その登録した命令と、バリア前フラグが1である命令とが順序保障制御を行う対象となる命令種別の組み合わせであるか否かを判定する。
 命令実行制御装置は、それらの命令が順序保障制御を行う対象となる命令種別の組み合わせである場合、そのバリア前フラグが1である命令の追い越し禁止フラグを1に設定する。命令実行制御装置は、命令を実行すると、その命令のバリア前フラグと追い越し禁止フラグをクリアする。そして、命令実行制御装置は、追い越し禁止フラグがクリアされるまで、後から登録された命令の実行を保留する。これにより、命令の実行順序を保障している。
特開2014-153851号公報
 しかしながら、特許文献1に開示の技術は、複数の命令実行部が独立して並列的に命令を実行するシステムにおいて命令の実行順序を保証する技術を開示したものではない。
 その他の課題と新規な特徴は、本明細書の記述および添付図面から明らかになるであろう。
 一実施の形態によれば、命令実行制御システムは、入力された命令が、実行順序を守るべき命令の間に挿入されるダミー命令である場合には、入力された命令を複数の命令記憶部の全てに分配し、複数の命令記憶部の全てにおいて出力する命令がダミー命令となるまで、出力する命令がダミー命令となっている命令記憶部から命令実行部への命令の出力を抑止するものである。
 前記一実施の形態によれば、命令の実行順序を保証することができる。
実施の形態1に係るモジュール制御システムの構成図である。 実施の形態1に係るインターフェイスボード及び外部計算機の構成図である。 実施の形態1に係る外部計算機3のソフトウェア構成及びハードウェア構成を示す図である。 実施の形態1に係る命令の実行順序を示す図である。 実施の形態1に係るモジュール制御システムの動作を示すフローチャートである。 実施の形態1に係る外部計算機の動作を示すフローチャートである。 実施の形態1に係るインターフェイスボード(送信制御機能及びダミー命令検出機能)の動作を示すフローチャートである。 実施の形態1に係るインターフェイスボード(タイミング調整機能)の動作を示すフローチャートである。 実施の形態1に係るインターフェイスボードの受信機能を明示した構成図である。 命令の実行順序が守れない例を示す図である。 実施の形態1に係るモジュール制御システムの変形例1の構成図である。 実施の形態1に係るモジュール制御システムの変形例2の構成図である。 実施の形態2に係るインターフェイスボード及び外部計算機の構成図である。 実施の形態2に係るモジュール制御システムの変形例の構成図である。 実施の形態3に係るインターフェイスボード及び外部計算機の構成図である。 実施の形態3に係る命令の実行順序を示す図である。 実施の形態3に係るインターフェイスボード(タイミング調整機能)の動作を示すフローチャートである。 実施の形態4に係るインターフェイスボード及び外部計算機の構成図である。 実施の形態4に係る命令の実行順序を示す図である。 実施の形態4に係るモジュール制御システムの変形例の構成図である。 実施の形態5に係るインターフェイスボード及び外部計算機の構成図である。 実施の形態5に係る命令の実行順序を示す図である。 実施の形態5に係るインターフェイスボード(タイミング調整機能)の動作を示すフローチャートである。 実施の形態6に係るインターフェイスボード及び外部計算機の構成図である。 実施の形態7に係るインターフェイスボード及び外部計算機の構成図である。 実施の形態8に係るインターフェイスボード及び外部計算機の構成図である。 実施の形態8に係る命令の実行順序を示す図である。 実施の形態8に係るインターフェイスボード(送信制御機能及びダミー命令検出機能)の動作を示すフローチャートである。 実施の形態9に係るモジュール制御システムの構成図である。 実施の形態9に係るモジュール制御システムの構成図である。 実施の形態9に係るモジュール制御システムの構成図である。 実施の形態9に係る命令の実行順序を示す図である。 実施の形態10に係るモジュール制御システムの構成図である。 実施の形態10に係るモジュール制御システムの構成図である。 実施の形態10に係るモジュール制御システムの構成図である。 実施の形態10に係る命令の実行順序を示す図である。
 以下、図面を参照しながら、好適な実施の形態について説明する。以下の実施の形態に示す具体的な数値などは、発明の理解を容易とするための例示にすぎず、特に断る場合を除き、それに限定されるものではない。また、以下の記載及び図面では、説明の明確化のため、当業者にとって自明な事項などについては、適宜、省略及び簡略化がなされている。
<実施の形態1>
 まず、図1を参照して、実施の形態1に係るモジュール制御システム1の構成について説明する。図1に示すように、モジュール制御システム1は、インターフェイスボード2と、外部計算機3と、複数のモジュール4とを有する。
 インターフェイスボード2は、通信経路90を介して外部計算機3と接続されている。また、インターフェイスボード2は、バス91~93を介して複数のモジュール4と接続される。バス91~93のそれぞれには、少なくも1つのモジュール4が接続されている。厳密には、バス91~93は、インターフェイスボード2及び複数のモジュール4を相互に接続することで、それらの内部の信号線が接続されて形成される。なお、本実施の形態1では、インターフェイスボード2とモジュール4とを接続するバス91~93の数が3つである例について説明するが、バスの数はこれに限られない。
 インターフェイスボード2は、外部計算機3から通信経路90を介して命令を受信する。インターフェイスボード2は、受信した命令を、バス91~93のそれぞれに振り分ける。言い換えると、インターフェイスボード2は、受信した命令を、その命令の実行対象となるモジュール4が接続されたバスに送信する。
 外部計算機3は、モジュール4が実行する命令を生成する。外部計算機3は、生成した命令を、通信経路90を介してインターフェイスボード2に送信する。外部計算機3は、典型的には、例えば、PC(Personal Computer)である。
 複数のモジュール4のそれぞれは、インターフェイスボード2から受信した命令を実行する。ここで、複数のモジュール4は、相互に接続されることで、1つの動作するガジェットを構成することができる。ガジェットは、例えば、生活家電などの電子機器であってもよく、自動車などの輸送機器であってもよい。複数のモジュール4のそれぞれが命令を実行することで、ガジェットの動作が実現される。
 複数のモジュール4のそれぞれは、例えば、図1に示すように、マイコン40と、センサ41と、モータ42とを有する。なお、モジュール4は、センサ41及びモータ42のいずれか1つを有するようにしてもよい。マイコン40は、インターフェイスボード2から受信した命令を実行する。例えば、マイコン40は、受信した命令がセンサ値取得命令である場合、センサ41からセンサ値を取得してインターフェイスボード2に送信する処理を実行する。インターフェイスボード2は、モジュール4から受信したセンサ値を外部計算機3に送信する。マイコン40は、受信した命令がモータ駆動命令である場合、モータ42を駆動する処理を実行する。このモータ駆動命令は、例えば、外部計算機3がモジュール4から取得したセンサ値に基づいて生成する。すなわち、厳密には、本実施の形態1における命令の実行とは、モジュール4が命令に応じた処理を実行することである。言い換えると、本実施の形態における命令は、モジュール4に処理を指示する情報とも言える。
 例えば、複数のモジュール4によって構成されるガジェットが移動する輸送機器である場合、上述したようにセンサ41によって生成されたセンサ値に基づいてモータ42を駆動することで、その移動を実現する。なお、モジュール4の構成は、これに限られない。モジュール4は、センサ41以外の情報取得手段を有するようにしてもよく、モータ42以外の動作実現手段を有するようにしてもよい。
 ここで、モジュール4と、他のモジュール4又はインターフェイスボード2との接続には、任意の接続方法を採用してよい。接続方法は、例えば、ケーブル又は接続部品を介して間接的に接続する方法であってもよく、ケーブル等を介さずに直接接続する方法であってもよい。また、複数のモジュール4の接続において、それらの接続方法のうち、2つ以上が混在してもよい。
 本実施の形態1では、このように、外部計算機3がインターフェイスボード2を介して複数のモジュール4を制御する構成とすることにより、外部計算機3がより多くのモジュール4を制御可能としている。すなわち、外部計算機3と複数のモジュール4とを、複数のバス91~93によってモジュール4を接続可能なインターフェイスボード2を介して接続することで、直接単一のバスによって接続する場合よりも多くのモジュール4の接続を可能としている。
 一方で、このような構成とした場合、バス91に接続されるモジュール4群と、バス92に接続されるモジュール4群と、バス93に接続されるモジュール4群とで独立して並列的に命令が実行される。そのため、それらの独立性に対する考慮がなされていないと、実行順序を守るべき命令が、接続されたバスの異なるモジュール4群に送信された場合に、後で実行すべき命令が先に実行されてしまうことがあるという問題がある。なお、これらのモジュール4群は、命令実行部として機能する。
 本実施の形態1では、このように独立したモジュール4群のそれぞれに異なるバス91~93を介して命令を送信して実行させるにあたり、以下に説明する機能により、複数のモジュール4で実行される命令の順序性を保証している。
 外部計算機3は、ダミー命令生成機能30を有する。ダミー命令生成機能30は、ダミー命令を生成し、インターフェイスボード2に対して順次送信される複数の命令において、実行順序を守るべき命令の間に挿入する。すなわち、複数の命令において、第1の命令と、第1の命令の後に実行されるべき第2の命令とが存在する場合には、第1の命令と第2の命令との間にダミー命令が挿入される。これにより、第1の命令、ダミー命令、第2の命令の順に、外部計算機3からインターフェイスボード2に送信される。
 ここで、例えば、第1の命令は、センサ値取得命令が該当し、第2の命令は、そのセンサ値取得命令によって取得されたセンサ値に基づいて生成されるモータ駆動命令が該当する。なお、実行順序を守るべき命令の種類は、本実施の形態で例示するセンサ値取得命令及びモータ駆動命令のみに限られない。他の種類の命令について、以降に説明するように順序性を保証するようにしてもよい。
 インターフェイスボード2は、送信制御機能20と、ダミー命令検出機能21と、複数のバス用命令バッファ22a~22cと、タイミング調整機能23とを有する。以下、バス用命令バッファ22a~22cは、特にいずれかに限定しない場合には、単に「バス用命令バッファ22」と呼ぶ。
 送信制御機能20は、外部計算機3から受信した命令を、バス用命令バッファ22a~22cに振り分ける又は分配する。言い換えると、送信制御機能20は、外部計算機3から受信した命令を、バス用命令バッファ22a~22cに格納する。より具体的には、送信制御機能20は、受信した命令がダミー命令である場合、そのダミー命令を全てのバス用命令バッファ22a~22cに出力する。一方、送信制御機能20は、受信した命令がダミー命令でない場合、その命令をバス用命令バッファ22a~22cのいずれか1つに出力する。より詳細には、送信制御機能20は、その命令を実行するモジュール4が接続されるバスに対応するバス用命令バッファ22にその命令を出力する。ここで、送信制御機能20は、受信した命令がダミー命令であるか否かを、ダミー命令検出機能21の検出結果によって認識する。
 ダミー命令検出機能21は、外部計算機3から受信した命令がダミー命令であるか否かを判断する。すなわち、ダミー命令検出機能21は、送信制御機能20に入力された命令がダミー命令であるか否かを判断する。そして、ダミー命令検出機能21は、外部計算機3から受信した命令がダミー命令であると判定した場合、ダミー命令の検出を送信制御機能20に通知する。
 より具体的には、送信制御機能20及びダミー命令検出機能21は、例えば、次に説明する回路で実現される。ダミー命令検出機能21は、送信制御機能20に入力された命令がダミー命令である場合は、送信制御機能20が有するブロードキャスト端子にブロードキャスト指示信号を出力する。ブロードキャスト指示信号は、上述のダミー命令の検出結果を示す信号に相当する。一方、ダミー命令検出機能21は、送信制御機能20に入力された命令がダミー命令でない場合は、送信制御機能20が有するブロードキャスト端子にブロードキャスト指示信号は出力しない。送信制御機能20は、ダミー命令検出機能21からブロードキャスト指示信号が入力されている場合、入力された命令を全てのバス用命令バッファ22a~22cに分配する。一方、送信制御機能20は、ダミー命令検出機能21からブロードキャスト指示信号が入力されていない場合、入力された命令をバス用命令バッファ22a~22cのいずれか1つに振り分ける。
 このような動作により、第1の命令と、第1の命令の後に実行されるべき第2の命令とが存在する場合、第1の命令の後にダミー命令が全てのバス用命令バッファ22a~22cに格納され、ダミー命令の後に第2の命令がバス用命令バッファ22a~22cのいずれか1つに格納される。送信制御機能20及びダミー命令検出機能21は、命令制御部として機能する。
 バス用命令バッファ22a~22cのそれぞれは、複数の命令を格納可能である。バス用命令バッファ22a~22cのそれぞれは、送信制御機能20から入力された命令を格納する。バス用命令バッファ22a~22cのそれぞれは、命令を先入れ先出し(FIFO:First In First Out)で格納する。よって、バス用命令バッファ22a~22cのそれぞれに格納された命令は、格納された順番で順次取り出され、バス91~93のそれぞれに送信される。
 ここで、バス用命令バッファ22aは、バス91に接続されており、バス用命令バッファ22bは、バス92に接続されており、バス用命令バッファ22cは、バス93に接続されている。よって、バス用命令バッファ22aに格納された命令は、バス91を介してモジュール4に出力される。バス用命令バッファ22bに格納された命令は、バス92を介してモジュール4に出力される。バス用命令バッファ22cに格納された命令は、バス93を介してモジュール4に出力される。
 ここで、タイミング調整機能23が、ダミー命令を利用して、バス用命令バッファ22a~22cのそれぞれからモジュール4への命令の出力を制御することで、命令の順序性を保証する。タイミング調整機能23は、出力制御部として機能する。
 タイミング調整機能23は、バス用命令バッファ22a~22cのそれぞれから出力される命令を監視し、ダミー命令を出力するバス用命令バッファ22を検出した場合、そのバス用命令バッファ22の動作を停止させる。言い換えると、タイミング調整機能23は、そのバス用命令バッファ22からモジュール4に対する命令の出力を停止させる。その後も、タイミング調整機能23は、新たにダミー命令を出力するバス用命令バッファ22を検出する毎に、そのバス用命令バッファ22の動作を停止させていく。そして、タイミング調整機能23は、全てのバス用命令バッファ22a~22cが出力する命令がダミー命令となった場合、停止させていたバス用命令バッファ22の動作を再開させる。すなわち、タイミング調整機能23は、停止させていたバス用命令バッファ22からモジュール4に対する命令の出力を再開させる。
 これにより、全てのバス用命令バッファ22a~22cからの出力にダミー命令が揃うまで、ダミー命令以降の命令のモジュール4に対する出力が停止される。そのため、第1の命令と、第1の命令の後に実行されるべき第2の命令とが存在する場合、少なくとも第1の命令が出力されて、第1の命令の後のダミー命令が出力されるまでは、ダミー命令の後の第2の命令が出力されることはない。すなわち、第1の命令と第2の命令の順序性が保証される。
 より具体的には、バス用命令バッファ22a~22c及びタイミング調整機能23は、例えば、次に説明する回路で実現される。タイミング調整機能23は、全てのバス用命令バッファ22a~22cからダミー命令が出力されるまで、ダミー命令を出力するバス用命令バッファ22の停止信号入力端子に対して停止信号を出力する。バス用命令バッファ22は、タイミング調整機能23から停止信号が入力されると、その動作を停止する。より詳細には、バス用命令バッファ22は、タイミング調整機能23からの停止信号に応じて、モジュール4に対する命令の出力動作を停止する。これにより、例えば、バス用命令バッファ22からモジュール4に対するバスにおけるデータ(命令)の転送シーケンスが中断される。なお、この転送シーケンスは、バス91~93における通信規格に準ずる。すなわち、バス用命令バッファ22からモジュール4に対するダミー命令の送信が中断される。これにより、モジュール4によるダミー命令の受信は完了せず、ダミー命令はバス用命令バッファ22内に留まり続ける。そのため、そのダミー命令の後に続く命令も送信されずに、バス用命令バッファ22内に留まる。このように、バス用命令バッファ22からモジュール4に対する命令の送信が抑止される。この命令の送信抑止は、タイミング調整機能23からバス用命令バッファ22に対して停止信号が入力されている間継続される。
 なお、バス用命令バッファ22からモジュール4に対する命令の送信を抑止する方法の1つとして、バス用命令バッファ22の動作を停止させることで、バス用命令バッファ22がモジュール4に対する命令の転送シーケンスを中断する方法を説明したが、この方法に限られず、他の方法を利用するようにしてもよい。例えば、タイミング調整機能23がバス用命令バッファ22から出力される命令を一旦取得し、取得した命令がダミー命令である場合は命令の送信を抑止し、そうでない場合はモジュール4に対して命令を送信するようにしてもよい。
 タイミング調整機能23は、全てのバス用命令バッファ22a~22cからのダミー命令の出力を検出すると、停止信号の出力を止める。動作を停止していたバス用命令バッファ22は、タイミング調整機能23から停止信号が入力されなくなると、その動作を再開する。より詳細には、バス用命令バッファ22は、タイミング調整機能23からの停止信号の解除に応じて、モジュール4に対する命令の出力動作を再開する。ここで、後述するように、このときにダミー命令は破棄される。そのため、ダミー命令の次の命令について、バス用命令バッファ22からモジュール4に対する命令の転送シーケンスが開始される。すなわち、全てのバス用命令バッファ22a~22cからモジュール4に対する命令の送信が再開される。
 続いて、図2を参照して、実施の形態1に係るインターフェイスボード2及び外部計算機3の構成について説明する。
 まず、インターフェイスボード2について説明する。図2は、インターフェイスボード2が備える、送信制御機能20及びタイミング調整機能23の構成をより詳細に示している。図2に示すように、送信制御機能20は、命令振分部201と、命令分配部202と、インバータ209とを有する。タイミング調整機能23は、ダミー命令検出部231a~231cと、AND回路232とを有する。以下、ダミー命令検出部231a~231cは、特にいずれかに限定しない場合には、単に「ダミー命令検出部231」と呼ぶ。
 送信制御機能20に入力された命令は、命令振分部201と命令分配部202の両方に入力される。命令振分部201は、入力された命令を宛先に応じて、バス用命令バッファ22a~22cのいずれか1つに振り分ける。命令分配部202は、入力された命令をバス用命令バッファ22a~22cの全てに分配する。
 ここで、命令振分部201と命令分配部202は、ダミー命令検出機能21から送信制御機能20にブロードキャスト指示信号が入力されているか否かによって相補的に動作する。送信制御機能20にブロードキャスト指示信号が入力されていない場合、命令振分部201は動作して、命令分配部202は動作を停止する。一方、送信制御機能20にブロードキャスト指示信号が入力されている場合、命令振分部201は動作を停止して、命令分配部202は動作する。これにより、上述の送信制御機能20の動作が実現される。
 より具体的には、命令振分部201及び命令分配部202は、例えば、次に説明するように動作する。ダミー命令検出機能21は、ハイレベルとローレベルのいずれかに切り替えられる信号を命令振分部201及び命令分配部202に出力する。ダミー命令検出機能21は、命令振分部201及び命令分配部202に対してダミー命令が入力されている場合、ハイレベルの信号を出力する。一方、ダミー命令検出機能21は、命令振分部201及び命令分配部202に対してダミー命令が入力されてない場合、ローレベルの信号を出力する。この信号は、命令分配部202にはそのまま入力され、命令振分部201にはインバータ209を介して反転された信号が入力される。命令振分部201と命令分配部202は、ハイレベルの信号が入力されている場合に動作し、ローレベルの信号が入力されている場合にはその動作を停止する。すなわち、ハイレベルの信号は、ブロードキャスト指示信号に相当する。
 ダミー命令検出部231a~231cのそれぞれは、バス用命令バッファ22a~22cのそれぞれから出力される命令を監視して、ダミー命令の出力を検出する。ダミー命令検出部231aは、バス用命令バッファ22aを監視する。ダミー命令検出部231bは、バス用命令バッファ22bを監視する。ダミー命令検出部231cは、バス用命令バッファ22cを監視する。
 ダミー命令検出部231aは、バス用命令バッファ22aからダミー命令が出力されている場合、バス用命令バッファ22a及びAND回路232に対して停止信号を出力する。ダミー命令検出部231bは、バス用命令バッファ22bからダミー命令が出力されている場合、バス用命令バッファ22b及びAND回路232に対して停止信号を出力する。ダミー命令検出部231cは、バス用命令バッファ22cからダミー命令が出力されている場合、バス用命令バッファ22c及びAND回路232に対して停止信号を出力する。
 AND回路232は、ダミー命令検出部231a~231cのそれぞれから入力される信号の論理積演算により生成された信号を、ダミー命令検出部231a~231cのそれぞれに出力する。AND回路232は、ダミー命令検出部231a~231cの全てから停止信号が入力されている場合、ダミー命令検出部231a~231cのそれぞれに対してクリア信号を出力する。一方、AND回路232は、ダミー命令検出部231a~231cの少なくとも1つから停止信号が入力されていない場合、ダミー命令検出部231a~231cのそれぞれに対してクリア信号を出力しない。
 より具体的には、ダミー命令検出部231a~231c及びAND回路232は、例えば、次に説明するように動作する。ダミー命令検出部231a~231cのそれぞれは、ハイレベルとローレベルのいずれかに切り替えられる信号を、バス用命令バッファ22a~22cのそれぞれ及びAND回路232に出力する。ダミー命令検出部231a~231cのそれぞれは、バス用命令バッファ22a~22cのそれぞれからダミー命令が出力されている場合、ハイレベルの信号を出力する。一方、ダミー命令検出部231a~231cのそれぞれは、バス用命令バッファ22a~22cのそれぞれからダミー命令が出力されていない場合、ローレベルの信号を出力する。バス用命令バッファ22a~22cのそれぞれは、ハイレベルの信号が入力されている場合に動作し、ローレベルの信号が入力されている場合にはその動作を停止する。すなわち、ハイレベルの信号は、停止信号に相当する。
 AND回路232は、ダミー命令検出部231a~231cの全てからハイレベルの信号が入力されている場合、ダミー命令検出部231a~231cのそれぞれに対してハイレベルの信号を出力する。AND回路232は、ダミー命令検出部231a~231cの少なくとも1つからローレベルの信号が入力されている場合、ダミー命令検出部231a~231cのそれぞれに対してローレベルの信号を出力する。ダミー命令検出部231a~231cのそれぞれは、AND回路232からハイレベルの信号が入力された場合、バス用命令バッファ22a~22c及びAND回路232に対して出力する信号をハイレベルからローレベルに切り替える。一方、ダミー命令検出部231a~231cのそれぞれは、AND回路232からローレベルの信号が入力されている場合、バス用命令バッファ22a~22c及びAND回路232に対して出力する信号のレベルは切り替えない。すなわち、AND回路232が出力するハイレベルの信号は、クリア信号に相当する。
 続いて、外部計算機3について説明する。図2では、外部計算機3の構成をより詳細に示している。図2に示すように、外部計算機3は、ダミー命令生成機能30の他に、命令生成部31と、実行順序判断部32とを有する。
 命令生成部31は、複数のモジュール4が実行する複数の命令を生成する。実行順序判断部32は、命令生成部31が生成した複数の命令において、実行順序を守るべき命令が存在するか否かを判断する。ダミー命令生成機能30は、ダミー命令を生成して、実行順序判断部32が検出した実行順序を守るべき命令の間に挿入する。これにより、外部計算機3が生成した複数の命令において、第1の命令と、第1の命令の後に実行されるべき第2の命令とが存在する場合、第1の命令、ダミー命令、第2の命令の順に命令が送信される。
 続いて、図3を参照して、実施の形態1に係る外部計算機3のソフトウェア構成及びハードウェア構成について説明する。図3に示すように、外部計算機3は、CPU(Central Processing Unit)300と、メモリ301と、ハードディスク302と、通信コントローラ303とを有する。
 CPU300は、外部計算機3を統括的に制御する。CPU300は、ハードディスク302に格納されたインタプリタ310をメモリ301にロードして実行することで、ハードディスク302に格納されたソースプログラム311を解釈して実行可能プログラムを生成する。CPU300は、生成した実行可能プログラムを実行することにより、命令を生成してインターフェイスボード2に送信する。言い換えると、インタプリタ310と、ソースプログラム311を解釈することにより生成される実行可能プログラムは、CPU300に対してダミー命令生成機能30、命令生成部31、及び実行順序判断部32としての各種処理を実行させるためのコードを含む。
 メモリ301は、CPU300が利用する情報が一時的に格納される。この情報には、上述したように、ハードディスク302からロードされるインタプリタ310及びソースプログラム311等も含まれる。メモリ301は、例えばDRAM(Dynamic Random Access Memory)及びSRAM(Static Random Access Memory)等の揮発性の記憶装置である。
 ハードディスク302には、上述の通り、インタプリタ310及びソースプログラム311等の各種情報が格納されている。なお、ハードディスク302のような不揮発性の記憶装置であれば、ハードディスク302に代えて、例えばフラッシュメモリ等の他の記憶装置を利用してもよい。メモリ301及びハードディスク302は、外部計算機3が利用する情報が格納される記憶部として機能する。なお、記憶部として機能する記憶装置の数及び組み合わせも、上述の例に限られない。
 通信コントローラ303は、CPU300から出力された情報を、インターフェイスボード2に対して送信可能な形式に変換して送信する。変換後の形式は、外部計算機3とインターフェイスボード2との間の通信規格に準ずる。また、通信コントローラ303は、インターファイスボード2からの情報を受信し、外部計算機3内で処理可能な形式に変換してCPU300に出力する。
 インタプリタ310は、ダミー命令を生成する機能を有する。ソースプログラム(ソースコード、原子プログラム)311は、複数のモジュール4を制御するコードが記述されている。CPU300は、インタプリタ310によってソースプログラム311を逐次解釈(逐次コンパイルとも称する)して生成した実行可能プログラム(ロードモジュール、機械語プログラム、オブジェクトコード)を実行することで、複数のモジュール4で実行される命令を生成し、インターフェイスボード2を介して複数のモジュール4に対して順次送信する。このときに、CPU300は、実行順序を守るべき命令を生成して送信する場合、それらの命令の間でダミー命令を生成して送信する。すなわち、インタプリタ310は、実行順序を守るべき命令を生成して送信するコードが実行される場合に、それらのコードの間にダミー命令を生成して送信するコードを追加してCPU300に実行させる。これにより、外部計算機3は、実行順序を守るべき命令の間にダミー命令を挿入して、それらの命令をインターフェイスボード2に送信することができる。
 なお、複数のモジュール4を制御する方式は、上述したようにインタプリタ310によってソースプログラム311を逐次解釈することで生成した実行可能プログラムを実行する例に限られない。ハードディスク302においてインタプリタ310に代えてコンパイラが格納されるようにし、CPU300がそのコンパイラによってソースプログラム311を一括解釈(一括コンパイルとも称する)することで生成した実行可能プログラムを実行するようにしてもよい。この場合、コンパイラは、実行順序を守るべき命令を生成して送信するコードの間に、ダミー命令を生成して送信するコードを追加して実行可能プログラムを生成する処理をCPU300に実行させる。もしくは、実行可能なプログラム自体に実行順序を守るべき命令判断機能およびダミー命令生成機能を持たせ、命令の順序をチェックしながらダミー命令を生成する処理をCPU300に実行させることができる。これにより、CPU300が、この実行可能プログラムを実行すると、実行順序を守るべき命令の間にダミー命令が挿入され、それらの命令がインターフェイスボード2に送信される。
 このように、インタプリタ310に限らず、コンパイラによってもダミー命令の挿入を実現することが可能である。
 続いて、図4を参照して、実施の形態1に係る命令の実行順序について説明する。図4では、外部計算機3の命令生成部31が命令A~Fの順に命令を生成する例について説明する。
 ここで、命令C、命令D、命令Fは、実行順序を守るべき命令であるものとする。すなわち、命令Dは、命令Cの実行後に実行する必要があり、命令Fは、命令Dの実行後に実行する必要があるものとする。なお、図4では、バス91~93において1つの命令の送信が完了する時間を、1単位時間(=1.0)として示している。
 この場合、ダミー命令生成機能30は、命令Cと命令Dの間にダミー命令Aを挿入し、命令Dと命令Fの間にダミー命令Bを挿入する。よって、外部計算機3は、図4に「通信経路90のデータ」として示すように、命令A、命令B、命令C、ダミー命令A、命令D、命令E、ダミー命令B、命令Fの順に、命令を順次1つずつ、通信経路90を介してインターフェイスボード2に対して送信する。
 なお、通信経路90の通信速度は、バス91~93の通信速度よりも高速であることが望ましい。例えば、図4に示すように、バス91~93で1つの命令を送信する時間内で、通信経路90で複数の命令(命令A~F及びダミー命令A、B)を送信することができる。図4では、バス91~93で1つの命令を送信する時間内で、通信経路90で少なくとも8つの命令を送信することができる例について示しているが、命令数の関係はこれに限られない。通信経路90と複数のバス91~93との間にこのような関係があることにより、バス91~93において命令が枯渇することなく、モジュール4に対して連続的に命令を送信することが可能となる。
 また、命令A、命令B、及び命令Cは、バス91に接続されるモジュール4によって実行される命令であり、命令Dは、バス92に接続されるモジュール4によって実行される命令であり、命令E及び命令Fは、バス93に接続されるモジュール4によって実行される命令であるものとする。
 この場合、図4に「バスのデータ」として示すように、バス用命令バッファ22a~22cのそれぞれは、バス91~93のそれぞれに対して命令を送信する。すなわち、バス用命令バッファ22aは、命令A、命令B、命令C、ダミー命令A、ダミー命令Bの順番に命令が格納され、その順番で命令を送信する。バス用命令バッファ22bは、ダミー命令A、命令D、ダミー命令Bの順番に命令が格納され、その順番で命令を送信する。バス用命令バッファ22cは、ダミー命令A、命令E、ダミー命令B、命令Fの順番で命令が格納され、その順番で命令を送信する。以下、この場合における時間の経過に応じたバス91~93の状態について説明する。
(時間1)
 バス用命令バッファ22aに格納された命令Aは、バス91に送信される。バス91に接続されるモジュール4は、バス用命令バッファ22aから送信された命令Aを受信して実行する。ここで、バス用命令バッファ22aから送信される命令はダミー命令Aではないが、バス用命令バッファ22b、22cから送信される命令はダミー命令Aである。よって、タイミング調整機能23は、ダミー命令Aを送信するバス用命令バッファ22b、22cの動作を停止させる。これにより、バス用命令バッファ22b、22cから送信されるダミー命令Aのモジュール4による受信が完了することはない。
(時間2)
 バス用命令バッファ22aに格納された命令Bは、バス91に送信される。バス91に接続されるモジュール4は、バス用命令バッファ22aから送信された命令Bを受信して実行する。ここで、バス用命令バッファ22aから送信される命令はダミー命令Aではないが、バス用命令バッファ22b、22cから送信される命令はダミー命令Aである。よって、タイミング調整機能23は、ダミー命令Aを送信するバス用命令バッファ22b、22cの動作を引き続き停止させる。
(時間3)
 バス用命令バッファ22aに格納された命令Cは、バス91に送信される。バス91に接続されるモジュール4は、バス用命令バッファ22aから送信された命令Cを受信して実行する。ここで、バス用命令バッファ22aから送信される命令はダミー命令Aではないが、バス用命令バッファ22b、22cから送信される命令はダミー命令Aである。よって、タイミング調整機能23は、ダミー命令Aを送信するバス用命令バッファ22b、22cの動作を引き続き停止させる。
(時間4)
 バス用命令バッファ22aに格納されたダミー命令Aも、バス91に送信される。よって、バス用命令バッファ22a~22cの全てから送信される命令がダミー命令Aとなる。そのため、タイミング調整機能23は、バス用命令バッファ22b、22cの動作を再開させる。なお、このときに、バス用命令バッファ22a~22cは、後述するように、ダミー命令Aを破棄する。
(時間5)
 バス用命令バッファ22aに格納されたダミー命令Bは、バス91に送信される。一方、動作を再開したバス用命令バッファ22bに格納された命令Dは、バス92に送信される。バス92に接続されるモジュール4は、バス用命令バッファ22bから送信された命令Dを受信して実行する。動作を再開したバス用命令バッファ22cに格納された命令Eも、バス93に送信される。バス93に接続されるモジュール4は、バス用命令バッファ22cから送信された命令Eを受信して実行する。このように、命令Cが送信されるまで、命令Cの後に実行すべき命令Dの送信が保留される。よって、命令C、Dの実行順序を保証することができる。ここで、バス用命令バッファ22b、22cから送信される命令はダミー命令Bではないが、バス用命令バッファ22aから送信される命令はダミー命令Bである。よって、タイミング調整機能23は、ダミー命令Bを送信するバス用命令バッファ22aの動作を停止させる。
(時間6)
 バス用命令バッファ22bに格納されたダミー命令Bも、バス92に送信される。バス用命令バッファ22cに格納されたダミー命令Bも、バス93に送信される。よって、バス用命令バッファ22a~22cの全てから送信される命令がダミー命令Bとなる。そのため、タイミング調整機能23は、バス用命令バッファ22aの動作を再開させる。
(時間7)
 バス用命令バッファ22cに格納された命令Fは、バス93に送信される。バス93に接続されるモジュール4は、バス用命令バッファ22cから送信された命令Fを受信して実行する。このように、命令Dが送信されるまで、命令Dの後に実行すべき命令Fの送信が保留される。よって、命令D、Fの実行順序を保証することができる。
 上述した本実施の形態1に係るモジュール制御システム1によれば、ここで例示したように、独立して並列的に命令を実行するモジュール4群の間においても、命令実行の順序性を保証することができる。
 続いて、図5を参照して、実施の形態1に係るモジュール制御システム1の動作について説明する。
 外部計算機3のCPU300は、ユーザからの入力に応じてソースプログラム311を作成する(S1)。このソースプログラム311には、複数のモジュール4を制御するためのコードが記述される。例えば、このソースプログラム311には、センサ値取得命令及びモータ駆動命令を生成してモジュール4に対して送信するコードが記述される。上述のユーザからの入力は、外部計算機3が有する入力装置(図示せず)操作することによって実施される。入力装置は、例えば、キーボード及びマウス等である。
 外部計算機3のCPU300は、インタプリタ310を実行することで、ソースプログラム311を逐次解釈して実行可能プログラムを生成し、実行する(S2)。これにより、外部計算機3によって各種命令が生成されてインターフェイスボード2を介して順次複数のモジュール4に送信される。複数のモジュール4のそれぞれが受信した命令を実行することで、複数のモジュール4が構成するガジェットの動作が実現される(S3)。
 続いて、図6を参照して、実施の形態1に係る外部計算機3の動作について説明する。外部計算機3は、インタプリタ310を実行することで、ソースプログラム311を逐次解釈して実行可能プログラムを実行する際に、以下のステップS11~S14の処理を繰り返し実行する。
 実行順序判断部32は、解釈対象のi行目のコードで生成される命令と、i-1行目以前(i-1行目を含む)のコードで生成される命令との間で順序に制約があるか否かを判断する(S11)(iは、任意の正整数)。実行順序判断部32は、例えば、ソースコード311を解析し、i-1行目以前のコードで生成される命令がセンサ値取得命令であり、i行目のコードで生成される命令がそのセンサ値取得命令によって取得したセンサ値に基づくモータ駆動命令である場合、両者の順序に制約があると判断する。
 ここで、命令の順序の制約を調査する範囲は、例えば、以下の(1)~(4)の方法のうち、任意の方法を採用するようにしてよい。
(1)直前にダミー命令を生成した行までを調査
 この方法の場合、実行順序判断部32は、i-1行目から直前にダミー命令を生成した行までを順番に遡って調査する。
(2)予め定めた行数だけ調査
 この方法の場合、実行順序判断部32は、i-1行目から予め定めた行数を遡った行までを調査する。
(3)順序の制約がある命令を検出するまで調査
 この方法の場合、実行順序判断部32は、i-1行目から順番に遡っていき、順序の制約がある命令を生成するコードが検出された行で調査を終了する。
(4)i-1行目以前の全てを調査
 この方法の場合、実行順序判断部32は、i-1行目からソースプログラム311の最初の行までを順番に遡って調査する。
 ダミー命令生成機能30は、実行順序判断部32によってi行目の命令とi-1行目以前の命令との間で順序に制約があると判断された場合(S11:Yes)、ダミー命令を生成する(S12)。ソースプログラム311から生成される実行可能プログラムにおいて、i行目に対応するコードと、i-1行目以前で順序に制約があると判断された行に対応するコードとの間に、ダミー命令を送信するコードが挿入される。
 一方、ダミー命令生成機能30は、実行順序判断部32によってi行目の命令とi-1行目以前の命令との間で順序に制約がないと判断された場合(S11:No)、ダミー命令は生成しない。
 命令生成部31は、ソースプログラム311のi行目にモジュール4に対して命令を送信する処理が記述されている場合、ソースプログラム311のi行目の記述から命令を生成する(S13)。
 命令生成部31は、生成した命令に対して、その命令の送信対象となるバスを示す対象バス情報を追加する(S14)。ここで、命令の送信対象となるバスは、モジュール4と、そのモジュール4が接続されるバスとを示す対応データに基づいて判断する。この対応データは、例えば、ハードディスク302に予め格納されている。ソースプログラム311の記述において、命令を生成するコードには、その命令の送信先となるモジュール4が示されている。そのため、命令生成部31は、対応データに基づいて、命令の送信先のモジュール4から、その命令の送信先となるバスを示す対象バス情報を生成して、その命令に追加する。インターフェイスボード2の送信制御機能20(命令振分部201)は、外部計算機3から命令を受信した場合に、その命令に追加された対象バス情報が示すバスに対応するバス用命令バッファ22に、その命令を振り分ける。これにより、送信制御機能20(命令振分部201)が命令を、その送信先に対応するバス用命令バッファ22に正しく振り分けることができる。
 このように、i行目の命令とi-1行目以前の命令との間で順序に制約があると判断された場合には、ステップS12でダミー命令生成機能30がダミー命令を生成して送信してから、ステップS13で命令生成部31が命令を生成して送信する。一方、i行目の命令とi-1行目以前の命令との間で順序に制約がないと判断された場合には、ダミー命令は送信されず、ステップS13で命令生成部31のみが命令を生成して送信する。
 これによれば、例えば、センサ値取得命令と、そのセンサ値取得命令と順序に制約があるモータ駆動命令とが別々のバスに送信される場合であっても、センサ値取得命令とモータ駆動命令の間にダミー命令を挿入して送信することができる。したがって、インターフェイスボード2におけるダミー命令を利用した制御によって、図4を参照して説明したように、センサ値取得命令をモータ駆動命令が追い越して実行されないようにできる。よって、例えば、1周期前のセンサ値に基づいてモータを駆動するといった誤動作を回避することができる。
 続いて、図7を参照して、実施の形態1に係るインターフェイスボード2の送信制御機能20及びダミー命令検出機能21の動作について説明する。
 ダミー命令検出機能21は、外部計算機3から受信した命令がダミー命令であるか否かを判断する(S21)。送信制御機能20は、外部計算機3から受信した命令がダミー命令でないと判断された場合(S21:No)、命令振分部201によって、その命令に含まれる対象バス情報が示すバスにその命令を振り分ける(S22)。一方、送信制御機能20は、外部計算機3から受信した命令がダミー命令であると判断された場合(S21:Yes)、命令分配部202によって、その命令を全てのバス91~93に分配する(S23)。
 続いて、図8を参照して、実施の形態1に係るインターフェイスボード2のタイミング調整機能23の動作について説明する。
 タイミング調整機能23のダミー命令検出部231a~231cは、それぞれに対応するバス用命令バッファ22a~22cから出力される命令がダミー命令であるか否かを判断する(S31)。ダミー命令検出部231a~231cは、バス用命令バッファ22a~22cから出力される命令がダミー命令でないと判断した場合(S31:No)、そのバス用命令バッファ22a~22cからバスへの命令の出力を許容する(S32)。
 一方、ダミー命令検出部231a~231cは、そのダミー命令検出部231に対応するバス用命令バッファ22a~22cから出力される命令がダミー命令であると判断した場合(S31:Yes)、そのバス用命令バッファ22a~22cからバスへの命令の出力を停止する(S33)。タイミング調整機能23は、全てのバス用命令バッファ22a~22cからダミー命令が出力されているか否かを判断する(S34)。すなわち、ダミー命令検出部231は、クリア信号が入力されたか否かを判定する。
 タイミング調整機能23は、全てのバス用命令バッファ22a~22cからダミー命令が出力されていると判断した場合(S34:Yes)、それらのバス用命令バッファ22a~22cのダミー命令を破棄させる(S35)。このダミー命令の破棄は、バス用命令バッファ22a~22cのそれぞれが、ダミー命令検出部231a~231cのそれぞれからの停止命令の出力が解除されたタイミングで出力している命令を破棄することで実施する。これにより、バス用命令バッファ22a~22cから出力される命令がダミー命令でなくなるため(S31:No)、バス用命令バッファ22a~22cから命令が出力される(S32)。一方、タイミング調整機能23は、全てのバス用命令バッファ22a~22cからダミー命令が出力されていないと判断した場合(S34:No)、それらのバス用命令バッファ22a~22cのダミー命令の破棄は実施しない。
 ここで、以上の説明では、ダミー命令に関する動作を明確化するために言及しなかったが、当然に、各モジュール4から命令を受信することも可能である。より具体的には、インターフェイスボード2は、図9に示すように、送信制御機能20、ダミー命令検出機能21、バス用命令バッファ22a~22c、及びタイミング調整機能23を有する送信機能200の他に、受信機能220を有する。受信機能220は、受信制御機能221と、受信バス用命令バッファ222a~222cとを有する。
 受信バス用命令バッファ222a~222cのそれぞれは、複数の命令を格納可能である。受信バス用命令バッファ222a~222cのそれぞれは、モジュール4からバス91~93のそれぞれを介して受信した命令を格納する。受信バス用命令バッファ222a~222cのそれぞれは、命令を先入れ先出し(FIFO)で格納する。よって、受信バス用命令バッファ222a~222cのそれぞれは、格納された順番で順次命令を受信制御機能221に出力する。
 受信制御機能221は、受信バス用命令バッファ222a~222cのそれぞれから入力された命令を、外部計算機3に対して通信経路90を介して到着順に1つずつ順次送信する。すなわち、図4で示される通信経路90及びバス91~93を占有する命令と同様に、モジュール4から外部計算機3に向けて送信される命令によって通信経路90及びバス91~93が占有される場合もあり得る。
 なお、このモジュール4から外部計算機3に送信される命令は、モジュール4が外部計算機3に対して処理を指示する命令そのものに限られず、外部計算機3からの命令に応じてモジュール4が応答する情報も含まれる。この情報は、例えば、モジュール4がセンサ値取得命令に応じて外部計算機3に対して送信するセンサ値である。
 以上に説明したように、本実施の形態1に係るモジュール制御システム1は、バス91~93(モジュール4群)のそれぞれに命令を先入れ先出しで出力するバス用命令バッファ22a~22cと、順次入力される命令をバス用命令バッファ22a~22cのいずれかに振り分ける送信制御機能20と、バス用命令バッファ22a~22cからの命令の出力を制御するタイミング調整機能23を有する。
 ここで、送信制御機能20は、入力された命令が、実行順序を守るべき命令の間に挿入されるダミー命令である場合には、入力された命令をバス用命令バッファ22a~22cの全てに分配する。そして、タイミング調整機能23は、バス用命令バッファ22a~22cの全てにおいて出力する命令がダミー命令となるまで、出力する命令がダミー命令となっているバス用命令バッファ22からバス(モジュール4群)への命令の出力を抑止する。
 これによれば、ダミー命令よりも前の命令が出力されて、バス用命令バッファ22a~22cの出力にダミー命令が揃うまで、ダミー命令よりも後の命令がモジュール4に出力されて実行されることはない。よって、実行順序を守るべき命令の実行順序を保証することができる。
 例えば、本実施の形態1によるダミー命令による制御を実施せずに、図4に示す命令A~命令Fを送信すると、図10に示すように命令A~命令Fが送信される。すなわち、インターフェイスボード2は、外部計算機3から通信経路90を介して受信した各命令A~命令Fを、即時各バス91~93に振り分けて送信する。
 したがって、(時間1)では、バス91に命令Aが送信され、バス92に命令Dが送信され、バス93に命令Eが送信される。(時間2)では、バス91に命令Bが送信され、バス93に命令Fが送信される。(時間3)では、バス91に命令Cが送信される。このように、命令Cの後に実行されるべき命令Dが、命令Cよりも先にモジュール4に送信されて実行されてしまう。これに対して、本実施の形態1によれば、同様の命令A~命令Fを送信する場合においても、図4に示すように命令の順序性を保証することができる。
(実施の形態1の変形例1)
 モジュール制御システム1は、図1、2に示すように、外部計算機3とインターフェイスボード2とを直接接続する形態に限られず、図11に示すように、外部計算機3とインターフェイスボード2とを処理装置5を介して接続するようにしてもよい。外部計算機3は、通信経路90を介して処理装置5と接続される。処理装置5は、通信経路95を介してインターフェイスボード2と接続される。
 処理装置5は、例えば、マイコンボードである。処理装置5は、命令メモリ50を有する。命令メモリ50は、外部計算機3から受信した命令が一時的に格納される。命令メモリ50は、例えばDRAM及びSRAM等の揮発性の記憶装置である。そして、処理装置5は、外部計算機3から受信した命令を命令メモリ50に一時的に蓄積してからインターフェイスボード2に対して順次送信するようにしてもよい。よって、命令メモリ50も、命令を先入れ先出し(FIFO)で命令を格納する。
(実施の形態1の変形例2)
 また、処理装置5の利用方法は、このように外部計算機3から送信された命令を中継するのみに限られず、図12に示すように、外部計算機3がコンパイラによってソースプログラム311を一括解釈することで生成した実行可能プログラムを処理装置5で実行することで、命令をインターフェイスボード2に対して送信するようにしてもよい。
 この変形例では、外部計算機3は、プログラム生成部320を有する。外部計算機3のCPU300が、上述のコンパイラの機能を担務することでプログラム生成部320として機能する。また、プログラム生成部320は、実行順序判断部32を有する。プログラム生成部320は、実行順序判断部32によって実行順序を守るべき命令が検出された場合、その実行順序を守るべき命令を生成して送信するコードの間に、ダミー命令を生成して送信するコードを追加して実行可能プログラムを生成する。外部計算機3は、生成した実行可能プログラムを処理装置5に送信する。
 また、この変形例では、処理装置5は、プログラム実行部321を有する。処理装置5のCPU(図示せず)が、外部計算機3から受信した実行可能プログラムを実行することで、プログラム実行部321として機能する。また、プログラム実行部321は、ダミー命令生成機能30と、命令生成部31とを有する。処理装置5のCPUが実行可能プログラムを実行することで、順次命令を生成してインターフェイスボード2に送信することになる。また、この際には、ダミー命令が生成されて、実行順序を守るべき命令の間に挿入される。すなわち、処理装置5のCPUは、実行可能プログラムを実行することで、命令生成機能30及び命令生成部31として機能することになる。
 なお、処理装置5は、実行可能プログラムを受信に応じて即時実行せずに、処理装置5の記憶装置に格納しておいて任意のタイミングで実行するようにしてもよい。これによれば、複数のモジュール4に対して、外部計算機3を接続せずに、処理装置5とインターフェイスボード2のみを接続をすることで制御することができる。そのため、複数のモジュール4で構成されるガジェットの動作範囲の制限を無くすことができる。例えば、外部計算機3とインターフェイスボード2とがケーブルによって接続されたままの状態では、ケーブルの長さによってガジェットの動作範囲に制約ができてしまう。これに対して、処理装置5(例えばマイコンボード)及びインターフェイスボード2のみがガジェットに接続された状態であれば、処理装置5及びインターフェイスボード2は、外部計算機3(例えばPC)と比較して小型であるため、処理装置5及びインターフェイスボード2をガジェットに搭載したまま動作範囲に制約なく動作させることが可能となる。
<実施の形態2>
 続いて、実施の形態2について説明する。以下、実施の形態1と同様の内容については適宜省略して説明する。図13を参照して、実施の形態2に係るモジュール制御システム1に係るインターフェイスボード2及び外部計算機3の構成について説明する。本実施の形態2に係るインターフェイスボード2は、実施の形態1に係るインターフェイスボード2と比較して、さらにオーバーフロー検出部24を有する。
 オーバーフロー検出部24は、バス用命令バッファ22a~22cのそれぞれのオーバーフローを検出する。オーバーフロー検出部24は、バス用命令バッファ22a~22cの少なくとも1つでオーバーフローを検出した場合、オーバーフローの検出を通知する通知信号を外部計算機3に対して送信する。
 外部計算機3のダミー命令生成機能30及び命令生成部31は、インターフェイスボード2からの通知信号に応じて、命令の生成・送信を停止する。また、外部計算機3は、インターフェイスボード2をリセットする等して、インターフェイスボード2を復旧させてから命令の送信を再開するようにしてもよい。
 以上に説明したように、本実施の形態2では、オーバーフロー検出部24は、バス用命令バッファ22がオーバーフローになったことを検出し、命令の入力元となる外部計算機3に通知する。これによれば、外部計算機3が通知に応じて、インターフェイスボード2のバス用命令バッファ22a~22cがオーバーフローした状態での動作の継続を抑止することができる。そのため、異常発生時に動作が継続されてしまうことを防止することができる。
(実施の形態2の変形例1)
 上記説明では、インターフェイスボード2がバス用命令バッファ22a~22cのオーバーフローを検出するオーバーフロー検出部24を有する例について説明したが、これに限られない。インターフェイスボード2は、オーバーフロー検出部24に代えて、バス用命令バッファ22a~22cのバッファフル(バス用命令バッファ22が一杯になったこと)を検出するバッファフル検出部を有してもよい。
 この変形例1では、バッファフル検出部は、バス用命令バッファ22a~22cの少なくとも1つがバッファフルになったことを検出した場合、バッファフルの検出を通知する通知信号を外部計算機3に対して送信する。外部計算機3のダミー命令生成機能30及び命令生成部31は、インターフェイスボード2からの通知信号に応じて、命令の生成・送信を停止する。また、バッファフル検出部は、バス用命令バッファ22a~22cのバッファフルが解消した場合、外部計算機3に対する通信信号の送信を解除してもよい。この場合、外部計算機3のダミー命令生成機能30及び命令生成部31は、インターフェイスボード2からの通知信号の送信解除に応じて、命令の生成・送信を再開してもよい。
 本変形例によれば、インターフェイスボード2のバス用命令バッファ22a~22cのオーバーフローを防止することができる。そのため、異常発生時に制御が継続されてしまうことを防止することができる。
(実施の形態2の変形例2)
 また、本実施の形態2においても、図14に示すように、モジュール制御システム1は、図11で示した例と同様に外部計算機3とインターフェイスボード2と、を処理装置5を介して接続するようにしてもよい。
 この場合、オーバーフロー検出部24は、通知信号を処理装置5に対して送信する。処理装置5は、インターフェイスボード2からの通知信号に応じて、命令メモリ50に蓄積された命令の送信を停止する。なお、変形例1と同様、オーバーフロー検出部24に代えて、バッファフル検出部を有するようにしてもよい。
 また、図12で示した例と同様に、外部計算機3がコンパイラによってソースプログラム311を一括解釈することで生成した実行可能プログラムを処理装置5で実行することで、命令をインターフェイスボード2に対して送信するようにしてもよい。この場合、実行可能プログラムにインターフェイスボード2からの通知信号に応じて命令の送信を停止する処理を含めておくことで、処理装置5のCPUが、通知信号に応じて命令の送信を停止するようにしてもよい。また、実行可能プログラムに異常時処理を含めておき、処理装置5のCPUが、この実行可能プログラムの実行時に通知信号を受信した場合、異常時処理としてインターフェイスボード2をリセットする等して、インターフェイスボード2を復旧させてから命令の送信を再開するようにしてもよい。
<実施の形態3>
 続いて、実施の形態3について説明する。以下、これまでの実施の形態1、2と同様の内容については適宜省略して説明する。
 ここで、命令の実行順序を守りたいケースとして、主に以下の2つがある。
(1)単純に命令の順序を守りたい場合
 例えば、上述したように、第1の命令でセンサ値を取得し、第2の命令で取得したセンサ値に基づいてモータを駆動したい場合である。
(2)制御周期毎に命令を分けたい場合
 例えば、モータ制御では、制御理論に基づいてセンサ値のサンプリングタイミングと、モータへの指令タイミングは、一定周期毎のタイミングが定められる。モータの制御量は、サンプリング及び指令の周期の関数で表され、周期が期待値と異なれば設計通りに動作しない。
 実施の形態1、2では、(1)は実現できていたが、(2)は実現できていなかった。そこで、本実施の形態3では、(1)、(2)を両立できるモジュール制御システム1について説明する。
 図15を参照して、本実施の形態3に係るインターフェイスボード及び外部計算機の構成について説明する。本実施の形態3に係るインターフェイスボード2は、実施の形態1に係るインターフェイスボード2と比較して、さらにタイマー25を有する点が異なる。
 タイマー25は、一定周期の時間が経過したことを周期的に通知する通知信号をAND回路232に出力する回路である。よって、本実施の形態3に係るAND回路232は、ダミー命令検出部231a~231cの全てから停止信号が入力されており、かつタイマー25から通知信号が入力されている場合に、ダミー命令検出部231a~231cの全てに対してクリア信号を出力する。一方、ダミー命令検出部231a~231cのそれぞれからの停止信号及びタイマー25からの停止信号のうち、少なくとも1つが入力されていない場合には、ダミー命令検出部231a~231cに対してクリア信号を出力しない。
 より具体的には、タイマー25は、一定周期の時間が経過する毎に、一定時間ハイレベルとなるパルス信号をAND回路232に出力する。したがって、このパルス信号(ハイレベルの信号)は、通知信号に相当する。
 AND回路232は、ダミー命令検出部231a~231c及びタイマー25の全てからハイレベルの信号が入力されている場合、ダミー命令検出部231a~231cの全てに対してハイレベルの信号を出力する。一方、AND回路232は、ダミー命令検出部231a~231c及びタイマー25の少なくとも1つからローレベルの信号が入力されている場合、ダミー命令検出部231a~231cの全てに対してローレベルの信号を出力する。なお、入力される信号がハイレベルかローレベルかによるバス用命令バッファ22a~22c及びダミー命令検出部231a~231cの動作は、実施の形態1で説明した通りである。
 続いて、図16を参照して、実施の形態3に係る命令の実行順序について説明する。図16では、実施の形態1における図4に示す例と同様に、外部計算機3の命令生成部31が命令A~Fの順に命令を生成する例について説明する。なお、タイマー25が通知信号を出力する周期は、5単位時間毎であり、「時間5」と「時間10」であるものとする。この場合、「時間1」~「時間3」におけるバス91~93の状態については、図4と同様であるため、説明を省略する。
(時間4)
 バス用命令バッファ22a~22cの全てから送信される命令がダミー命令となる。しかしながら、タイマー25からタイミング調整機能23に対しては、一定周期Aの時間の経過は通知されていない。よって、タイミング調整機能23は、ダミー命令Aを送信するバス用命令バッファ22a~22cの動作を停止させる。
(時間5)
 タイマー25は、タイミング調整機能23に対して一定周期のタイマー通知を行う。よって、バス用命令バッファ22a~22cの全てから送信される命令がダミー命令Aとなり、かつタイマー25からタイマー通知が行われたため、タイミング調整機能23は、バス用命令バッファ22a~22cの動作を再開させる。このとき、バス用命令バッファ22a~22cは、ダミー命令Aを破棄する。
 これにより、バス用命令バッファ22aに格納されたダミー命令Bは、バス91に送信される。バス用命令バッファ22bは、バス92に命令Dを送信する。バス用命令バッファ22cも、バス93に命令Eを送信する。
(時間6)~(時間9)
 バス用命令バッファ22bに格納されたダミー命令Bは、バス92に送信される。バス用命令バッファ22cに格納されたダミー命令Bは、バス93に送信される。バス用命令バッファ22a~22cの全てから送信される命令がダミー命令Bとなるが、タイマー25からタイミング調整機能23に対しては、タイマー通知は行われていない。タイミング調整機能23は、ダミー命令Bを送信するバス用命令バッファ22a~22cの動作を停止させる。
(時間10)
 タイマー25は、タイミング調整機能23に対して一定周期の時間の経過を通知する。よって、バス用命令バッファ22a~22cの全てから送信される命令がダミー命令Bとなり、かつタイマー25からタイマー通知が行われたため、タイミング調整機能23は、バス用命令バッファ22a~22cの動作を再開させる。このとき、バス用命令バッファ22a~22cは、ダミー命令Bを破棄する。これにより、バス用命令バッファ22cは、バス93に命令Fを送信する。バス93に接続されるモジュール4は、バス用命令バッファ22cから送信された命令Fを受信して実行する。
 上述した本実施の形態3に係るモジュール制御システム1によれば、タイマー25の周期を制御周期とすることで、制御周期毎にモジュール4を制御することが可能である。また、本実施の形態3に係るモジュール制御システム1によれば、制御周期毎に実行する命令を分けることも可能である。例えば、ダミー命令Aからダミー命令Bまでの命令は、時間5~時間9までの期間で実行し、ダミー命令B以降の命令は、時間10~の期間で実行することができる。すなわち、命令D、Eがセンサ値取得命令であり、命令Fがモータ駆動命令である場合には、時間5~時間9までの期間でセンサ値取得命令を実行し、時間10~の期間でモータ駆動命令を実行するといったように、命令を制御周期毎に分けて実行することができる。
 続いて、図17を参照して、実施の形態3に係るインターフェイスボード2のタイミング調整機能23の動作について説明する。本実施の形態3に係るタイミング調整機能23の動作は、図8に示す実施の形態1に係るタイミング調整機能23の動作と比較して、ステップS36が追加されている点が異なる。
 すなわち、タイミング調整機能23は、全てのバス用命令バッファ22a~22cからダミー命令が出力されており、かつタイマー25の出力が1(ハイレベル)であるか否かを判断する(S34、36)。タイミング調整機能23は、全てバス用命令バッファ22a~22cからダミー命令が出力されており、かつタイマー25の出力が1(ハイレベル)であると判断した場合に(S34:Yes、S36:Yes)、バス用命令バッファ22a~22cのダミー命令を破棄する(S35)。これにより、バス用命令バッファ22a~22cからバス91~93への命令の出力が再開される(S32)。
 一方、タイミング調整機能23は、全てのバス用命令バッファ22a~22cからダミー命令が出力されていない、又は、タイマー25の出力が1(ハイレベル)でないと判断した場合は(S34:No又はS36:No)、バス用命令バッファ22a~22cのダミー命令を破棄しない。
 以上に説明したように、本実施の形態3では、タイミング調整機能23は、バス用命令バッファ22a~22cの全てにおいて出力する命令がダミー命令となり、かつタイマー25から通知信号が出力されるまで、出力する命令がダミー命令となっているバス用命令バッファ22からの命令の出力を抑止する。これによれば、タイマー25の周期毎のタイミングで、ダミー命令に続く命令を実行することができる。よって、所定の制御周期でモジュール4の制御を実施することができる。また、ダミー命令間の命令が、タイマー25の周期毎に分かれて実行されることになる。すなわち、制御周期毎に命令を分けて実行することもできる。
(実施の形態3の変形例)
 本実施の形態3においても、図11示す例と同様に、外部計算機3とインターフェイスボード2とを処理装置5を介して接続するようにしてもよい。また、本実施の形態3においても、図12に示す例と同様に、外部計算機3がコンパイラによってソースプログラム311を一括解釈することで生成した実行可能プログラムを処理装置5で実行することで、命令をインターフェイスボード2に対して送信するようにしてもよい。
<実施の形態4>
 続いて、実施の形態4について説明する。以下、これまでの実施の形態1~3と同様の内容については適宜省略して説明する。本実施の形態4では、実施の形態2で課題となったオーバーフローの問題と、実施の形態3で課題となった制御周期の問題を同時に解決する構成について説明する。
 図18を参照して、実施の形態4に係るインターフェイスボード2及び外部計算機3の構成について説明する。本実施の形態4に係る外部計算機3は、実施の形態3に係る外部計算機3と比較して、さらにダミー命令検出部33を有する。
 ダミー命令検出部33は、タイミング調整機能23で検出されるダミー命令のN個先のダミー命令を検出する(Nは、予め定めた正整数)。すなわち、ダミー命令検出部33は、インターフェイスボード2に対して送信される最初のダミー命令の送信からN個目のダミー命令(最初のダミー命令を含まない)を検出する。言い換えると、ダミー命令検出部33は、命令の送信開始からN+1個目に送信されるダミー命令を検出する。
 ダミー命令検出部33は、N個先のダミー命令を検出した場合、ダミー命令生成機能30、命令生成部31、及び実行順序判断部32の動作を停止させる。言い換えると、ダミー命令生成機能30及び命令生成部31は、命令の生成・送信を停止する。
 また、本実施の形態4に係るAND回路232は、実施の形態3に係るAND回路232と比較して、ダミー命令検出部231a~231cに加えて、さらに外部計算機3のダミー命令検出部33に対してもクリア信号を送信する。
 ダミー命令検出部33は、AND回路232からのクリア信号の受信に応じて、ダミー命令生成機能30、命令生成部31、及び実行順序判断部32の動作を再開させる。言い換えると、ダミー命令生成機能30及び命令生成部31は、命令の生成・送信を再開する。
 これによれば、タイミング調整機能23においてx番目のダミー命令の出力を待ち合わせているときには、外部計算機3ではx+N番目のダミー命令以降の命令の送信が抑止される。よって、バス用命令バッファ22a~22cには、x番目のダミー命令からx+N番目のダミー命令までの間に送信される命令しか格納されないことになる。そのため、バス用命令バッファ22a~22cに格納される命令数を抑制し、バス用命令バッファ22a~22cのオーバーフローを防止することができる。
 なお、2回目以降は、ダミー命令検出部33は、ダミー命令生成機能30、命令生成部31、及び実行順序判断部32の動作を再開させてから、次にインターフェイスボード2に対して送信されるダミー命令(1つのダミー命令)を検出した場合に、ダミー命令生成機能30、命令生成部31、及び実行順序判断部32の動作を停止させるようにすればよい。最初に、N+1目のダミー命令までの命令を送信しているため、後は、ダミー命令1つずつで命令の送信停止と送信再開とを繰り返すことで、バス用命令バッファ22a~22cにx番目のダミー命令からx+N番目のダミー命令までの間に送信される命令が格納された状態を維持することができる。
 続いて、図19を参照して、実施の形態4に係る命令の実行順序について説明する。図19では、実施の形態3における図16の例と同様に、外部計算機3の命令生成部31が命令A~Fの順に命令を生成する例について説明する。なお、ここでは、説明を簡略化するために、Nの数を1としている。
 図19に示すように、バス91~93の状態については、実施の形態3における図16に示す例と同様であるが、通信経路90の状態が異なる。図16に示すように2番目(N+1番目)のダミー命令Bが検出された場合、外部計算機3は、命令の生成・送信を停止する。そのため、通信経路90では、ダミー命令Bの送信が完了しないままとなる。この状態は、上述したように、全てのバス91~93に対してダミー命令Aが送信され、かつタイマー25からパルス信号が出力される「時間5」まで継続される。
 これによれば、バス91に対してダミー命令Aが送信されるまで、バス92、93に対する命令の送信が停止されることになるが、バス92、93に対応するバス用命令バッファ22b、22cには、ダミー命令Aとダミー命令Bの間に生成された命令のみしか格納されることはない。よって、バス用命令バッファ22b、22cのオーバーフローを防止することができる。
 以上に説明したように、本実施の形態4では、ダミー命令検出部33は、所定数のダミー命令のインターフェイスボード2に対する入力に応じて、インターフェイスボード2に対する命令の入力を中断する。タイミング調整機能23は、バス用命令バッファ22a~22cの全てにおいて出力する命令がダミー命令であり、かつタイマー25から通知信号が出力された場合に、外部計算機3に対してクリア信号を出力する。そして、ダミー命令検出部33は、タイミング調整機能23からの通知信号の出力に応じて、中断していた命令の入力を再開する。
 これによれば、バス用命令バッファ22a~22cに格納される命令数は、最初のダミー命令から所定数のダミー命令の間の命令のみに限られる。よって、バス用命令バッファ22a~22cに格納される命令数を抑制し、バス用命令バッファ22a~22cのオーバーフローを防止することができる。
(実施の形態4の変形例)
 本実施の形態4においても、図20に示すように、モジュール制御システム1は、図11に示す例と同様に外部計算機3とインターフェイスボード2とを処理装置5を介して接続するようにしてもよい。
 この場合、図20に示すように、外部計算機3に代えて処理装置5がダミー命令検出部33を有するようにしてもよい。処理装置5は、ダミー命令検出部33によってN個先のダミー命令が検出された場合、命令メモリ50に蓄積された命令の送信を停止する。また、処理装置5は、ダミー命令検出部33によるクリア信号の受信に応じて、命令メモリ50に蓄積された命令の送信を再開する。
 また、本実施の形態4においても、図12に示すように、外部計算機3がコンパイラによってソースプログラム311を一括解釈することで生成した実行可能プログラムを処理装置5で実行することで、命令をインターフェイスボード2に対して送信するようにしてもよい。この場合、実行可能プログラムにN個先のダミー命令の送信を検出した場合に命令の送信を停止する処理を含めておくことで、処理装置5のCPUが、N個先のダミー命令の送信に応じて命令の送信を停止する。また、実行可能プログラムにインターフェイスボード2からのクリア信号に応じて命令の送信を再開する処理を含めておくことで、処理装置5のCPUが、クリア信号に応じて命令の送信を再開する。また、本実施の形態4の変形例として、インターフェイスボード2がタイマー25を有さない形態(実施の形態1において、さらにダミー命令検出部33を有する形態)で実施することもできる。
<実施の形態5>
 続いて、実施の形態5について説明する。以下、これまでの実施の形態1~4と同様の内容については適宜省略して説明する。
 上述したように、命令の実行タイミングを守りたいケースとして、(1)単純に命令の順序を守りたい場合、(2)制御周期毎に命令を分けたい場合が存在する。実際のガジェット(モジュール4)の動作を考慮すると、(1)と(2)を混在させたい場合が多い。すなわち、あるタイミングにおいては(1)を実現させ、他のタイミングでは、さらに(2)も実現させたいという場合が多い。そこで、本実施の形態5では、(1)と(2)を混在させた制御を実現する方法について説明する。
 図21に示すように、本実施の形態5に係るインターフェイスボード2は、本実施の形態4に係るインターフェイスボード2と比較して、ダミー命令検出機能21に代えて、順序命令検出部211と、周期命令検出部212と、OR回路213とを有する点が異なる。
 順序命令検出部211は、送信制御機能20に入力された命令が順序命令である場合、OR回路213にブロードキャスト指示信号を出力する。周期命令検出部212は、送信制御機能20に入力された命令が周期命令である場合、OR回路213にブロードキャスト指示信号を出力する。
 OR回路213は、順序命令検出部211及び周期命令検出部212のそれぞれから入力される信号の論理和演算により生成された信号を、送信制御機能20が有するブロードキャスト端子に出力する。言い換えると、OR回路213は、順序命令検出部211及び周期命令検出部212の少なくとも1つからブロードキャスト指示信号が入力されている場合、ブロードキャスト指示信号を送信制御機能20に出力する。一方、OR回路213は、順序命令検出部211及び周期命令検出部212のいずれからもブロードキャスト指示信号が入力されていない場合、ブロードキャスト指示信号を出力しない。
 より具体的には、順序命令検出部211及び周期命令検出部212は、例えば、次に説明する回路として実現される。順序命令検出部211及び周期命令検出部212のそれぞれは、ハイレベルとローレベルのいずれかに切り替えられる信号を送信制御機能20に出力する。順序命令検出部211は、送信制御機能20に対して順序命令が入力されている場合、ハイレベルの信号を出力する。一方、順序命令検出部211は、送信制御機能20に対して順序命令が入力されてない場合、ローレベルの信号を出力する。周期命令検出部212は、送信制御機能20に対して周期命令が入力されている場合、ハイレベルの信号を出力する。一方、周期命令検出部212は、送信制御機能20に対して周期命令が入力されてない場合、ローレベルの信号を出力する。すなわち、ハイレベルの信号は、ブロードキャスト指示信号に相当する。
 したがって、OR回路213は、順序命令検出部211及び周期命令検出部212の少なくとも1つからハイレベルの信号が入力されている場合、ハイレベルの信号を送信制御機能20に出力する。一方、OR回路213は、順序命令検出部211及び周期命令検出部212の両方からローレベルの信号が入力されている場合、ローレベルの信号を送信制御機能20に出力する。
 このように、本実施の形態5では、ダミー命令として、順序命令と周期命令が存在する。順序命令は、実施の形態1、2で説明したように、(1)単純に命令の順序を守りたい場合におけるダミー命令として機能する。周期命令は、実施の形態3、4で説明したように、(2)制御周期毎に命令を分けたい場合におけるダミー命令として機能する。
 また、図21に示すように、本実施の形態5に係るインターフェイスボード2は、本実施の形態4に係るインターフェイスボード2と比較して、ダミー命令検出部231a~231cに代えて、ダミー命令判断部233a~233cを有する点が異なる。また、本実施の形態5に係るインターフェイスボード2は、本実施の形態4に係るインターフェイスボード2と比較して、AND回路232に代えて、AND回路234、235と、OR回路236と、選択回路237とを有する点が異なる。ダミー命令判断部233a~233cのそれぞれは、順序命令検出部2331と、周期命令検出部2332と、OR回路2333とを有する。
 ダミー命令判断部233a~233cのそれぞれは、バス用命令バッファ22a~22cのそれぞれから出力される命令を監視して、ダミー命令(順序命令及び周期命令)の出力を検出する。ダミー命令判断部233aは、バス用命令バッファ22aを監視し、ダミー命令判断部233bは、バス用命令バッファ22bを監視し、ダミー命令判断部233cは、バス用命令バッファ22cを監視する。
 ダミー命令判断部233aは、バス用命令バッファ22aから順序命令又は周期命令が出力されている場合、バス用命令バッファ22aに対して停止信号を出力する。ダミー命令判断部233bは、バス用命令バッファ22bから順序命令又は周期命令が出力されている場合、バス用命令バッファ22bに対して停止信号を出力する。ダミー命令判断部233cは、バス用命令バッファ22cから順序命令又は周期命令が出力されている場合、バス用命令バッファ22cに対して停止信号を出力する。また、ダミー命令判断部233a~233cのそれぞれは、バス用命令バッファ22a~22cのそれぞれから順序命令が出力されている場合、AND回路234に停止信号を出力する。ダミー命令判断部233a~233cのそれぞれは、バス用命令バッファ22a~22cのそれぞれから周期命令が出力されている場合、OR回路236に停止信号を出力する。
 より詳細には、ダミー命令判断部233a~233cのそれぞれにおいて、対応するバス用命令バッファ22から順序命令が出力されている場合、順序命令検出部2331は、停止信号をOR回路2333に出力する。また、対応するバス用命令バッファ22から周期命令が出力されている場合、周期命令検出部2332は、OR回路2333及びOR回路236に対して停止信号を出力する。
 OR回路2333は、順序命令検出部2331及び周期命令検出部2332のそれぞれから入力される信号の論理和演算により生成された信号を、対応するバス用命令バッファ22及びAND回路234に対して出力する。言い換えると、OR回路2333は、順序命令検出部2331及び周期命令検出部2332の少なくとも1つから停止信号が入力されている場合、OR回路2333及びOR回路236に対して停止信号を出力する。一方、OR回路2333は、順序命令検出部2331及び周期命令検出部2332の両方から停止信号が入力されていない場合、停止信号を出力しない。
 より具体的には、順序命令検出部2331、周期命令検出部2332、及びOR回路2333は、例えば、次に説明する回路として実現される。順序命令検出部2331及び周期命令検出部2332のそれぞれは、ハイレベルとローレベルのいずれかに切り替えられる信号を送信制御機能20に出力する。順序命令検出部2331は、対応するバス用命令バッファ22から順序命令が出力されている場合、ハイレベルの信号を出力する。一方、順序命令検出部2331は、対応するバス用命令バッファ22から順序命令が出力されていない場合、ローレベルの信号を出力する。周期命令検出部2332は、対応するバス用命令バッファ22から順序命令が出力されている場合、ハイレベルの信号を出力する。一方、周期命令検出部212は、対応するバス用命令バッファ22から順序命令が出力されていない場合、ローレベルの信号を出力する。すなわち、ハイレベルの信号は、停止信号に相当する。
 したがって、OR回路2333は、順序命令検出部2331及び周期命令検出部2332の少なくとも1つからハイレベルの信号が入力されている場合、対応するバス用命令バッファ及びAND回路234に対してハイレベルの信号を出力する。一方、OR回路2333は、順序命令検出部2331及び周期命令検出部2332の両方からローレベルの信号が入力されている場合、対応するバス用命令バッファ及びAND回路234に対してローレベルの信号を出力する。
 AND回路234は、ダミー命令判断部233a~233cのそれぞれから入力される信号の論理積演算により生成された信号を、AND回路235及び選択回路237に対して出力する。AND回路234は、ダミー命令判断部233a~233cの全てから停止信号が入力されている場合、AND回路235に対して停止信号を出力する。この停止信号は、クリア信号として機能する。一方、AND回路232は、ダミー命令判断部233a~233cの少なくとも1つから停止信号が入力されていない場合、AND回路235及び選択回路237に対してクリア信号を出力しない。
 AND回路235は、AND回路234及びタイマー25のそれぞれから入力される信号の論理積演算により生成された信号を、選択回路237に対して出力する。AND回路235は、AND回路234から停止信号が入力されており、かつタイマー25から通知信号が入力されている場合、選択回路237に対してクリア信号を出力する。一方、AND回路235は、AND回路234からのクリア信号と、タイマー25からの通知信号の少なくとも1つが入力されていない場合、選択回路237に対してクリア信号を出力しない。
 OR回路236は、ダミー命令判断部233a~233cのそれぞれから入力される信号の論理積演算により生成された信号を、選択回路237の信号選択端子に対して出力する。OR回路236は、ダミー命令判断部233a~233cの少なくとも1つから停止信号が入力されている場合、AND回路235のクリア信号を選択する選択信号を選択回路237に出力する。一方、OR回路236は、ダミー命令判断部233a~233cのいずれからも停止信号が入力されていない場合、AND回路234のクリア信号を選択する選択信号を選択回路237に出力する。
 選択回路237は、OR回路236からAND回路234のクリア信号を選択する選択信号が入力されている場合、AND回路234から入力されるクリア信号を選択してダミー命令判断部233a~233cに出力する。一方、選択回路237は、OR回路236からAND回路235のクリア信号を選択する選択信号が入力されている場合、AND回路235から入力されるクリア信号を選択してダミー命令判断部233a~233cに出力する。
 より具体的には、AND回路234、235、OR回路236、及び選択回路237は、次に説明するように動作する。AND回路234は、ダミー命令判断部233a~233cの全てからハイレベルの信号が入力されている場合、AND回路235及び選択回路237に対してハイレベルの信号を出力する。一方、AND回路234は、ダミー命令判断部233a~233cの少なくとも1つからローレベルの信号が入力されている場合、AND回路235及び選択回路237に対してローレベルの信号を出力する。
 AND回路235は、AND回路234及びタイマー25の全てからハイレベルの信号が入力されている場合、AND回路235及び選択回路237に対してハイレベルの信号を出力する。一方、AND回路234は、AND回路234及びタイマー25の少なくとも1つからローレベルの信号が入力されている場合、AND回路235及び選択回路237に対してローレベルの信号を出力する。
 OR回路236は、ダミー命令判断部233a~233cの少なくとも1つからハイレベルの信号が入力されている場合、選択回路237に対してハイレベルの信号を出力する。一方、OR回路236は、ダミー命令判断部233a~233cの全てからローレベルの信号が入力されている場合、選択回路237に対してローレベルの信号を出力する。
 選択回路237は、OR回路236からハイレベルの信号が入力されている場合、AND回路235から入力されている信号を、ダミー命令判断部233a~233cのそれぞれに対して出力する。一方、選択回路237は、OR回路236からローレベルの信号が入力されている場合、AND回路234から入力されている信号を、ダミー命令判断部233a~233cのそれぞれに対して出力する。
 したがって、OR回路236から出力されるハイレベルの信号は、AND回路235のクリア信号を選択する選択信号に相当する。OR回路236から出力されるローレベルの信号は、AND回路234のクリア信号を選択する選択信号に相当する。AND回路234、235及び選択回路237から出力されるハイレベルの信号は、クリア信号に相当する。
 このような構成によれば、バス用命令バッファ22から順序命令及び周期命令のいずれが出力された場合であっても、そのバス用命令バッファ22からの命令の出力を停止させることができる。その後に、全てのバス用命令バッファ22a~22cからの出力が順序命令又は周期命令となった場合には、停止させたバス用命令バッファ22からの命令の出力を再開することができる。このとき、ダミー命令が周期命令である場合には、タイマー25から一定周期の経過が通知されたときに限り、バス用命令バッファ22からの命令の出力を再開させることができる。一方、ダミー命令が順序命令である場合には、タイマー25から一定周期の経過が通知されたか否かに限られず、バス用命令バッファ22からの命令の出力を再開させることができる。
 よって、外部計算機3によって単純に命令の順序を守りたい命令の間に順序命令を挿入することで、命令の実行順序を保証することができる。そして、外部計算機3によって所定の制御周期毎に分けて実行させたい命令の間に周期命令を挿入することで、命令の実行順序の保証に加えて、それらの命令の所定の制御周期で分けての実行も可能となる。
 また、図21に示すように、本実施の形態5に係る外部計算機3は、本実施の形態4に係る外部計算機3と比較して、ダミー命令検出部33に代えて、周期命令検出部34を有する点が異なる。
 周期命令検出部34は、タイミング調整機能23で検出される周期命令のN個先の周期命令を検出する(Nは、予め定めた正整数)。すなわち、周期命令検出部34は、実施の形態4に係るダミー命令検出部33と同様に動作するが、ダミー命令として、順序命令及び周期命令のうち、周期命令のみを検出する点がダミー命令検出部33とは異なる。
 ここで、AND回路235は、外部計算機3の周期命令検出部34に対しても信号を出力している。よって、実施の形態4に係るダミー命令検出部33は、AND回路232からのクリア信号に応じてダミー命令生成機能30、命令生成部31、及び実行順序判断部32の動作を再開させていたが、周期命令検出部34は、AND回路235からのクリア信号に応じてダミー命令生成機能30、命令生成部31、及び実行順序判断部32の動作を再開させる。
 これによれば、実施の形態4と同様に、バス用命令バッファ22a~22cに格納される命令数を抑制し、バス用命令バッファ22a~22cのオーバーフローを防止することができる。
 続いて、図22を参照して、実施の形態5に係る命令の実行順序について説明する。図22では、外部計算機3の命令生成部31が命令A~Gの順に命令を生成する例について説明する。ここで、命令E、命令Fは、実行順序を守るべき命令であるものとする。また、命令C、命令D、命令Gは、一定周期毎に分けて実行したい命令であるものとする。なお、ここでは、説明を簡略化するために、実施の形態4における図19に示す例と同様に、Nの数を1としている。また、タイマー25が通知信号を出力する周期も、実施の形態4における図19に示す例と同様に、5単位時間毎であり、「時間5」と「時間10」であるものとする。
 この場合、ダミー命令生成機能30は、命令Cと命令Dの間に周期命令を挿入し、命令Eと命令Fの間に順序命令を挿入し、命令Dと命令Gの間に周期命令を挿入する。よって、外部計算機3は、図22に「通信経路90のデータ」として示すように、命令A、命令B、命令C、周期命令A、命令D、命令E、順序命令、命令F、周期命令Bの順に、命令を順次1つずつ通信経路90を介してインターフェイスボード2に対して送信する。この場合、「時間1」~「時間4」における状態については、ダミー命令が周期命令になること以外は、図19に示す例と同様であるため、説明を省略する。
(時間5)
 タイマー25は、タイミング調整機能23に対して一定周期のタイマー通知を行う。よって、バス用命令バッファ22a~22cの全てから送信される命令が周期命令となり、かつタイマー25からタイマー通知が行われたため、タイミング調整機能23は、バス用命令バッファ22a~22cの動作を再開させる。
 これにより、バス用命令バッファ22aに格納された順序命令は、バス91に送信される。バス用命令バッファ22bに格納された命令Dは、バス92に送信される。バス用命令バッファ22cも、バス93に命令Eを送信する。
(時間6)
 バス用命令バッファ22bに格納された順序命令は、バス92に送信される。バス用命令バッファ22cに格納された順序命令は、バス93に送信される。よって、バス用命令バッファ22a~22cの全てから送信される命令が順序命令となる。そのため、タイミング調整機能23は、タイマー25からタイマー通知は行われていないが、バス用命令バッファ22b、22cの動作を再開させる。
(時間7)
 バス用命令バッファ22aに格納された周期命令は、バス91に送信される。一方、動作を再開したバス用命令バッファ22bに格納された周期命令は、バス92に送信される。バス用命令バッファ22cも、バス93に命令Fを送信する。
(時間8)~(時間9)
 バス用命令バッファ22cに格納された周期命令は、バス93に送信される。バス用命令バッファ22a~22cの全てから送信される命令が周期命令となるが、タイマー25からタイミング調整機能23に対しては、タイマー通知は行われていない。タイミング調整機能23のダミー命令判断部233a~233cは、周期命令を送信するバス用命令バッファ22a~22cの動作を停止させる。
(時間10)
 タイマー25は、タイミング調整機能23に対してタイマー通知を行う。よって、バス用命令バッファ22a~22cの全てから送信される命令が周期命令となり、かつタイマー25からタイマー通知が行われたため、タイミング調整機能23は、バス用命令バッファ22a~22cの動作を再開させる。これにより、バス用命令バッファ22bは、バス92に命令Gを送信する。
 上述した本実施の形態5に係るモジュール制御システム1によれば、ここで例示したように、(1)単純に命令の順序を守りたい場合と、(2)制御周期毎に命令を分けたい場合とを混在させて実施することが可能である。例えば、命令Dがセンサ値取得命令であり、命令Gがモータ駆動命令である場合、制御周期毎に実行する命令を、センサ値取得命令とモータ駆動命令とに分けることができる。また、命令Eと命令Fのように、順序性のみを考慮して実行することも可能である。
 続いて、図23を参照して、実施の形態5に係るインターフェイスボード2のタイミング調整機能23の動作について説明する。本実施の形態5に係るタイミング調整機能23の動作は、図17に示す実施の形態3に係るタイミング調整機能23の動作と比較して、ステップS33の後に、ステップS34~S35に代えて、ステップS36~S40が実行される点が異なる。
 すなわち、タイミング調整機能23は、全てのバス用命令バッファ22a~22cから順序命令が出力されているか否かを判断する(S37)。タイミング調整機能23は、全てのバス用命令バッファ22a~22cから順序命令が出力されていると判断した場合(S37:Yes)、バス用命令バッファ22a~22cの順序命令を破棄する(S41)。これにより、バス用命令バッファ22a~22cからバス91~93への命令の出力が再開される(S32)。一方、タイミング調整機能23は、全てのバス用命令バッファ22a~22cから順序命令が出力されていないと判断した場合(S37:No)、バス用命令バッファ22a~22cの順序命令を破棄しない。
 また、タイミング調整機能23は、全てのバス用命令バッファ22a~22cから周期命令が出力されており、かつタイマー25の出力が1(ハイレベル)であるか否かを判断する(S38、39)。タイミング調整機能23は、全てのバス用命令バッファ22a~22cから周期命令が出力されており、かつタイマー25の出力が1(ハイレベル)であると判断した場合に(S38:Yes、S39:Yes)、バス用命令バッファ22a~22cの周期命令を破棄する(S40)。これにより、バス用命令バッファ22a~22cからバス91~93への命令の出力が再開される(S32)。一方、タイミング調整機能23は、全てのバス用命令バッファ22a~22cから周期命令が出力されていない、又は、タイマー25の出力が1(ハイレベル)でないと判断した場合は(S38:No又はS39:No)、バス用命令バッファ22a~22cの周期命令を破棄しない。
 以上に説明したように、本実施の形態5では、タイミング調整機能23は、ダミー命令が順序命令である場合、タイマー25からの通知信号の出力に関わらず、バス用命令バッファ22a~22cの全てにおいて出力する命令が順序命令となるまで、出力する命令が順序命令となっているバス用命令バッファ22aからの命令の出力を抑止する。また、タイミング調整機能23は、ダミー命令が周期命令である場合は、バス用命令バッファ22a~22cの全てにおいて出力する命令が周期命令となり、かつタイマーから通知信号が出力されるまで、出力する命令が周期命令となっているバス用命令バッファ22aからの命令の出力を抑止する。
 これによれば、ダミー命令が順序命令である場合には、実施の形態1、2で説明したように(1)単純に命令の順序を守りたい場合における制御を実施することができ、ダミー命令が周期命令である場合は、実施の形態3、4で説明したように、(2)制御周期毎に命令を分けたい場合における制御を実施することができる。よって、(1)単純に命令の順序を守りたい場合の制御と、(2)制御周期毎に命令を分けたい場合の制御とを混在させることができる。
(実施の形態5の変形例)
 本実施の形態5においても、図11に示す例と同様に、モジュール制御システム1は、外部計算機3とインターフェイスボード2と、を処理装置5を介して接続するようにしてもよい。
 この場合、図20に示す例と同様に、外部計算機3に代えて処理装置5が周期命令検出部34を有するようにしてもよい。処理装置5は、周期命令検出部34によってN個先のダミー命令が検出された場合、命令メモリ50に蓄積された命令の送信を停止する。また、処理装置5は、周期命令検出部34によるクリア信号の受信に応じて、命令メモリ50に蓄積された命令の送信を再開する。
 また、本実施の形態5においても、図12に示すように、外部計算機3がコンパイラによってソースプログラム311を一括解釈することで生成した実行可能プログラムを処理装置5で実行することで、命令をインターフェイスボード2に対して送信するようにしてもよい。この場合、実行可能プログラムにN個先の周期命令の送信を検出した場合に命令の送信を停止する処理を含めておくことで、処理装置5のCPUが、N個先の周期命令の送信に応じて命令の送信を停止するようにする。また、実行可能プログラムにインターフェイスボード2からのクリア信号に応じて命令の送信を再開する処理を含めておくことで、処理装置5のCPUが、クリア信号に応じて命令の送信を再開するようにする。
<実施の形態6>
 続いて、実施の形態6について説明する。以下、これまでの実施の形態1~5と同様の内容については適宜省略して説明する。
 実施の形態5では、ダミー命令として、順序命令と周期命令を用意した。順序命令と周期命令は、通常は、送信制御機能20を介して外部計算機3から送信されてきた順に、全てのバス用命令バッファ22a~22cに分配されるため、バス用命令バッファ22a~22cから同時期に出力されるダミー命令にとして順序命令と周期命令が混在することはない。しかしながら、電源雑音などにより処理ミスが生じてしまうと、バス用命令バッファ22a~22cから同時期に出力されるダミー命令にとして順序命令と周期命令が混在した状態となる可能性がある。この場合、実施の形態5では、バス用命令バッファ22a~22cからの命令の出力停止が解除されることはなく、フリーズ状態となってしまうという問題がある。そこで、本実施の形態6では、このフリーズ状態を回避する方法について説明する。
 図24に示すように、本実施の形態6に係るインターフェイスボード2は、実施の形態5に係るインターフェイスボード2と比較して、さらに、OR回路238と、AND回路239とを有する点が異なる。
 本実施の形態6では、ダミー命令判断部233a~233cのそれぞれの順序命令検出部2331は、さらに、OR回路238にも信号を出力する。また、OR回路236は、さらに、AND回路239にも信号を出力する。
 すなわち、ダミー命令判断部233は、対応するバス用命令バッファ22から出力される命令が順序命令及び周期命令のいずれの命令であるかを判断する。ダミー命令判断部233は、命令が順序命令である場合には、OR回路238に対して停止信号を出力し、命令が周期命令である場合には、OR回路236に対して停止信号を出力する。
 OR回路238は、ダミー命令判断部233a~233cのそれぞれの順序命令検出部2331から入力される信号の論理和演算により生成された信号を、AND回路239に対して出力する。OR回路238は、ダミー命令判断部233a~233cの少なくとも1つから通知信号が入力されている場合、AND回路239に対して通知信号を出力する。一方、OR回路238は、ダミー命令判断部233a~233cのいずれからも通知信号が入力されていない場合、AND回路239に対して通知信号を出力しない。
 AND回路239は、OR回路236及びOR回路238のそれぞれから入力される信号の論理積演算により生成された信号を、外部計算機3に対して送信する。AND回路239は、OR回路236及びOR回路238の全てから通知信号が入力されている場合、外部計算機3に対して通知信号を出力する。一方、AND回路239は、OR回路236及びOR回路238の少なくとも1つから通知信号が入力されていない場合、外部計算機3に対して通知信号を出力しない。すなわち、AND回路239は、ダミー命令判断部233a~233cのそれぞれにおけるダミー命令が順序命令であるか周期命令であるかの判断結果に不一致がある場合に通知信号を外部計算機3に送信する。
 より具体的には、OR回路238及びAND回路239は、次に説明するように動作する。OR回路238は、ダミー命令判断部233a~233cの少なくとも1つからハイレベルの信号が入力されている場合、AND回路239に対してハイレベルの信号を出力する。一方、OR回路238は、ダミー命令判断部233a~233cの全てからローレベルの信号が入力されている場合、AND回路239に対してローレベルの信号を出力する。
 AND回路235は、OR回路236及びOR回路238の全てからハイレベルの信号が入力されている場合、外部計算機3に対してハイレベルの信号を出力する。一方、AND回路235は、OR回路236及びOR回路238の少なくとも1つからローレベルの信号が入力されている場合、外部計算機3に対してローレベルの信号を出力する。したがって、ハイレベルの信号は、通知信号として機能する。
 このAND回路239からの通知信号は、外部計算機3に対して異常を通知する信号として機能する。このように、本実施の形態6では、ダミー命令判断部233a~233cによる判断結果が不一致である場合に命令の外部計算機3に対して異常を通知する。
 これによれば、外部計算機3は、インターフェイスボード2のAND回路239からの通知信号に応じて、インターフェイスボード2をリセットする等することができる。そのため、ダミー命令判断部233a~233cの全てにおいて順序命令又は周期命令のいずれかが揃うことを合わせる構成において、インターフェイスボード2のフリーズ状態を解消することができる。
(実施の形態6の変形例)
 本実施の形態6においても、実施の形態5と同様に、外部計算機3とインターフェイスボード2とを処理装置5を介して接続するようにしてもよく、外部計算機3に代えて処理装置5が周期命令検出部34を有するようにしてもよく、外部計算機3がコンパイラによってソースプログラム311を一括解釈することで生成した実行可能プログラムを処理装置5で実行するようにしてもよい。
<実施の形態7>
 続いて、実施の形態7について説明する。以下、実施の形態1と同様の内容については適宜省略して説明する。図25を参照して、実施の形態7に係るモジュール制御システム1に係るインターフェイスボード2及び外部計算機3の構成について説明する。本実施の形態7に係るインターフェイスボード2は、実施の形態1に係るインターフェイスボード2と比較して、さらにエラー信号検出部26と、命令発行情報収集部27とを有する。
 エラー信号検出部26は、バス91~93を監視する。エラー信号検出部26は、バス91~93においてエラー発生を検出した場合に、エラーの発生を通知する通知信号を命令発行情報収集部27に出力する。例えば、エラー信号検出部26は、バス91~93の通信規格においてエラーパケットが定義されている場合には、そのエラーパケットを検出したときにエラーが発生したと判断する。また、バス91~93の通信規格においてエラーパケットが定義されていない場合には、例えば、モジュール4が通信に関する異常を検出したときにユーザ定義のエラーパケットを送信することで、そのエラーパケットを検出したときにエラーが発生したと判断するようにしてもよい。
 命令発行情報収集部27は、エラー信号検出部26からの通知信号に応じて、バス用命令バッファ22a~22cのそれぞれに格納されている命令に関する情報を収集する。この情報の収集は、バス用命令バッファ22a~22cの全てに対して実施してもよく、エラー信号検出部26によって異常が検出されたバスに対応するバス用命令バッファ22に対してのみ実施するようにしてもよい。そして、命令発行情報収集部27は、エラーの発生を通知する通知情報を外部計算機3に対して送信する。この通知情報には、収集した情報が含まれる。この情報は、例えば、バス用命令バッファ22a~22cのそれぞれに格納されている命令の種類及び数などを示す情報である。
 このように、本実施の形態7では、エラー信号検出部26は、バス用命令バッファ22a~22cとモジュール4群との間のバス91~93の異常を検出する。そして、命令発行情報収集部27は、エラー信号検出部26によって異常が検出された場合に、バス用命令バッファ22a~22cに格納された命令に関する情報を収集する。
 これによれば、外部計算機3は、どのような命令の送信状況でエラーが発生したのかを把握することができる。よって、例えば、外部計算機3は、インターフェイスボード2のバス用命令バッファ22a~22cをリセットし、エラーが発生した命令から命令を再送する等の復旧処理を実行することが可能となる。
(実施の形態7の変形例)
 また、本実施の形態7においても、図11と同様に、モジュール制御システム1は、外部計算機3とインターフェイスボード2とを処理装置5を介して接続するようにしてもよい。
 この場合、命令発行情報収集部27は、処理装置5(図示せず)にも通知情報を送信する。処理装置5は、命令発行情報収集部27からの通知信号に応じて、命令メモリ50に蓄積された命令の送信を停止する。そして、外部計算機3は、インターフェイスボード2のバス用命令バッファ22a~22c及び処理装置5の命令メモリ50をリセットし、エラーが発生した命令から命令を再送する等の復旧処理を実行すればよい。
 また、図12と同様に、外部計算機3がコンパイラによってソースプログラム311を一括解釈することで生成した実行可能プログラムを処理装置5で実行することで、命令をインターフェイスボード2に対して送信するようにしてもよい。この場合、実行可能プログラムにインターフェイスボード2からの通知信号に応じて命令の送信を停止する処理を含めておくことで、処理装置5のCPUが、通知信号に応じて命令の送信を停止するようにしてもよい。また、実行可能プログラムに異常時処理を含めておき、処理装置5のCPUが、この実行可能プログラムの実行時に通知信号を受信した場合、異常時処理としてインターフェイスボード2のバス用命令バッファ22a~22cをリセットし、エラーが発生した命令から命令を再送する等の復旧を行うようにしてもよい。
<実施の形態8>
 続いて、実施の形態8について説明する。以下、実施の形態1と同様の内容については適宜省略して説明する。
 図26を参照して、実施の形態8に係るモジュール制御システム1に係るインターフェイスボード2及び外部計算機3の構成について説明する。図26に示すように、本実施の形態8に係るインターフェイスボード2は、実施の形態1に係るインターフェイスボード2と比較して、トリガ命令検出機能28と、OR回路214とをさらに有する点が異なる。また、本実施の形態8に係る送信制御機能20は、実施の形態1に係る送信制御機能20と比較して、ダミー命令生成部203をさらに有する点が異なる。
 トリガ命令検出機能28は、送信制御機能20に入力された命令がトリガ命令である場合は、ダミー命令生成部203及びOR回路214に対してブロードキャスト指示信号を出力し、入力された命令がトリガ命令でない場合は、ブロードキャスト指示信号を出力しない。
 OR回路214は、ダミー命令検出機能21及びトリガ命令検出機能28のそれぞれから入力された信号の論理和演算により生成された信号を、命令振分部201及び命令分配部202に出力する。すなわち、本実施の形態8では、実施の形態1と比較して、ダミー命令検出機能21から出力される信号は、命令振分部201及び命令分配部202ではなく、OR回路214に入力される。
 OR回路214は、ダミー命令検出機能21及びトリガ命令検出機能28の少なくとも1つからブロードキャスト信号が入力されている場合、命令振分部201及び命令分配部202に対してブロードキャスト信号を出力する。一方、OR回路214は、ダミー命令検出機能21及びトリガ命令検出機能28のいずれからもブロードキャスト指示信号が入力されていない場合、命令振分部201及び命令分配部202に対してブロードキャスト指示信号を出力しない。
 ダミー命令生成部203は、トリガ命令検出機能28からブロードキャスト指示信号が入力された場合、ダミー命令を生成して命令振分部201及び命令分配部202に対して出力する。すなわち、トリガ命令検出機能28からダミー命令生成部203に対するブロードキャスト指示信号は、ダミー命令生成指示信号として機能する。なお、この場合、命令分配部202は、ダミー命令生成部203から入力されたダミー命令をバス用命令バッファ22a~22cに対して分配した後に、外部計算機3から入力されたトリガ命令をバッファ22a~22cに対して分配する。
 より具体的には、例えば、次に説明する回路で実現されるダミー命令検出機能21及びトリガ命令検出機能28のそれぞれは、ハイレベルとローレベルのいずれかに切り替えられる信号をOR回路214に対して出力する。トリガ命令検出機能28は、送信制御機能20に入力された命令がトリガ命令である場合は、OR回路214に対してハイレベルの信号を出力する。一方、トリガ命令検出機能28は、送信制御機能20に入力された命令がトリガ命令でない場合は、OR回路214に対してローレベルの信号を出力する。
 OR回路214は、ダミー命令検出機能21及びトリガ命令検出機能28の少なくとも1つから入力される信号がハイレベルの信号である場合、命令振分部201及び命令分配部202に対してハイレベルの信号を出力する。一方、OR回路214は、ダミー命令検出機能21及びトリガ命令検出機能28の両方から入力される信号がローレベルの信号である場合、命令振分部201及び命令分配部202に対してローレベルの信号を出力する。なお、実施の形態1で説明したように、この信号は、命令分配部202にはそのまま入力され、命令振分部201にはインバータ209によって反転された信号が入力される。ダミー命令生成部203は、トリガ命令検出機能28からハイレベルの信号が入力された場合に、ダミー命令を生成する。すなわち、ハイレベルの信号は、ブロードキャスト指示信号に相当する。
 このような構成によれば、外部計算機3からトリガ命令が送信された場合、バス用命令バッファ22a~22cの全てに対して、ダミー命令を格納するとともに、そのダミー命令の次にトリガ命令を格納することができる。これまでの実施の形態1~7においても説明したように、バス用命令バッファ22a~22cからの出力は、ダミー命令で待ち合わせを行うことで、命令の順序性を保証している。よって、ダミー命令の次の命令は、バス91~93のそれぞれに同時に送信され、命令の実行タイミングを合わせることができる。よって、本実施の形態8では、外部計算機3の命令生成部31がモジュール4での実行タイミングを合わせたい命令をトリガ命令として送信することで、その命令の実行タイミングを合わせることを可能としている。
 続いて、図27を参照して、実施の形態8に係る命令の実行順序について説明する。図27では、外部計算機3の命令生成部31が命令A~C、トリガ命令、命令D~Fの順に命令を生成する例について説明する。ここで、命令D、命令Fは、実行順序を守るべき命令であるものとする。
 この場合、外部計算機3のダミー命令生成機能30は、命令Dと命令Fの間にダミー命令を挿入する。よって、外部計算機3は、図4に「通信経路90のデータ」として示すように、命令A、命令B、命令C、トリガ命令、命令D、命令E、ダミー命令、命令Fの順に、命令を順次1つずつ通信経路90を介してインターフェイスボード2に対して送信する。
 また、この場合、ダミー命令生成部203は、命令Cとトリガ命令の前にダミー命令を挿入する。したがって、「時間1」~「時間4」におけるバス91~93の状態については、図4に示す例と同様となるため、説明を省略する。
(時間5)
 「時間4」でバス用命令バッファ22b、22cの動作が再開されるため、全てのバス用命令バッファ22a~22cのそれぞれは、ダミー命令の次に格納されたトリガ命令を、バス91~93のそれぞれに送信する。そのため、バス91~93のそれぞれに接続されるモジュール4でトリガ命令が同時に実行される。
 「時間6」以降の動作については、図4に示す例の「時間5」以降と同様の動作となるため、説明を省略する。このように、本実施の形態8では、実行順序を守るべき命令の追い越しを抑止するために行われるダミー命令の待ち合わせを利用して、トリガ命令を同時に実行することを可能としている。
 続いて、図28を参照して、実施の形態8に係るインターフェイスボード2の送信制御機能20、ダミー命令検出機能21、及びトリガ命令検出機能28の動作について説明する。実施の形態8に係るインターフェイスボード2の動作は、図1に示す実施の形態1に係るインターフェイスボード2の動作と比較して、さらに、ステップS24~S26を有する点が異なる。
 すなわち、トリガ命令検出機能28は、外部計算機3から受信した命令がトリガ命令であるか否かを判断する(S24)。ダミー命令生成部203は、外部計算機3から受信した命令がトリガ命令であると判断された場合(S24:Yes)、ダミー命令を生成してトリガ命令の前に挿入する(S25)。送信制御機能20は、命令分配部202によって、そのダミー命令とトリガ命令を全てのバスに分配する(S26)。
 外部計算機3から受信した命令がトリガ命令でなくダミー命令である場合は(S24:No、S21:Yes)、ステップS23が実行される。外部計算機3から受信した命令がトリガ命令及びダミー命令のいずれでもない場合は(S24:No、S21:No)、ステップS22の処理が実行される。
 以上に説明したように、本実施の形態8では、送信制御機能20は、入力された命令がトリガ命令である場合には、トリガ命令の前にダミー命令を挿入して、トリガ命令と共にバス用命令バッファ22a~22cの全てに分配する。
 これによれば、バス用命令バッファ22a~22cの全てにおいてダミー命令の出力が揃う仕組みを利用して、全てのバス91~93に対してトリガ命令を同時に送信することで、トリガ命令を同時に実行することができる。
(実施の形態8の変形例1)
 本実施の形態8においても、図11示す例と同様に、外部計算機3とインターフェイスボード2とを処理装置5を介して接続するようにしてもよい。また、本実施の形態3においても、図12に示す例と同様に、外部計算機3がコンパイラによってソースプログラム311を一括解釈することで生成した実行可能プログラムを処理装置5で実行することで、命令をインターフェイスボード2に対して送信するようにしてもよい。
(実施の形態8の変形例2)
 以上の説明では、トリガ命令の実行タイミングを揃えるためのダミー命令を送信制御機能20において生成して挿入するようにしていたが、これに限られない。外部計算機3において、ダミー命令生成機能30がダミー命令を生成して、トリガ命令の前に挿入するようにしてもよい。これによれば、送信制御機能20においてダミー命令生成部203は不要となる。
<実施の形態9>
 続いて、実施の形態9として、モジュール制御システム1のより具体的な第1の構成例について説明する。
 図29~図31に示すように、実施の形態9に係るモジュール制御システム1は、インターフェイスボード2と、外部計算機3と、複数のモジュール4と、処理装置5と、サーバー6とを有する。
 図29に示すように、サーバー6は、コミュニティー提供部61と、オンラインショップ提供部62と、記憶部63とを有する。サーバー6は、インターネットを介して外部計算機3と接続される。
 コミュニティー提供部61は、外部計算機3に対してインターネットコミュニティーサービスを提供する。オンラインショップ提供部62は、外部計算機3に対してオンラインショップサービスを提供する。
 記憶部63は、モジュールデータ601及び設計データ602等が格納される。すなわち、記憶部63は、これらのデータ601、602を格納可能な記憶装置を含む。記憶装置は、例えば、メモリ及びハードディスク等である。モジュールデータ601は、モジュール4のデータである。モジュールデータ601は、例えば、モジュール4の形状、重さ、及び物理特性などを示す。モジュールデータ601は、モジュール4の種類だけ用意される。設計データ602は、複数のモジュール4によって構築されるガジェットの仮想モデルを示すデータである。
 これにより、外部計算機3のユーザは、コミュニティー提供部61によって提供されるコミュニティーを利用することで、例えば、サーバー6において他のユーザとの間で、自身が作成した設計データ602を共有することができる。また、外部計算機3のユーザは、オンラインショップ提供部62によって提供されるオンラインショップから設計データ602、設計データを作成するためのソフトウェア、及びモジュール4等を購入することができる。
 図29に示すように、外部計算機3は、設計機能330と、USB(Universal Serial Bus)通信機能337とを有する。設計機能330は、記憶機能331と、GUI(Graphical User Interface)ベースのモジュール組立て機能332と、表示機能333と、物理シミュレーション機能334と、プログラミング環境335と、制御設計ツール336とを有する。外部計算機3は、これらの機能331~336を連携させた設計機能330を有することで、ユーザが快適にガジェット及びそれを動作させるプログラムを設計できる環境を提供している。
 記憶機能331は、サーバー3から取得したモジュールデータ601及び設計データ602等が格納される。記憶機能331は、これらのデータ601、602を格納可能な記憶装置を含む。記憶装置は、例えば、メモリ及びハードディスク等である。
 モジュール組立て機能332は、ユーザがGUIベースで仮想的にモジュール4を組み立ててガジェットの仮想モデルを作成する機能を提供する。このようにして作成された仮想モデルを示す設計データ602が記憶機能331に格納される。ユーザは、外部計算機3の入力装置を操作することによって仮想モデルを作成することができる。
 表示機能333は、モジュール4及びガジェットの仮想モデルを3次元コンピュータグラフィックスで表示する。より具体的には、表示機能333は、外部計算機3のCPUが、外部計算機3が有する表示装置に対して、それらの画像を表示することによって実現される。
 物理シミュレーション機能334は、設計データ602が示す仮想モデルによって、ガジェットの動作シミュレーションを実施する機能を提供する。物理シミュレーション機能334は、ガジェットを構成するモジュール4のモジュールデータ601を利用することで、モジュール4の形状などを考慮した動作シミュレーションを実施することが可能である。
 プログラミング環境335は、上述のソースプログラム311を作成するための環境をユーザに対して提供するものである。プログラミング環境335は、例えば、統合開発環境である。ユーザは、プログラミング環境335を利用して、外部計算機3の入力装置を操作することによってソースプログラム311を作成する。
 制御設計ツール336は、複数のモジュール4を制御するソースプログラム311の自動生成ツールである。例えば、制御設計ツール336は、設計データ602に基づいて、ソースプログラム311を自動生成するツールであってもよい。
 USB通信機能337は、インターフェイスボード2との間で、USB通信規格による通信を実現する機能である。すなわち、本実施の形態9では、外部計算機3とインターフェイスボード2とを接続する通信経路90がUSBバスである例について説明する。
 図30に示すように、処理装置5は、処理機能51と、USB通信機能52と、SPI通信機能53と、電圧変換部54と、アナログ入出力部55と、デジタル入出力部56とを有する。
 処理機能51は、処理装置5を統括的に制御する。処理機能51は、CPU及びメモリ等(図示せず)を有し、CPUがメモリに格納されたプログラムを実行することで、処理装置5としての機能を実現する。例えば、処理機能51は、USB通信機能52を介して外部計算機3から命令を受信する。処理機能51は、受信した命令を、SPI(Serial Peripheral Interface)通信機能53を介してインターフェイスボード2に送信する。この場合、処理機能51が有するメモリは、命令メモリ50として機能する。また、処理機能51は、メモリに格納された実行可能プログラムをCPUによって実行することで、プログラム実行部301としても機能することができる。
 USB通信機能52は、外部計算機3との間で、USB通信規格による通信を実現する機能である。SPI通信機能53は、インターフェイスボード2との間で、SPI通信規格による通信を実現する機能である。すなわち、本実施の形態9では、処理装置5とインターフェイスボード2とを接続する通信経路95がSPIバスである例について説明する。
 電圧変換部54は、バッテリ80から供給される電圧をインターフェイスボード2に対して供給可能な電圧に変換する。Vdd出力部541は、電圧変換部54によって変換された電圧を、電源電圧としてインターフェイスボード2に対して供給する。Gnd出力部542は、グランド電圧をインターフェイスボード2に対して供給する。
 アナログ入出力部55は、アナログ入出力部55のコネクタに接続される装置から任意のアナログ信号の入力を受ける。アナログ入出力部55は、入力されたアナログ信号を処理機能51及びインターフェイスボード2に出力する。デジタル入出力部56は、デジタル入出力部56のコネクタに接続される装置から任意のデジタル信号の入力を受ける。デジタル入出力部56は、入力されたデジタル信号を処理機能51及びインターフェイスボード2に出力する。
 これによれば、インターフェイスボード2に対して外部の装置からのアナログ信号及びデジタル信号を処理装置5のコネクタを介して供給することが可能となる。そのため、例えば、インターフェイスボード2上に処理装置5を重ねて配置したとしても、インターフェイスボード2への外部の装置からのアナログ信号及びデジタル信号の供給が阻害されることはない。
 図30に示すように、インターフェイスボード2は、送信機能200と、受信機能220と、SPI通信機能290と、複数のI2C通信機能291a~291dと、コネクタ292a~292hを有する。
 送信機能200及び受信機能220については、これまでの実施の形態1~8で説明した通りである。SPI通信機能290は、処理装置5との間で、SPI通信規格による通信を実現する機能である。I2C通信機能291a~291dのそれぞれは、モジュール4との間で、コネクタ292a~292hを介したI2C通信規格による通信を実現する機能である。図30では、4つのコネクタ292a~292dのそれぞれに対してモジュール4が接続される例について説明する。4つのコネクタ292a~292dのそれぞれに対して複数のモジュール4が接続されることで、インターフェイスボード2及び複数のモジュール4の内部の信号線が接続されてバス91~94が形成される。コネクタ292a~292hは、典型的には、4ピンのコネクタである。この場合、バス91~94のそれぞれは、2本の信号線と、1本の電源電圧線と、1本のグランド電圧線とを含む。電源電圧線には、Vdd出力部541から出力された電源電圧が供給される。グランド電圧線には、Gnd出力部542から出力されたグランド電圧が供給される。
 上述したように、送信機能200は、送信制御機能20を介して処理装置5から受信した命令をバス91~94に振り分け又は分配して送信することが可能である。送信機能200、受信機能220、SPI通信機能290、I2C通信機能291a~291dは、例えば、マイコン2000によって実現される。
 図31に示すように、モジュール4は、マイコン40と、コネクタ48とを有する。上述したように、インターフェイスボード2のコネクタ292a~292dと、複数のモジュール4のコネクタ48とが接続されることで、バス91~94が形成される。マイコン40は、インターフェイスボード2からコネクタ48を介して供給される電源電圧及びグランド電圧によって動作する。また、マイコン40は、インターフェイスボード2からコネクタ48を介して供給される信号によって命令を受信し、実行する。
 ここで、モジュール4は、様々な態様をとることができる。例えば、図31に示すように、センサ41、AC(Alternating Current)モータ43、DC(Direct Current)モータ44、アナログ入出力モジュール45、デジタル入出力モジュール46、通信規格対応モジュール47のうち、いずれか1つ以上を有するようにしてよい。センサ41については、実施の形態1で説明した通りである。
 ACモータ43は、AC電源81から供給される交流電流によって駆動される。DCモータ44は、バッテリ80から供給される直流電流によって駆動される。このように、モジュール4内において、バス91~94を介して供給される電力では電力不足となる装置が存在する場合には、バッテリ80及びAC電源81からその装置に対して直接電力を供給するようにしてもよい。また、図31に示すように、複数のモジュール4は、ACモータ43を有するモジュール4と、DCモータ44を有するモジュール4とを混在させる例に限られない。ACモータ43を有するモジュール4と、DCモータ44を有するモジュール4のうち、いずれか1つのみを利用してもよい。また、図31に示すように、AC電源81からの交流電流をAC/DC変換器82によって直流電流に変換してモジュール4内の装置(図31の例ではアナログ入出力モジュール45)に供給するようにしてもよい。
 アナログ入出力モジュール45は、外部の装置に対してアナログ信号による入出力を行う。デジタル入出力モジュール46は、外部の装置に対してデジタル信号による入出力を行う。このように、モジュール4は、外部の装置と接続し、その外部の装置との間で任意の信号を送受信することで動作するものであってもよい。
 通信規格対応モジュール47は、外部の装置と任意の通信規格による通信によって情報を送受信する。なお、この通信は、有線であってもよく、無線であってもよい。このように、モジュール4は、外部の装置と情報を送受信することで動作するものであってもよい。
 続いて、実施の形態9に係るモジュール制御システム1の動作例について説明する。図32を参照して、実施の形態9に係るモジュール制御システム1の動作について説明する。なお、ここでは、制御周期(例えば10msec)毎の期間を「制御期間」として示している。
 図32に示すように、第1の制御期間で、処理装置5からSPI通信によってインターフェイスボード2に対して、周期命令、センサ値取得命令A~F、及びモータ駆動命令A~Gが送信されるものとする。
 上述したように、タイミング調整機能23によって各バス91~94に対する命令が周期命令となるまで待ち合わせが行われる。そのため、周期命令に続くセンサ値取得命令A~F及びモータ駆動命令A~Gが、各バス91~94において周期命令がそろったタイミングから一斉に送信され、モジュール4で実行される。
 この際、センサ値取得命令A~Fによって取得されたセンサ値A~Fのそれぞれは、随時、モジュール4からSPI通信によって処理装置5に送信される。さらに、このセンサ値は、処理装置5から外部計算機3に送信される。外部計算機3は、モジュール4から送信されたセンサ値A~Fに基づいて、次の第2の制御周期におけるモータ駆動命令A~Iにおける指令値を計算する。
 図32に示すように、第2の制御期間で、処理装置5からSPI通信によってインターフェイスボード2に対して、周期命令、センサ値取得命令A~E、及びモータ駆動命令A~Iが送信されるものとする。
 上述と同様に、タイミング調整機能23によって各バス91~94に対する命令が周期命令となるまで待ち合わせが行われる。そのため、周期命令に続くセンサ値取得命令A~E及びモータ駆動命令A~Iが、各バス91~94において周期命令がそろったタイミングから一斉に送信され、モジュール4で実行される。
 このように、周期命令を利用した制御では、前述したとおり、制御周期毎に命令を分けることができる。そして、それらの命令を繰り返し実行することでガジェット(モジュール4)を制御することができる。これは、例えば、図32に示すようなセンサ値に基づくモータ制御に好適である。モータ制御では、センサ値の取得と、そのセンサ値によるモータの駆動とが繰り返される。それに対して、周期命令を利用した制御によれば、制御周期毎に、センサ値の取得と、モータの駆動とを繰り返すことができ、好適なモータ制御を実現することができる。また、ここで説明したように、制御期間において、モータ駆動命令と、その次の制御期間におけるモータ駆動命令の生成に利用するためのセンサ値を取得するセンサ値取得命令を同時に実行することで、各制御周期でモータ駆動を連続的に実施することができる。
 このように、これまでの実施の形態1~8で説明した内容は、実施の形態9に係るモジュール制御システム1のように開発環境が組み込まれた統合的なシステムにおいても阻害なく実施することが可能である。
<実施の形態10>
 続いて、実施の形態10について説明する。実施の形態10として、モジュール制御システム1のより具体的な第2の構成例について説明する。図33~図35を参照して、実施の形態10に係るモジュール制御システム1の構成について説明する。図33では、サーバー6を図示していないが、当然に、実施の形態10に係るモジュール制御システム1においても、サーバー6を有するようにしてもよい。
 図33に示すように、実施の形態10に係る外部計算機3は、実施の形態9に係る外部計算機3と比較して、接続モジュール一覧表示機能340をさらに有するという点が異なる。接続モジュール一覧表示機能340は、インターフェイスボード2に接続される複数のモジュール4の一覧を表示機能333によって表示する。
 図33に示すように、実施の形態10に係る処理装置5は、実施の形態9に係る処理装置5と比較して、I2C通信機能57と、割り込み機能58と、Vdd出力機能543とをさらに有するという点が異なる。
 I2C通信機能57は、インターフェイスボード2との間で、I2C通信規格による通信を実現する機能である。すなわち、本実施の形態10では、SPI通信規格による通信経路95とは別に命令を送信する通信経路を有している。
 割り込み機能58は、インターフェイスボード2からの割り込み信号を受信する機能である。
 Vdd出力部543は、電圧変換部54によって変換された電圧を、電源電圧としてインターフェイスボード2に対して供給する。本実施の形態10に係る電圧変換部54は、バッテリ80から供給される電圧を変換し、第1の電圧と、第1電圧とは異なる第2の電圧とを生成する。そして、Vdd出力部541は、第1の電圧をインターフェイスボード2に対して供給し、Vdd出力部542は、第2の電圧をインターフェイスボード2に対して供給する。
 接続モジュール一覧取得機能510は、インターフェイスボード2に接続される複数のモジュール4の一覧を取得し、その複数のモジュール4の一覧を示す一覧情報を外部計算機3に対して送信する。これにより、外部計算機3の接続モジュール一覧表示機能340は、処理装置5から受信した一覧情報に基づいて、複数のモジュール4の一覧を表示することができる。これによれば、ユーザは、ガジェットを構成する複数のモジュール4を容易に確認することができる。
 なお、接続モジュール一覧取得機能510は、複数のモジュール4のそれぞれに対して、モジュール情報返信命令を送信することで、複数のモジュール4の一覧を取得する。複数のモジュール4のそれぞれは、処理装置5からのモジュール情報返信命令に応じて、自身を特定する情報を処理装置5に対して返信する。この情報は、例えば、各モジュール4に対して一意に割り当てられたモジュールIDである。この場合、複数のモジュール4の一覧として、複数のモジュール4のモジュールIDの一覧が取得される。
 このモジュール4の一覧の取得は、例えば、上述の実行可能プログラムにモジュール情報返信命令を送信する処理を含めておき、処理機能51がその実行可能プログラムを実行することで実現する。
 図34に示すように、本実施の形態10に係るインターフェイスボード2は、実施の形態9に係るインターフェイスボード2と比較して、さらに、複数の割込み検出部250a~250dと、OR回路251と、停止命令機能260と、複数のエラー検出部261a~261dと、複数の過電流検出部262a~262dと、過電流検出部263と、選択回路293、294と、振分回路295と、複数の電圧変換部296a~296dとを有する。また、本実施の形態10に係るインターフェイスボード2は、実施の形態9に係るインターフェイスボード2と比較して、I2C通信機能291dに代えて、RS485通信機能297を有する。
 複数の割込み検出部250a~250dのそれぞれは、バス91~94のそれぞれに送信される割り込みパケットを検出する。複数の割込み検出部250a~250dのそれぞれは、割り込みパケットを検出した場合、OR回路251に対して割り込み信号を出力する。OR回路251は、複数の割込み検出部250a~250dのそれぞれからの論理和演算により生成された信号を処理装置5の割り込み機能58に対して送信する。すなわち、OR回路251は、複数の割込み検出部250a~250dの少なくとも1つから割り込み信号が入力されている場合、処理装置5の割り込み機能58に対して割り込み信号を送信する。例えば、モジュール4は、緊急に対処が必要な事象を検出した場合、割り込みパケットを送信する。これによれば、処理機能51は、その割り込みパケットに基づく割り込み信号を割り込み機能58を介して受信したときに、その事象に対して迅速に対処することができる。
 停止命令機能260は、エラー検出部261a~261dによってエラーが検出された場合、及び、過電流検出部262a~262d、263によって過電流が検出された場合、処理装置5に対して停止命令を送信する。処理装置5は、インターフェイスボード2の停止命令機能260からの停止命令に応じて、異常時処理を実施する。異常時処理は、例えば、インターフェイスボード2をリセットする又はガジェット(複数のモジュール4)を停止させる等である。これによれば、ガジェットの誤動作を防止することができる。
 複数のエラー検出部261a~261dのそれぞれは、バス91~94のそれぞれに送信されるエラーパケットを、上述のエラーとして検出する。複数の過電流検出部262a~262dのそれぞれは、バス91~94のそれぞれに対して電圧変換部296a~296dのそれぞれから供給される信号の過電流を、上述のエラーとして検出する。過電流検出部263は、バス91~94のそれぞれに対してVdd出力部541、543から選択回路293を介して電源電圧とともに供給される電流の過電流を、上述のエラーとして検出する。
 選択部293は、Vdd出力部541から供給される電圧と、Vdd出力部543から供給される電圧のいずれか1つを選択して、電源電圧としてバス91~94のそれぞれに供給する。ここで、どちらの電圧が選択されるかは、処理装置5の処理機能51が選択部293に対して入力する信号によって切り替えられる。処理機能51は、使用されるモジュール4の動作電圧に応じて、適切な電圧を選択する。
 選択部294は、処理装置5のI2C通信機能57から送信された命令と、インターフェイスボード2のI2C通信機能291aから送信された命令のいずれかを選択してバス91に対して送信する。ここで、どちらの命令が選択されるかは、処理装置5の処理機能51が選択部294に対して入力する信号によって切り替えられる。これによれば、モジュール4の動作をデバッグしたい場合に、送信機能200を経由せず、直接任意の命令をI2C通信機能57経由でモジュール4に対して送信することができる。
 振分部295は、送信機能200から送信された命令を、I2C通信機能291c及びRS485通信機能297のいずれか1つに振り分ける。これによれば、複数のモジュール4において異なる通信規格のモジュール4を混在させることが可能となる。例えば、I2C通信に対応したモジュール4だけでなく、RS485通信に対応したモジュール4も利用したい場合、コネクタ292cの先ではなく、コネクタ292dの先にそのモジュール4を接続する。これによれば、コネクタ292a、292bに接続されたI2C通信に対応したモジュール4と、コネクタ292dに接続されたRS485通信に対応したモジュール4とから構成されるガジェットを制御することができる。なお、全てI2C通信に対応したモジュール4でガジェット構成する場合には、コネクタ292dの先ではなく、コネクタ292cの先にモジュール4を接続すればよい。ここで、振分部295がI2C通信機能291c及びRS485通信機能297のどちらに命令を振り分けるかは、処理装置5の処理機能51が振分部295に対して入力する信号によって切り替えられる。
 電圧変換部296a~296dのそれぞれは、選択部293から入力される電圧を、バス91~94のそれぞれの信号に利用可能な電圧に変換する。
 RS485通信機能292は、モジュール4との間でRS485通信規格による通信を実現する機能である。RS485通信機能297は、コネクタ292dに接続されたバス94に対する通信を実現する。
 図35に示すように、モジュール4は、マイコン40と、モータ42と、コネクタ48と、エラー検知部49とを有する。コネクタ48及びモータ42については、これまでの実施の形態1~9で説明した通りである。
 マイコン40は、処理機能400と、記憶装置410とを有する。処理機能400は、動作制御部401と、エラー対応制御部402、403とを有する。
 動作制御部401は、モータ42の異常が検出されていない通常状態におけるモータ42の制御を実行する。エラー対応制御部402、403は、モータ42の異常が検出された異常状態におけるモータ42の制御を実行する。
 ここで、記憶装置410は、異常状態において、エラー対応制御部402及びエラー対応制御部403のいずれによる制御を実行するか否かを示す選択情報が予め格納される。処理機能400は、異常状態では、記憶装置410に格納された選択情報に応じて、エラー対応制御部402及びエラー対応制御部403のいずれによる制御を実施するかを決定し、決定した制御を実施する。これによれば、例えば、モジュール4が利用されるガジェットに応じて、異常状態において、エラー対応制御部402及びエラー対応制御部403のいずれによる制御を実行するかを変更することができる。
 エラー検知部49は、上述のモータ42の異常を検出する。エラー検知部49は、モータ42の異常を検出した場合、処理機能400に通知する。
 続いて、モジュール制御システム1のより具体的な第2の動作例について説明する。図36を参照して、実施の形態10に係るモジュール制御システム1の動作について説明する。なお、ここでは、制御周期(例えば10msec)毎の期間を「制御期間」として示している。
 図36に示すように、図32を参照して実施の形態9で説明した例と同様に、第1の制御期間で、処理装置5からSPI通信によってインターフェイスボード2に対して、周期命令、センサ値取得命令A~F、及びモータ駆動命令A~Gが送信されるものとする。
 上述したように、タイミング調整機能23によって各バス91~94に対する命令が周期命令となるまで待ち合わせが行われる。そのため、周期命令に続くセンサ値取得命令A~F及びモータ駆動命令A~Gが、各バス91~94において周期命令がそろったタイミングから一斉に送信が開始される。
 この際に、センサ値取得命令A~F及びモータ駆動命令A~Gの送信途中で異常が検出され、停止命令機能260が停止命令を処理装置5に対して送信したものとする。この場合、処理装置5は、この異常に応じた制御を実行する。例えば、図36に示すように、モータ42を停止させるモータ駆動命令をモジュールに対して送信するようにしてもよい。
 そして、処理装置5は、インターフェイスボード2をリセットする等して復旧した後に、第2の制御期間から、通常通り、センサ値取得命令及びモータ駆動命令の送信を再開してよい。
 このように、周期命令を利用した制御では、これまでにも説明したように、制御周期毎に命令を分けることができる。そして、それらの命令を繰り返し実行することでガジェット(モジュール4)を制御することができる。本実施の形態10では、この際に異常が発生した場合であっても、停止命令機能260によって異常を検出し、処理装置5に通知することができる。よって、上述したように、処理装置5は、インターフェイスボード2の停止命令機能260からの通知に応じて、異常状態を復旧し、制御を再開することができる。
 このように、これまでの実施の形態1~8で説明した内容は、実施の形態10に係るモジュール制御システム1のように各種異常検出機能が組み込まれたシステムにおいても阻害なく実施することが可能である。
 なお、本発明は上記実施の形態に限られたものではなく、趣旨を逸脱しない範囲で適宜変更することが可能である。
 上述の実施の形態1~10では、全てのバス用命令バッファ22においてダミー命令がそろった場合には、ダミー命令を破棄していたが、これに限られない。全てのバス用命令バッファ22においてダミー命令がそろった場合においても、ダミー命令を破棄せずに、モジュール4に対して送信するようにしてもよい。この場合、ダミー命令は、モジュール4の制御に影響を与えない命令とすればよい。例えば、この命令は、モジュール4が命令を受信しても何も処理を実行しない命令などとすればよい。しかしながら、好ましくは、上述したようにダミー命令を破棄することで、無駄な命令の送信を無くすことができる。
 また、上述の実施の形態1~10において、実行順序を守るべき命令が存在した場合であっても、それらの命令が同一のバスに対して送信される命令である場合には、それらの命令の間にダミー命令を挿入しないようにしてもよい。同一のバスに対して送信される命令では、命令の追い越しが発生することはないからである。例えば、実行順序判断部32は、対応データに基づいて、i行目の命令とi-1行目以前の命令の送信対象がいずれも同一のバスであると判断した場合には、それらの命令を順序に制約があると判断しないようにしてもよい。
 上述の実施の形態1~8では、送信制御機能20、ダミー命令検出機能21、及びタイミング調整機能23の具体例として回路で構成される例について説明したが、これに限られない。それらの機能のうち、少なくとも一部は、インターフェイスボード2のマイコン2000が有するCPUによって、その少なくとも一部の機能を実行させるプログラムを実行することで実現してもよい。すなわち、実施の形態1~8も、実施の形態9において説明したように、送信機能200及び受信機能220をマイコン2000によって実現するようにしてもよい。
 また、上述の実施の形態1~10では、インターフェイスボード2とモジュール4との間の通信経路における接続方式がバス接続である例について説明したが、これに限られない。例えば、インターフェイスボード2とモジュール4との間の通信経路における接続方式は、ピアツーピア接続であってもよい。また、この場合、通信経路は、有線であってもよく、無線であってもよい。
 この場合であっても、以下の2つの条件を満たすのであれば、図10を参照して説明した課題が生じるからである。
条件1:(インターフェイスボード2とモジュール4の間の通信経路数 × その通信経路の速度) < 外部計算機3とインターフェイスボード2との間の通信経路の速度
条件2:インターフェイスボード2とモジュール4の間の通信経路の間で、送信される命令数に偏りがある
 しかしながら、ピアツーピア接続の場合は1つの通信経路を介して1つのモジュール4のみが接続されるが、バス接続の場合は1つの通信経路を介して複数のモジュール4が接続される。そのため、バス接続の場合は、条件1だけでも上述の課題が顕在化する。したがって、実施の形態1~10では、上述したようにインターフェイスボード2とモジュール4の間の通信経路における接続方式をバス接続とすると効果的である。
1 モジュール制御システム
2 インターフェイスボード
3 外部計算機
4 モジュール
5 処理装置
6 サーバー
20 送信制御機能
21 ダミー命令検出機能
22a、22b、22c バス用命令バッファ
23 タイミング調整機能
24 オーバーフロー検出部
25 タイマー
26 エラー信号検出部
27 命令発行情報収集部
28 トリガ命令検出機能
30 ダミー命令生成機能
31 命令生成部
32 実行順序判断部
33 ダミー命令検出部
34 周期命令検出部
40 マイコン
41 センサ
42 モータ
43 ACモータ
44 DCモータ
45 アナログ入出力モジュール
46 デジタル入出力モジュール
47 通信規格対応モジュール
48 コネクタ
49 エラー検知部
50 命令メモリ
51 処理機能
52 USB通信機能
53 SPI通信機能
54 電圧変換部
55 アナログ入出力部
56 デジタル入出力部
57 I2C通信機能
58 割り込み機能
61 コミュニティー提供部
62 オンラインショップ提供部
63 記憶部
80 バッテリ
81 AC電源
82 AC/DC変換器
90 通信経路
91、92、93 バス
200 送信機能
201 命令振分部
202 命令分配部
203 ダミー命令生成部
209 インバータ
211 順序命令検出部
212 周期命令検出部
213、214、236、238、2333 OR回路
220 受信機能
221 受信制御機能
222a、222b、222c 受信バス用命令バッファ
231a、231b、231c ダミー命令検出部
233a、233b、231c ダミー命令判断機能
232、234、235、239 AND回路
237 選択回路
250a、250b、250c、250d 割込み検出部
261a、261b、261c、261d エラー検出部
262a、262b、262c、262d、263 過電流検出部
251 OR回路
290 SPI通信機能
291a、291b、291c、291d I2C通信機能
292a、292b、292c、292d、292e、292f、292g、292h コネクタ
293、294 選択部
295 振分部
297 RS485通信機能
300 CPU
301 メモリ
302 ハードディスク
303 通信コントローラ
310 インタプリタ
311 ソースプログラム
320 プログラム生成部
321 プログラム実行部
330 設計機能
331 記憶機能
332 モジュール組立て機能
333 表示機能
334 物理シミュレーション機能
335 プログラミング環境
336 制御設計ツール
337 USB通信機能
340 接続モジュール一覧表示機能
400 処理機能
401 動作制御部
402、403 エラー対応制御部
410 記憶装置
510 接続モジュール一覧取得機能
541、543 Vdd出力部
542 Gnd出力部
601 モジュールデータ
602 設計データ
2000 マイコン
2331 順序命令検出部
2332 周期命令検出部

Claims (12)

  1.  命令を実行する複数の命令実行部のそれぞれに前記命令を先入れ先出しで出力する複数の命令記憶部と、
     順次入力される命令を前記複数の命令記憶部のいずれかに振り分ける命令制御部と、
     前記複数の命令記憶部からの前記命令の出力を制御する出力制御部と、を備え、
     前記命令制御部は、入力された命令が、実行順序を守るべき命令の間に挿入されるダミー命令である場合には、前記入力された命令を前記複数の命令記憶部の全てに分配し、
     前記出力制御部は、前記複数の命令記憶部の全てにおいて出力する命令が前記ダミー命令となるまで、出力する命令が前記ダミー命令となっている命令記憶部から前記命令実行部への命令の出力を抑止する、
     命令実行制御システム。
  2.  前記命令実行制御システムは、さらに、前記命令記憶部がオーバーフロー又は一杯になったこと検出し、前記命令の入力元に通知する検出部を備えた
     請求項1に記載の命令実行制御システム。
  3.  前記命令実行制御システムは、さらに、一定周期毎に通知信号を出力するタイマーを備え、
     前記出力制御部は、前記複数の命令記憶部の全てにおいて出力する命令が前記ダミー命令となっているときに前記タイマーから前記通知信号が出力されるまで、前記出力する命令がダミー命令となっている命令記憶部からの命令の出力を抑止する、
     請求項1に記載の命令実行制御システム。
  4.  前記命令実行制御システムは、さらに、
     前記複数の命令記憶部と、前記命令制御部と、前記出力制御部と、前記タイマーとを有するインターフェイス装置と、
     前記インターフェイス装置に対して前記命令を入力する外部装置と、を備え、
     前記外部装置は、所定数のダミー命令の前記インターフェイス装置に対する入力に応じて、前記インターフェイス装置に対する前記命令の入力を中断するダミー命令検出部を有し、
     前記出力制御部は、前記複数の命令記憶部の全てにおいて出力する命令が前記ダミー命令となり、かつ前記タイマーから前記通知信号が出力された場合に、前記ダミー命令検出部に対して通知信号を出力し、
     前記ダミー命令検出部は、前記出力制御部からの通知信号の出力に応じて、前記中断していた命令の入力を再開する、
     請求項3に記載の命令実行制御システム。
  5.  前記命令実行制御システムは、前記ダミー命令として、順序命令及び周期命令が入力され、
     前記出力制御部は、
     前記ダミー命令が前記順序命令である場合、前記タイマーからの通知信号の出力に関わらず、前記複数の命令記憶部の全てにおいて出力する命令が前記順序命令となるまで、出力する命令が前記順序命令となっている命令記憶部からの命令の出力を抑止し、
     前記ダミー命令が前記周期命令である場合は、前記複数の命令記憶部の全てにおいて出力する命令が前記周期命令となっているときに前記タイマーから前記通知信号が出力されるまで、出力する命令が前記周期命令となっている命令記憶部からの命令の出力を抑止する、
     請求項3に記載の命令実行制御システム。
  6.  前記命令実行制御システムは、さらに、
     前記複数の命令記憶部と、前記命令制御部と、前記出力制御部と、前記タイマーとを有するインターフェイス装置と、
     前記インターフェイス装置に対して前記命令を入力する外部装置と、を備え、
     前記外部装置は、所定数の周期命令の前記インターフェイス装置に対する入力に応じて、前記インターフェイス装置に対する前記命令の入力を中断する周期命令検出部を有し、
     前記出力制御部は、前記複数の命令記憶部の全てにおいて出力する命令が前記周期命令となり、かつ前記タイマーから前記通知信号が出力された場合に、前記周期命令検出部に対して通知信号を出力し、
     前記周期命令検出部は、前記出力制御部からの通知信号の出力に応じて、前記中断していた命令の入力を再開する、
     請求項5に記載の命令実行制御システム。
  7.  前記出力制御部は、
     前記複数の命令記憶部のそれぞれから出力される命令が、前記順序命令及び前記周期命令のいずれの命令であるかを判断する複数のダミー命令判断部と、
     前記複数のダミー命令判断部による判断結果が不一致である場合に前記命令の入力元に異常を通知する通知部と、を有する、
     請求項5に記載の命令実行制御システム。
  8.  前記命令実行制御システムは、さらに、
     前記命令記憶部と前記命令実行部との間において前記命令が伝送される通信経路の異常を検出する異常検出部と、
     前記異常検出部によって異常が検出された場合に、前記命令記憶部に格納された命令に関する情報を収集する情報収集部と、を備えた
     請求項1に記載の命令実行制御システム。
  9.  前記命令制御部は、さらに、前記入力された命令がトリガ命令である場合には、前記トリガ命令の前に前記ダミー命令を挿入して前記複数の命令記憶部の全てに分配するとともに、前記入力されたトリガ命令を前記複数の命令記憶部の全てに分配する、
     請求項1に記載の命令実行制御システム。
  10.  前記命令記憶部は、前記出力制御部による前記命令の出力の抑止が解除された場合に、前記ダミー命令を破棄する、
     請求項1に記載の命令実行制御システム。
  11.  前記命令実行制御システムは、さらに、
     前記複数の命令記憶部と、前記命令制御部と、前記出力制御部とを有するインターフェイス装置と、
     前記インターフェイス装置に対して前記命令を入力する外部装置と、を備え、
     前記インターフェイス装置は、
     前記命令を生成する命令生成部と、
     前記命令生成部によって生成された命令において、実行順序を守るべき命令が存在するか否かを判断する実行順序判断部と、
     前記実行順序判断部によって実行順序を守るべきと判断された命令の間に前記ダミー命令を生成して挿入するダミー命令生成部と、を有する、
     請求項1に記載の命令実行制御システム。
  12.  順次入力される命令を複数の命令記憶部のいずれかに振り分ける命令制御ステップと、
     前記複数の命令記憶部のそれぞれに格納された命令を、前記命令を実行する複数の命令実行部のそれぞれに先入れ先出しで出力する命令出力ステップと、を備え、
     前記命令制御ステップでは、入力された命令が、実行順序を守るべき命令の間に挿入されるダミー命令である場合には、前記入力された命令を前記複数の命令記憶部の全てに分配し、
     前記命令出力ステップでは、前記複数の命令記憶部の全てにおいて出力する命令が前記ダミー命令となるまで、出力する命令が前記ダミー命令となっている命令記憶部から前記命令実行部への命令の出力を抑止する、
     命令実行制御方法。
PCT/JP2014/005663 2014-11-11 2014-11-11 命令実行制御システム及び命令実行制御方法 WO2016075721A1 (ja)

Priority Applications (4)

Application Number Priority Date Filing Date Title
CN201480082409.0A CN107111523B (zh) 2014-11-11 2014-11-11 命令执行控制系统和命令执行控制方法
PCT/JP2014/005663 WO2016075721A1 (ja) 2014-11-11 2014-11-11 命令実行制御システム及び命令実行制御方法
JP2016558442A JP6314246B2 (ja) 2014-11-11 2014-11-11 命令実行制御システム及び命令実行制御方法
US15/513,544 US20170300329A1 (en) 2014-11-11 2014-11-11 Instruction execution control system and instruction execution control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2014/005663 WO2016075721A1 (ja) 2014-11-11 2014-11-11 命令実行制御システム及び命令実行制御方法

Publications (1)

Publication Number Publication Date
WO2016075721A1 true WO2016075721A1 (ja) 2016-05-19

Family

ID=55953835

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2014/005663 WO2016075721A1 (ja) 2014-11-11 2014-11-11 命令実行制御システム及び命令実行制御方法

Country Status (4)

Country Link
US (1) US20170300329A1 (ja)
JP (1) JP6314246B2 (ja)
CN (1) CN107111523B (ja)
WO (1) WO2016075721A1 (ja)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10303230B1 (en) * 2016-10-31 2019-05-28 Cadence Design Systems, Inc. Method and system to mitigate large power load steps due to intermittent execution in a computation system
US10719320B2 (en) * 2017-07-31 2020-07-21 Intel Corporation Power noise injection to control rate of change of current
JP6927032B2 (ja) * 2017-12-29 2021-08-25 トヨタ自動車株式会社 電力変換回路の保護制御装置
JP6939718B2 (ja) * 2018-06-26 2021-09-22 日本電信電話株式会社 ネットワーク機器及びネットワーク機器の設定方法
JP7059899B2 (ja) * 2018-11-09 2022-04-26 トヨタ自動車株式会社 ネットワークシステム
CN111124496B (zh) * 2019-12-25 2022-06-21 合肥中感微电子有限公司 一种多周期指令处理方法、处理器和电子设备
US11366774B2 (en) * 2020-09-24 2022-06-21 Adesto Technologies Corporation Memory latency reduction in XIP mode
US11609868B1 (en) * 2020-12-31 2023-03-21 Waymo Llc Control calibration timing to avoid memory write blackout period

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06162206A (ja) * 1992-11-26 1994-06-10 Fujitsu Ltd 並列処理装置における処理順序指定方式

Family Cites Families (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5819079A (en) * 1995-09-11 1998-10-06 Intel Corporation Instruction fetch on demand for uncacheable memory which avoids memory mapped I/O side effects in a processor with speculative instruction fetch
US5961639A (en) * 1996-12-16 1999-10-05 International Business Machines Corporation Processor and method for dynamically inserting auxiliary instructions within an instruction stream during execution
US6088772A (en) * 1997-06-13 2000-07-11 Intel Corporation Method and apparatus for improving system performance when reordering commands
US6047334A (en) * 1997-06-17 2000-04-04 Intel Corporation System for delaying dequeue of commands received prior to fence command until commands received before fence command are ordered for execution in a fixed sequence
US5941983A (en) * 1997-06-24 1999-08-24 Hewlett-Packard Company Out-of-order execution using encoded dependencies between instructions in queues to determine stall values that control issurance of instructions from the queues
US6209073B1 (en) * 1998-04-27 2001-03-27 International Business Machines Corp. System and method for interlocking barrier operations in load and store queues
US6643718B1 (en) * 2000-07-21 2003-11-04 Silicon Integrated Systems Corporation Method and apparatus for controlling order dependency of items in a multiple FIFO queue structure
US7363474B2 (en) * 2001-12-31 2008-04-22 Intel Corporation Method and apparatus for suspending execution of a thread until a specified memory access occurs
US7437521B1 (en) * 2003-08-18 2008-10-14 Cray Inc. Multistream processing memory-and barrier-synchronization method and apparatus
US7475397B1 (en) * 2004-07-28 2009-01-06 Sun Microsystems, Inc. Methods and apparatus for providing a remote serialization guarantee
US20060026388A1 (en) * 2004-07-30 2006-02-02 Karp Alan H Computer executing instructions having embedded synchronization points
US8996761B2 (en) * 2007-08-10 2015-03-31 Kernelon Silicon Inc. Virtual queue processing circuit and task processor
JP2009134391A (ja) * 2007-11-29 2009-06-18 Renesas Technology Corp ストリーム処理装置、ストリーム処理方法及びデータ処理システム
US8176299B2 (en) * 2008-09-24 2012-05-08 Apple Inc. Generating stop indicators based on conditional data dependency in vector processors
US8082426B2 (en) * 2008-11-06 2011-12-20 Via Technologies, Inc. Support of a plurality of graphic processing units
JP2011234517A (ja) * 2010-04-28 2011-11-17 Renesas Electronics Corp 動力駆動制御装置および動力装置
CN102480387A (zh) * 2010-11-30 2012-05-30 英业达股份有限公司 机架式服务器装置
JP5714455B2 (ja) * 2011-08-31 2015-05-07 ルネサスエレクトロニクス株式会社 半導体集積回路
EP3005128B1 (en) * 2013-05-30 2018-07-04 Hewlett-Packard Enterprise Development LP Separate memory controllers to access data in memory
US9495318B2 (en) * 2013-11-25 2016-11-15 Apple Inc. Synchronizing transactions for a single master over multiple busses
US10067768B2 (en) * 2014-07-18 2018-09-04 Nvidia Corporation Execution of divergent threads using a convergence barrier
US9575802B2 (en) * 2014-10-28 2017-02-21 International Business Machines Corporation Controlling execution of threads in a multi-threaded processor

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06162206A (ja) * 1992-11-26 1994-06-10 Fujitsu Ltd 並列処理装置における処理順序指定方式

Also Published As

Publication number Publication date
CN107111523B (zh) 2020-10-20
JPWO2016075721A1 (ja) 2017-04-27
JP6314246B2 (ja) 2018-04-18
US20170300329A1 (en) 2017-10-19
CN107111523A (zh) 2017-08-29

Similar Documents

Publication Publication Date Title
WO2016075721A1 (ja) 命令実行制御システム及び命令実行制御方法
EP2413484B1 (en) Safety control system
US10241551B2 (en) Control and synchronization mechanism for a complex distributed power management system
EP2515189B1 (en) Plc cpu unit, system program for plc, and storage medium having system program for plc stored therein
EP3076293A2 (en) Control apparatus
JP6527399B2 (ja) ネットワークを用いた通信システム
WO2015163084A1 (ja) データ処理システム及びデータ処理方法
EP3651417A1 (en) Control system and control method
WO2018163665A1 (ja) 制御装置および制御方法
JP5244082B2 (ja) リアルタイム分散制御システム、リアルタイム分散制御方法、およびロボット
Klobedanz et al. Distributed coordination of task migration for fault-tolerant FlexRay networks
US7506082B2 (en) Data transferring system using USB and method thereof
WO2014013866A1 (ja) 端末通信装置および分散制御システム
EP4027591A1 (en) Master device, arithmetic processing device, programmable logic controller, network, and method
JP2012146150A (ja) 割り込み信号生成装置および割り込み信号生成方法
JP2007214981A (ja) データ転送回路、それを利用したマルチプロセッサシステム、及びデータ転送方法
WO2011108232A1 (ja) プログラムトレース装置
JP2019092351A (ja) 電力系統安定化システムおよび処理装置
US11734206B2 (en) Information processing device
CN111527724B (zh) 处理装置、半导体集成电路以及状态监视方法
KR101476585B1 (ko) 다중화 기기간 데이터 선별을 위한 시리얼 버스 프로토콜 구현 방법 및 장치
JP2011065529A (ja) 半導体集積装置およびその制御方法
KR20160144688A (ko) 큐를 이용한 smp 가상 머신 이벤트 라우터 및 방법
WO2012117445A1 (ja) 情報処理システム
US10089156B2 (en) Electronic device for synchronizing tasks of an electronic appliance

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14905915

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2016558442

Country of ref document: JP

Kind code of ref document: A

WWE Wipo information: entry into national phase

Ref document number: 15513544

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14905915

Country of ref document: EP

Kind code of ref document: A1