with reference to fig1 to 7 , embodiments of a valve - position output apparatus of the present invention will be described . [ 0038 ] fig1 is a schematic sectional view of a valve - position output apparatus according to a first embodiment of the present invention , and fig2 is a sectional view taken along the line ii of fig1 . as shown in these figures , in the first embodiment , a valve 2 is rotatably provided in a duct or pipe 1 . this valve 2 is arranged to rotate between a fully opened valve - position and a fully closed valve - position which is spaced apart from the fully opened valve - position at an angle of about 90 - degree . the valve 2 is typically used at either one of the fully opened and fully closed valve - positions . specifically , the valve is not used at any valve position in a transition or intermediate angle between the fully opened and fully closed valve - positions , and is moved in succession or without any stop motion between the fully opened and fully closed valve - positions . the valve 2 may include a butterfly valve 3 as shown in fig3 ( a ) and 3 ( b ), a ball valve 4 as shown in fig3 ( c ) and 3 ( d ) and the like . a valve body 5 of the butterfly valve 3 has a circular or disc shape . at the fully closed valve - position shown in fig3 ( a ), the valve body 5 is located approximately perpendicular to a flow direction of a fluid in the pipe 1 to block off the fluid . at the fully opened valve - position shown in fig3 ( b ), the valve body 5 is located approximately parallel to the flow direction of the fluid in the pipe 1 to allow the fluid to be flowed therethrough . on the other hand , a valve body 7 of the ball valve 4 has a spherical or globular shape and is formed with a through - hole 8 penetrating the valve body 7 . at the fully closed valve - position shown in fig3 ( c ), the through - hole 8 is located approximately perpendicular to the flow direction of the fluid in the pipe 1 to block off the fluid . at the fully opened valve - position shown in fig3 ( d ), the through - hole 8 is located approximately parallel to the flow direction of the fluid in the pipe 1 to allow the fluid to be flowed therethrough . as shown in fig1 a valve shaft 11 of the valve 2 extends outside the pipe 1 , and a pinion 12 ( or a gear ) is provided on the periphery of the extended section of the valve shaft 11 . this pinion 12 is arranged to rotate with the valve shaft 11 in one united body , and to engage with a rack 13 . pistons 14 are provided at both ends of the rack 13 , respectively . each of the pistons 14 is placed in a corresponding pneumatic cylinder 16 . air is supplied to and discharged from each pneumatic cylinder 16 to drive the pistons 14 , as shown in fig2 . when the pistons 14 are driven , the rack 13 is moved to rotate the pinion 12 and the valve shaft 11 . the pinion 12 , rack 13 , pistons 14 , pneumatic cylinders 16 and other make up a valve - driving device 17 for driving the valve 2 . this valve - driving device 17 and the valve 2 make up a valve unit . an end of the valve shaft 11 is formed in a rectangular column , and protrudes from the valve unit . a suitable tool , such as a wrench , may be fitted in the end of the valve shaft 11 to manually rotate the valve 2 . a valve - position output apparatus 31 for detecting a rotational position of the valve 2 and outputting a signal corresponding to the detected rotational position is attached to the end of the valve shaft 11 . specifically , an interlocking shaft 32 of the valve - position output apparatus 31 is coupled with the end of the valve shaft 11 through an adapter 23 , such as a socket joint . a circular rotary plate 33 is integrally provided in the interlocking shaft 32 . this interlocking shaft 32 and the rotary plate 33 make up an interlocking member which is moved in sync with the rotation of the valve shaft 11 ( or the open and close operations of the valve 2 ). as best shown in fig4 a , a plurality of position - detecting apertures 34 are formed in the rotary plate 33 . light - emitting diodes 36 serving as a light - emitting section and phototransistors 37 serving as a light - receiving section are located opposed to each other with interposing the rotary plate 33 therebetween . the interlocking shaft 32 , rotary plate 33 , position - detecting apertures 34 , light - emitting diodes 36 and phototransistors 37 make up an optical rotary encoder . the phototransistors 37 are arranged to receive light from the corresponding light - emitting diodes 36 through the position - detecting apertures 34 , and to generate a pulse signal in response to the rotation of the rotary plate 33 . thus , the rotational position of the rotary plate 33 may be figured out by processing the pulse signal . the optical encoder may include an incremental type encoder shown in fig4 ( a ) and 4 ( b ), and an absolute type encoder shown in fig4 ( c ) and 4 ( d ). in the incremental type encoder , the position - detecting apertures 34 include a - phase slits 41 and b - phase slits 42 , and the phototransistors 37 are positioned to the slits 41 , 42 , respectively . each phase of the b - phase slits 42 is shifted by one - quarter pitch with respect to each phase of the a - phase slits . this phase shift makes it possible to detect whether the rotary plate 33 rotates in a normal rotational direction or in a reverse rotational direction . in the incremental type encoder , the rotational position of the rotary plate 33 may be figured out by counting pulse signals from one of the phototransistors 37 ( more specifically , by adding the counted pulse signals during the normal rotation and subtracting the counted pulse signals from the previous total pulse signals during the reverse rotation ). on the other hand , in the absolute type encoder , the position - detecting apertures 34 comprise a plurality of tracks 46 to 50 , and the phototransistors 37 are positioned to the tracks 46 to 50 , respectively . thus , the rotational position of the rotary plate 33 may be figured out by identifying one or more of the phototransistors 37 which are one or more of the detecting the tracks 46 to 50 . as shown in fig5 in both types , the pulse signal from the phototransistors 37 is input to digital angle generating means 52 of a signal processor 51 composed of a microcomputer . the digital angle generating means 52 serving as digital valve - position signal generating means generates a digital signal corresponding to the rotational position of the rotary plate 33 on the basis of the pulse signal from the phototransistors 37 . in the incremental type encoder , the digital angle generating means 52 is initialized by closed valve - position setting means 53 of the signal processor 51 with locating the valve 2 at the fully closed valve - position . the closed valve - position setting means 53 serving as initial setting means is composed of a button switch or the like . the digital angle generating means 52 is set in its origin by pushing the button switch . after the initial setting , when the valve 2 is opened or closed to rotate the rotary plate 33 , the digital angle generating means 52 counts the pulse signal from the phototransistors 37 , and outputs the counted number in the form of a digital angle signal ( digital valve - position signal ). in the incremental type encoder , the digital angle generating means 52 appropriately stores a current digital angle signal in a nonvolatile memory , such as eprom . when a power supply is cut off and then turned on , the stored digitals angle signal is read out from the nonvolatile memory and used as the digital angle 20 signal at that time . on the other hand , in the absolute type encoder , the rotational position of the rotary plate 33 may be figured out by the signal from the phototransistors 37 . however , the digital angle generating means 52 is initialized by the closed valve - position setting means 53 of the signal processor 51 with locating the valve 2 at the fully closed valve - position , because the valve 2 is not always located at the full closed valve - position with about zero degree . the digital angle generating means 52 is set in its origin by the closed valve - position setting means 53 and then generates the digital angle signal by subtracting an angel signal at the initial setting from the signal from the phototransistors 37 . the digital angle signal from the digital angle generating means 52 may be externally output directly from an external output terminal 56 , or may otherwise be converted into an analog signal through a d / a converter 57 to externally output the converted analog signal . as shown in fig5 ( b ), when converting into the analog signal , the current value of the analog signal or an output analog signal is not set in zero ma but set in about 4 ma at the fully closed valve - position . thus , the state when the output of the d / a converter 57 becomes about zero may be judged as abnormality , or that a certain failure arises in the valve - position output apparatus , etc . the digital angle signal of the digital angle generating means 52 is output to the closed valve - position determining means 58 . then , the closed valve - position determining means 58 determines whether the valve 2 is located at the fully closed valve - position , on the basis of the digital angle signal . when determined that the valve 2 is locate at the fully closed valve - position , the closed valve - position determining means 58 outputs a closed valve - position signal to abnormality determining means 62 and an on - off signal generator 61 serving as on - off signal generating means . when determined that the valve 2 is not located at the fully closed valve - position , the closed valve - position determining means 58 outputs the digital angle signal received from the digital angle generating means 52 to opened valve - position determining means 63 . in response to the closed valve - position signal from the closed valve - position determining means 58 , the on - off signal generator 61 externally outputs an on signal ( e . g . about 24 v ) through an on - off signal output section 64 being an amplifier composed of a transistor , etc . when receiving no closed valve - position signal from the closed valve - position determining means 58 , the on - off signal generator 61 externally outputs an off signal ( e . g . about 0 v ) through the on - off signal output section 64 . these on and off signals are equivalent to a relay output of the conventional limit switch . the opened valve - position determining means 63 determines whether the valve 2 is located it the fully opened valve - position , on the basis of the digital angle signal . when determined that the valve 2 is located at the fully opened valve - position , the opened valve - position determining means 63 outputs an opened valve - position signal to the abnormality determining means 62 . in response to the closed valve - position signal from the closed valve - position determining means 58 or the opened valve - position signal from the opened valve - position determining means 63 , the abnormality determining means 62 resets an abnormality determining timer 66 . the abnormality determining timer 66 is arranged to output a lapsed time after the abnormality determining timer 66 is reset , to the abnormality determining means 62 . the abnormality determining timer 66 has a specific abnormality determining time which is a predetermined reference time for determining the abnormality . when the lapsed time output from the abnormality determining timer 66 exceeds the abnormality determining time , the abnormality determining means 62 generates an alarm signal to an alarm device 67 . the alarm device 67 gives an alarm with light , sound or the like in response to the alarm signal . with reference to the flowchart of fig6 the operation of the valve - position output apparatus 31 will be described . in step 1 , for one of the initial setting after the valve - position output apparatus 31 is attached to the valve unit , the valve 2 is located at the fully closed valve - position being an original position of the valve 2 . in step 2 , the light - emitting diodes 36 are activated to emit light , and the signal from the phototransistors 37 is input to the digital angle generating means 52 of the signal processor 51 . in step 3 , the closed valve - position setting means 53 is operated by the button switch or the like as described above to set the origin of the digital angle generating means 52 . the initial setting is completed through steps 1 to 3 . in step 4 , compressed air is supplied to one of the pneumatic cylinders 16 . thus , the valve - driving device 17 is moved to rotate the valve 2 , and then the process proceeds to step 5 . in step 5 , the light - emitting diodes 36 emit light , and the signal from the phototransistors 37 is input to the signal processor 51 . then , the process proceeds to step 6 . in step 6 , the digital angle generating means 52 generates the digital angle signal as a digital signal representing the rotational angle of the valve 2 on the basis of the signal from the optical rotary encoder or the light - emitting diodes 36 to externally output the digital angle signal from the external output terminal 56 , and then the process proceeds to step 7 . in step 7 , the digital angle signal is output to the d / a converter 57 and is externally output from the d / a converter 57 . then , the process proceeds to step 8 . in step 8 , the closed valve - position determining means 58 determines whether the valve 2 is located at the fully closed valve - position , on the basis of the digital angle signal . when determined that the valve 2 is located at the fully closed valve - position , the process proceeds to step 9 . when determined that the valve 2 is not located at the fully closed valve - position , the process proceeds to step 11 . in step 9 , the closed valve - position determining means 58 outputs the closed valve - position signal to the on - off signal generator 61 and the abnormality determining means 62 . in response to the closed valve - position signal , the on - off signal generator 61 generates the on signal , and the on - off signal output section 64 amplifies the generated on signal to externally output . in step 10 , the abnormality determining means 62 resets the abnormality determining timer 66 in response to the closed valve - position signal , and the process returns to step 5 . as described above , when determined that the valve 2 is not located at the fully closed valve - position in step 8 , the process proceeds to step 11 . in step 11 , since no closed valve - position signal is input to the on - off signal generator 61 , the on - off signal generator 61 generates the off signal to externally output it through the on - off signal output section 64 . the closed valve - position determining means 58 also outputs the digital angle signal to the opened valve - position determining means 63 , and then the process proceeds to step 12 . in step 12 , the opened valve - position determining means 63 determines whether the valve 2 is located at the fully opened valve - position , on the basis of the digital angle signal from the closed valve - position determining means 58 . when determined that the valve 2 is located at the fully opened valve - position , the opened valve - position determining means 63 outputs the opened valve - position signal to the abnormality determining means 62 , and the process proceeds to step 10 . in response to the opened valve - position signal , the abnormality determining means 62 resets an abnormality determining timer 66 , and then the process returns to step 5 . on the other hand , when determined that the valve 2 is not located at the fully opened valve - position in step 12 , the process proceeds to step 13 . in step 13 , the abnormality determining means 62 judges whether the lapsed time output from the abnormality determining timer 66 exceeds the predetermined abnormality determining time . when judged that the abnormality determining timer 66 does not exceed the predetermined abnormality determining time , the process returns to step 5 . when judged that the abnormality determining timer 66 does exceed the predetermined abnormality determining time , the process proceeds to step 14 . in step 14 , the abnormality determining means 62 generates the alarm signal to output it to the alarm device 67 . in response to the alarm signal , the alarm device 67 gives the alarm , and then the process returns to step 5 . the external output from the valve - position output apparatus constructed as described above may be applied to display the valve position or control the valve . with reference to fig7 a valve - position output apparatus according to a second embodiment of the present invention will be described . in fig7 a flow - regulating valve 71 is provided in a pipe 1 . a valve body 72 of the flow - regulating valve 71 is linearly moved and is also reciprocated . the flow - regulating valve 71 is arranged to reciprocate between a fully closed valve - position where the flow - regulating valve 71 is almost fully closed ( corresponding to the fully closed valve - position in the first embodiment ) and a fully opened valve - position where the flow - regulating valve 71 is almost fully opened ( corresponding to the fully opened valve - position in the first embodiment ). the flow - regulating valve 71 is also arranged to stop at any position between the fully closed and fully opened valve - positions to regulate a flow rate of a fluid passing through the pipe 1 . a rack 74 is formed in a valve shaft 73 of the flow - regulating valve 71 , and a pinion 77 rotatably driven by a motor 76 is engaged with the rack 74 . the rack 74 , the motor 76 and the pinion 77 make up a valve - driving device . this valve - driving device and the flow - regulating valve 71 make up a valve unit . an interlocking shaft 79 of the valve - position output apparatus 80 is coupled with the end of the valve shaft 73 through an adapter 78 . a plate member 82 having position - detecting apertures 81 is connected to the interlocking shaft 79 . a light - emitting diode 83 and a phototransistor 84 are located opposed to each other with interposing the plate member 82 therebetween . the interlocking shaft 79 and the plate member 82 make up an interlocking member . the plate member 82 , the light - emitting diodes 83 and the phototransistors 84 make up an optical linear encoder . as with the optical rotary encoder , the optical linear encoder may include the incremental type encoder and absolute type encoder . a signal processor 86 has a similar structure as that of the signal processor 51 , but the valve - position output apparatus 80 does not include the alarm device 67 . the invention has now been described in detail with reference to specific embodiments . however , it is not intended that the invention is limited to such embodiments , and various modifications may be made within the spirit and scope of the appended claims . some modifications of the present invention will be described as follows . ( 1 ) the on - off signal output section , the d / a converter and the external output terminal for digital signals may be selectively provided and are not necessarily provided all together . in particular , in case of providing only either one of the d / a converter or the external output terminal for digital signals , wirings may be reduced as less as possible . the on - off signal output section may be configured by a relay or the like . ( 2 ) the structure or type of the valve and the optical encoder may be appropriately modified and selected . ( 3 ) while the driving power of the valve - driving device is an air pressure in the above embodiments , any other type of driving power , such as electrical or hydraulic power , may be applied . the structure or type of the valve - driving device may also be appropriately modified and selected . ( 4 ) the alarm device may be omitted . further , the alarm signal may be externally output . ( 5 ) while the origin is defined at the fully closed valve - position in the above embodiments , the fully opened valve - position may be used as the origin . ( 6 ) while the analog signal is arranged to add a certain value to the output analog signal when converting the digital signal to the analog signal in the above embodiments , it is possible not to add such an additional value . however , it is preferable to add such an additional value for detecting the abnormality . ( 7 ) while the on - off signal generator and the on - off signal output section are provided only to the fully closed valve - position in the above embodiments , they may also be provided to the fully opened valve - position . ( 8 ) while the power source of the valve - position output apparatus is supplied from outside in the above embodiments , an internal power source , such as a battery , may be provided in the valve - position output apparatus , and an backup power source may be additionally provided . ( 9 ) while the valve shaft is formed of a single member in the above embodiments , it may be constructed by a plurality of members . ( 10 ) the on - off signal may be switched to output the on signal when the valve is moved to one of the fully opened and fully closed valve - positions , and to output the off signal when the valve is moved to the other of the fully opened and fully closed valve - positions . ( 11 ) the digital signal may be output through an rs232c connector or any suitable connector , such as an rs 485 connector .