PROGRAM, PROGRAM SET, INFORMATION PROCESSING APPARATUS, AND METHOD
The program addresses the issue of incorrect port information by using device information to transmit data to a device, ensuring reliable data transmission even when port information is misaligned.
Patent Information
- Application Number
- JP2021091910
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-05-31
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2041-05-31
AI Technical Summary
Existing methods for transmitting data to a device, such as a printer, require correct port information to be set, which can lead to failures if the port information is not correctly aligned between print queue information and device information.
A program that acquires device information from the operating system without relying on port information, allowing data transmission to a device using device information that includes related information about the destination device and second port information, thereby bypassing the need for correctly set port information.
Enables data transmission to the desired device even if the port information is not set correctly, by using device information to establish a connection, thus improving the reliability of data transmission processes.
Smart Images

Figure 0007673500000001 
Figure 0007673500000002 
Figure 0007673500000003
Abstract
Description
[Technical field]
[0001] The present invention relates to a program for transmitting data to a device, a program set including the program, an information processing apparatus for transmitting data to a device, and a method for transmitting data to a device. [Background technology]
[0002] In the information processing device, various data are created using application programs. The created data is printed, as necessary, by a local printer directly connected to the information processing device, or a network printer connected to the information processing device via a network. In order to execute this printing, it is necessary to install a printer driver in the information processing device and add a port managed by the OS installed in the information processing device before executing the printing.
[0003] Patent Document 1 describes an example of an information processing device that outputs target data to an external device connected via a network. In the information processing device described in Patent Document 1, a port monitor having a virtual port searches for an external device to which the target data should be output from among multiple external devices based on feature information indicating features related to the target data, creates an output path to the detected external device, and transmits the target data to the created output path. [Prior art documents] [Patent documents]
[0004] [Patent Document 1] JP 2008-027153 A Summary of the Invention [Problem to be solved by the invention]
[0005] To send data to a device, the port must be set correctly. If the device is a printer, the OS stores print queue information, including information on the printer driver and port information, and device status, including the printer model name, serial number, communication interface information, port information, etc. The port information included in the print queue information must correspond to the port information included in the device information. If the two do not correspond, print data cannot be sent to the desired printer, and printing cannot be performed on the desired printer.
[0006] The present invention has been made in consideration of the above circumstances, and its purpose is to provide a means for transmitting data to a desired device, in a manner different from the conventional method, even if port information is not set correctly. [Means for solving the problem]
[0007] Various disclosures are made in this specification. A program as an example of the disclosed examples is a program executed by a computer of an information processing device equipped with an OS. The OS stores device queue information including device driver information, which is information about a device driver installed in the information processing device, and first port information for each device queue, and device information including associated information related to the device and second port information for each device. When the OS is called by specifying one device queue from an application program, the OS has a function of acquiring the first port information related to the specified device queue from the device queue information, acquiring the device information having the second port information corresponding to the acquired first port information, and transmitting data output from the application program to the device using the acquired device information. When the program is called from a higher-level program, the program causes the computer to execute an acquisition process of acquiring the device information from the OS, a determination process of determining a destination device based on the associated information included in the device information acquired in the acquisition process, and a transmission process of transmitting data output from the higher-level program to the destination device determined in the determination process using the device information related to the destination device. Effect of the Invention
[0008] According to the present invention, since related information is obtained from the OS without using port information, and data is transmitted using device information including related information on the destination device and second port information, data can be transmitted without using device queue information. Therefore, even if the port information is not set correctly, data can be transmitted to the desired device. [Brief description of the drawings]
[0009] [Figure 1] FIG. 1 is a schematic diagram of a system 1 according to the present embodiment. [Diagram 2]FIG. 2 is a block diagram of the information processing device 10 and the printer 20 included in the system 1 according to the present embodiment. [Diagram 3] FIG. 3 is a diagram showing a printing process using the functions of the OS 120 in the information processing device 10 according to this embodiment. [Figure 4] FIG. 4 is a diagram showing a print process using the communication program 110 in the information processing device 10 according to the present embodiment. [Diagram 5] FIG. 5 is a diagram showing another printing process using the communication program 110 in the information processing device 10 according to the present embodiment. [Figure 6] FIG. 6 is a flowchart of the installation program for the communication program 110 according to this embodiment. [Figure 7] FIG. 7 is a flowchart of the communication program 110 according to this embodiment. [Figure 8] FIG. 8 is a continuation of FIG. [Figure 9] FIG. 9 is a continuation of FIG. [Figure 10] FIG. 10 is a continuation of FIG. [Figure 11] FIG. 11 is a flowchart of the two-way communication process shown in FIG. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0010] Hereinafter, an embodiment of the present invention will be described with reference to the drawings as appropriate. Note that the embodiment described below is merely one example of the present invention, and it goes without saying that the embodiment of the present invention can be modified as appropriate without departing from the spirit of the present invention. For example, the execution order of each process described below can be modified as appropriate without departing from the spirit of the present invention.
[0011] [System 1 Configuration] A system 1 according to the present embodiment will be described with reference to FIG. 1. The system 1 shown in FIG. 1 includes an information processing device 10 and a printer 20. The printer 20 is connected to a port of the information processing device 10. The information processing device 10 and the printer 20 may be directly connected using a USB cable or the like, or may be connected using a communication network. The communication network may be a wired LAN, a wireless LAN, the Internet, a dedicated line, or a combination of these. One or more printers 20 are connected to the information processing device 10. In the example shown in FIG. 1, two of the four printers 20 are physically connected to the information processing device 10 so as to be able to communicate with the information processing device 10, and the remaining two printers are not physically connected to the information processing device 10 so as to be able to communicate with the information processing device 10.
[0012] [Configuration of information processing device 10] 2, the information processing device 10 includes a CPU 11, a memory 12, an input unit 13, a display unit 14, and a communication I / F unit 15. The CPU 11, the memory 12, the input unit 13, the display unit 14, and the communication I / F unit 15 are connected using an internal bus 16. The information processing device 10 is any device that instructs the printer 20 to print. The information processing device 10 is, for example, a personal computer, a business computer, a terminal device, etc. The information processing device 10 also includes a mobile phone, a smartphone, a tablet terminal, etc.
[0013] The CPU 11 controls the operation of the information processing device 10. The CPU 11 reads out and executes various programs (described later) from the memory 12 based on various information input from the input unit 13, various information received from an external device via the communication I / F unit 15, etc. Results of the execution of the programs are displayed on the display unit 14, or transmitted to the external device via the communication I / F unit 15, for example. The CPU 11 is an example of a computer of the information processing device 10.
[0014] The memory 12 stores various programs executed by the CPU 11 and data or information required for executing the programs. The memory 12 stores a communication program 110, an OS 120, an application program 130, etc. The memory 12 is configured by, for example, a RAM, a ROM, an EEPROM, a HDD, a portable storage medium such as a USB memory detachably attached to the information processing device 10, a buffer provided in the CPU 11, etc., or a combination of these. The communication program 110 is an example of a program.
[0015] The memory 12 may be a computer-readable storage medium. A computer-readable storage medium is a non-transitory medium. In addition to the above examples, non-transitory media also include recording media such as CD-ROMs and DVD-ROMs. Non-transitory media are also tangible media. On the other hand, an electrical signal carrying a program downloaded from a server on the Internet is a computer-readable signal medium, which is a type of computer-readable medium, but is not included in non-transitory computer-readable storage media.
[0016] The input unit 13 is an input device operated by a user to input instructions, information, and the like to the information processing device 10. The input unit 13 is, for example, a mouse, a keyboard, a touch panel, and the like. The display unit 14 is a display device that displays the processing results, status, and the like of the information processing device 10 on a screen. The display unit 14 is, for example, a liquid crystal display, an organic EL display, and the like. A touch panel having a display function functions as the input unit 13 and the display unit 14. The communication I / F unit 15 is an interface circuit that communicates with an external device such as the printer 20. The communication includes communication using a cable, etc., and communication using a communication network. The communication includes communication using a wired LAN, communication using a wireless LAN, communication using a USB, communication using Bluetooth (registered trademark), and the like. The input unit 13, the display unit 14, and the communication I / F unit 15 operate under the control of the CPU 11.
[0017] [Printer 20 configuration] 2, the printer 20 includes a CPU 21, a memory 22, an input unit 23, a display unit 24, a communication I / F unit 25, and a print unit 26. The CPU 21, the memory 22, the input unit 23, the display unit 24, the communication I / F unit 25, and the print unit 26 are connected using an internal bus 27. The functions of the CPU 21, the memory 22, the input unit 23, the display unit 24, and the communication I / F unit 25 are similar to the functions of the CPU 11, the memory 12, the input unit 13, the display unit 14, and the communication I / F unit 15 of the information processing device 10. However, the memory 22 stores a printer program 210, and the CPU 21 executes the printer program 210.
[0018] The print unit 26 is an element that performs printing based on data transmitted from the information processing device 10. The print unit 26 may perform printing by, for example, an inkjet method in which ink is ejected to record an image, or may perform printing by another method. The print unit 26 may perform black-and-white printing and color printing, or may perform black-and-white printing only. The printer 20 may be a dedicated print machine, or may be an MFP (Multifunction Peripheral) that further includes a FAX unit and the like in addition to the print unit 26. The printer 20 is an example of a device.
[0019] [Printing using OS120 functions] The information processing device 10 is equipped with an OS 120. The OS 120 may be, for example, Windows (registered trademark) Operating System, MacOS (registered trademark), Android (registered trademark) OS, iOS (registered trademark), Windows Phone (registered trademark) Operating System, or the like. The OS 120 has a function of executing multiple application programs 130 installed in the information processing device 10 in parallel. The multiple application programs 130 are virtually executed in parallel, for example, by a time sharing method.
[0020] The OS 120 has a function of sending data to the printer 20 using a print queue. In response to a print instruction from a user, the application program 130 outputs a print instruction and data to the printer 20 using the functions of the OS 120. Hereinafter, the print process using the functions of the OS 120 will be described with reference to Fig. 3. The print process shown in Fig. 3 is well known.
[0021] Before printing is performed, a printer driver 160 corresponding to the printer 20 is installed in the information processing device 10. The OS 120 stores printing device information 140 and device information 150. The printing device information 140, the device information 150, and the printer driver 160 are actually stored in the memory 12. The printer driver 160 is an example of a device driver.
[0022] The printing device information 140 includes printer driver information 141 and port information 142 for each print queue. The printer driver information 141 is information related to a printer driver 160 installed in the information processing device 10. The printer driver 160 is linked to the printer driver information 141. The port information 142 is port information of the printer 20 corresponding to the printer driver information 141. The printing device information 140 is an example of device queue information. The printer driver information 141 is an example of device driver information. The port information 142 is an example of first port information.
[0023] The device information 150 includes device details 151 and port information 152 for each device. The device details 151 is information used in communication with the printer 20. The device details 151 includes the model name, serial number, communication I / F information, etc. The port information 152 is port information of the printer 20 corresponding to the device details 151. The device details 151 is an example of related information. The port information 152 is an example of second port information.
[0024] 3 is executed when port information 142 included in printing device information 140 and port information 152 included in device information 150 are linked. A print queue is printing device information 140 in which port information 142 and port information 152 are linked. Printing device information 140 and device information 150 are linked via a port. Note that "linked" is an example of "corresponding."
[0025] Before a print command is issued from application program 130, a list of registered print queues is displayed on display unit 14. The user selects one print queue from the displayed list and issues a print command. Application program 130 calls OS 120, specifying the print queue selected by the user. OS 120 outputs data (hereinafter referred to as print data) output from application program 130 to printer driver 160 linked to printer driver information 141 of the specified print queue. Printer driver 160 generates data (hereinafter referred to as printer data) that can be interpreted by printer 20, based on the print data. Printer driver 160 entrusts the generated printer data to spooler 170.
[0026] The spooler 170 is a program included in the OS 120. The spooler 170 acquires port information 142 corresponding to a specified print queue from the print device information 140, and acquires port information 152 linked to the acquired port information 142 from the device information 150. The spooler 170 outputs printer data generated by the printer driver 160 to a port indicated by the acquired port information 152. The OS 120 acquires device detail information 151 included in device information 150 including the acquired port information 152. The OS 120 outputs printer data generated by the printer driver 160 to the printer 20 using the device information 150 including the acquired device detail information 151 and port information 152.
[0027] The spooler 170 is a part of the OS 120. The printer data generated by the printer driver 160 has a different format from the print data output from the application program 130, but the data is the same. Therefore, when the OS 120 is called by the application program 130 specifying one print queue, it can be said that the OS 120 obtains port information 142 related to the specified print queue from the print device information 140, obtains device details information 151 related to the printer having port information 152 corresponding to the obtained port information 142 from the device information 150, and transmits the data output from the application program 130 to the printer 20 using the device information 150 including the obtained device details information 151 and port information 152.
[0028] 3 can be executed only when the port information 142 included in the printing device information 140 is associated with the port information 152 included in the device information 150. If the port information 142 and the port information 152 are not associated with each other, the printing process shown in FIG. 3 cannot be executed.
[0029] [Printing process using communication program 110] The communication program 110 according to this embodiment is a program that can execute print processing even when the port information 142 and the port information 152 are not linked. The communication program 110 executes print processing (FIG. 4 or FIG. 5) different from the print processing (FIG. 3) that uses the functions of the OS 120. The user can select whether to execute print processing using the functions of the OS 120 or print processing using the communication program 110.
[0030] The communication program 110 is called from the application program 130 or the printer driver 160. The application program 130 and the printer driver 160 are examples of higher level programs that call the communication program 110. Hereinafter, with reference to FIG. 4, a printing process using the communication program 110 will be described in the case where the printer driver 160 calls the communication program 110.
[0031] A dedicated print queue (hereinafter referred to as a specific print queue) corresponding to the communication program 110 is added to the OS 120. The print device information 140 includes printer driver information 141 and port information 142 for a conventional print queue (not shown) and the specific print queue. The printer driver information 141 for the specific print queue is information on a printer driver 160 used when performing print processing using the communication program 110. The port information 142 for the specific print queue is information on a port used when performing print processing using the communication program 110. The port information 142 for the specific print queue included in the print device information 140 is not linked to the port information 152 included in the device information 150.
[0032] Before a print command is issued from the application program 130, a list of registered print queues is displayed on the display unit 14. The list includes a specific print queue. The user selects a specific print queue from the displayed list and issues a print command. The application program 130 designates the specific print queue and calls the OS 120. The OS 120 outputs the print data output from the application program 130 to the printer driver 160 linked to the printer driver information 141 for the specific print queue. The printer driver 160 generates printer data based on the print data. When the specific print queue is designated, the printer driver 160 passes the generated printer data to the communication program 110.
[0033] When called by the printer driver 160, the communication program 110 causes the computer (CPU 11) of the information processing device 10 to execute an acquisition process for acquiring device information 150 from the OS 120. Next, the communication program 110 causes the computer of the information processing device 10 to execute a determination process for determining a destination device based on the device information 151 included in the device information 150 acquired in the acquisition process. Next, the communication program 110 causes the computer of the information processing device 10 to execute a transmission process for transmitting the printer data entrusted by the printer driver 160 to the destination device determined in the determination process, using the device information 150 including the device information 151 and port information 152 related to the destination device.
[0034] In this way, when communication program 110 is called by printer driver 160, it directly references detailed device information 151 and second port information 152 included in device information 150, without reference to port information 142 included in print device information 140. This makes it possible to send data to printer 20 without relying on a print queue. Therefore, according to communication program 110 of this embodiment, even if the port information is not set correctly, data can be sent to the desired device.
[0035] Note that the application program 130 may have a function equivalent to that of the printer driver 160. In this case, as shown in FIG. 5, the application program 130 includes print device information 190. The print device information 190 includes information for generating printer data for each printer model (in FIG. 5, it is written as printer model A, printer model B, etc.). The application program 130 acquires any of the information according to the model of the printer 30 from the print device information 190, and generates printer data using the acquired information. The application program 130 is also configured to call the communication program 110 in advance, and after generating the printer data, it calls the communication program 110 and passes the printer data to the communication program 110.
[0036] [Print device information 140 settings] When using the communication program 110 in combination with the printer driver 160, it is necessary to set the printer driver information 141 and the port information 142 for the specific print queue. This setting may be performed by the user operating the input unit 13. In this case, the user can arbitrarily set the port information 142 (port name) for the specific print queue as long as it does not overlap with other port names.
[0037] Alternatively, to reduce the burden on the user, an installation program that installs the communication program 110 in the information processing device 10 may perform the above settings. As shown in Fig. 6, the installation program causes the computer (CPU 11) of the information processing device 10 to execute a process (S311) of installing the communication program 110 and the printer driver 160 in the information processing device 10, a process (S312) of adding a new port with a specific port name to the OS 120, and a process (S313) of registering printer driver information 141 related to the installed printer driver 160 and port information 142 related to the added port in the printing device information 140. S311 is an example of an installation process. S312 is an example of an addition process. S313 is an example of a registration process.
[0038] [Details of Communication Program 110] The details of the communication program 110 will be described with reference to Fig. 7 to Fig. 11. The communication program 110 starts operation when called by a higher-level program. In the description of Fig. 7 to Fig. 11, "the communication program 110 or the OS 120 causes the CPU 11 of the information processing device 10 to execute the process that the communication program 110 or the OS 120 performs" is described as "the communication program 110 or the OS 120 performs". Also, "the printer program 210 causes the CPU 21 of the printer 20 to execute the process that the printer program 210 performs" is described as "the printer program 210 performs".
[0039] The flowcharts in this specification basically show the processing of the CPUs 11 and 21 according to the instructions written in the program. That is, the processing of "judging," "selecting," "obtaining," "receiving," and the like in the following description represents the processing of the CPUs 11 and 21. The processing by the CPU 11 also includes hardware control via the OS 120. Note that "obtaining" is used as a concept that does not require a request. That is, the processing of the CPU 11 receiving data without a request is also included in the concept of "the CPU 11 obtaining data." In addition, "data" in this specification is represented by a bit string that can be read by a computer. Data with the same substantial meaning but different formats are treated as the same data. The same applies to "information" in this specification.
[0040] The communications program 110 first obtains information required for device search from the calling upper-level program (S111). Information required for device search includes device class, vendor ID, and the like. The device class is an ID indicating the class of the destination device. The device class indicates classes such as printer, scanner, and mass storage. The vendor ID is an ID indicating the company of the destination device. S111 is an example of a receiving process for receiving device identification information from a higher-level program.
[0041] Next, the communications program 110 requests the OS 120 for a list of device information 150 for the connected devices, specifying the device class acquired in S111 (S112). Here, the connected devices refer to devices that are physically connected to the information processing device 10. Upon receiving the request from the communications program 110, the OS 120 creates a list of device information 150 for the connected devices (S211) and returns the created list of device information 150 to the communications program 110. The communications program 110 receives the list of device information 150 for the connected devices from the OS 120 (S113).
[0042] S112 and S113 are an example of an acquisition process for acquiring device information 150 from OS 120. This acquisition process is a process for acquiring both device information 150 including port information 152 corresponding to port information 142 included in printing device information 140, and device information 150 including port information 152 that does not correspond to port information 142 included in printing device information 140, from OS 120. This acquisition process is also a process for acquiring only device information 150 related to printer 20 that is physically connected to information processing device 10 so as to be able to communicate with the information processing device 10. This acquisition process is also a process for acquiring device information 150 related to a type of device specified by a higher-level program, from OS 120.
[0043] Next, the communication program 110 analyzes the list of the acquired device information 150 (S114 to S118). The communication program 110 judges whether the list of the acquired device information 150 includes device information of the target device class acquired in S111 (S114). In response to judging that the list includes device information of the target device class (S114: Yes), the communication program 110 judges whether a product ID is specified by the upper program (S115). The product ID is information indicating the function of the printer. In response to judging that the product ID is specified (S115: Yes), the communication program 110 judges whether the connected devices include a device with the specified product ID (S116). In response to judging that the connected devices include a device with the specified product ID (S116: Yes), the communication program 110 judges whether a device ID or a serial number is specified by the upper program (S117). The device ID and the serial number are unique information assigned to each printer. In response to determining that a device ID or serial number has been specified (S117: Yes), the communications program 110 determines whether the connected devices include a device with the specified device ID or serial number (S118). In response to determining that a device with the specified device ID or serial number is included (S118: Yes), the communications program 110 proceeds to S151 shown in FIG.
[0044] If the communication program 110 determines in S115 that the product ID has not been specified (S115: No), the program proceeds to S131 shown in Fig. 8. If the communication program 110 determines in S117 that the device ID and serial number have not been specified (S117: No), the program proceeds to S131.
[0045] If the communication program 110 determines in S114 that device information of the target device class is not included (S114: No), the communication program 110 proceeds to S121. If the communication program 110 determines in S116 that a device with the specified product ID is not included (S116: No), the communication program 110 proceeds to S121. If the communication program 110 determines in S118 that a device with the specified device ID and serial number is not included (S118: No), the communication program 110 proceeds to S121.
[0046] In S121, the communication program 110 displays on the display unit 14 that the target device specified by the upper program is not connected. For example, the communication program 110 displays on the display unit 14 a pop-up screen indicating that the target device is not connected. Next, the communication program 110 displays a screen with a list of connected devices and an inquiry message inquiring whether to change the destination device, and waits for an input from the user (S122). The user uses the input unit 13 to instruct whether to change the destination device. The communication program 110 judges whether the destination device has been changed (S123). If the communication program 110 judges that the destination device has been changed (S123: Yes), it proceeds to S151. If the communication program 110 judges that the destination device has not been changed (S123: No), it returns a communication failure to the upper program and ends the operation.
[0047] 8, the communications program 110 determines whether there are multiple connected devices. If it is determined that there is one connected device (S131: No), the communications program 110 determines whether a mode for direct transmission to one connected device is valid (S132). Here, direct transmission means that transmission is executed immediately without user confirmation when the conditions are met. If it is determined that a mode for direct transmission to one connected device is valid (S132: Yes), the communications program 110 sets the one connected device as the destination (S133) and proceeds to S151.
[0048] In response to determining in S131 that there are multiple connected devices (S131: Yes), the communications program 110 determines whether the product IDs of all devices are the same (S141). In response to determining that the product IDs are not the same (S141: No), the communications program 110 determines whether a mode that ignores the product ID is enabled (S142). In response to determining that the mode that ignores the product ID is enabled (S142: Yes), the communications program 110 determines whether a mode that directly transmits to all connected devices is enabled (S143).
[0049] In response to determining that the mode of directly transmitting to all connected devices is not valid (S143: No), the communications program 110 displays a list of connected devices and an inquiry message prompting the user to select a device on the display unit 14, and waits for input from the user (S145). The user uses the input unit 13 to instruct whether to select a destination device. The communications program 110 determines whether a destination device has been selected (S146). In response to determining that a device has been selected (S146: Yes), the communications program 110 determines whether the product IDs of the selected devices are the same (S147). In response to determining that the product IDs of the selected devices are the same (S147: Yes), the communications program 110 proceeds to S151.
[0050] In response to determining in S147 that the product IDs of the selected devices are not the same (S147: No), the communications program 110 displays a confirmation message on the display unit 14 and waits for input from the user (S148). In S148, for example, a confirmation message such as "Because the product IDs of the selected devices are not the same, unexpected problems may occur. Do you want to continue?" is displayed on the display unit 14. The user uses the input unit 13 to instruct whether to continue the process. The communications program 110 determines whether continuation has been instructed (S149). In response to determining that continuation has been instructed (S149: Yes), the communications program 110 proceeds to S151.
[0051] If the communication program 110 determines in S132 that the mode of directly transmitting to one connected device is not valid (S132: No), the program proceeds to S145. If the communication program 110 determines in S141 that the product IDs are the same (S141: Yes), the program proceeds to S143 without executing S142. If the communication program 110 determines in S142 that the mode of ignoring the product ID is not valid (S142: No), the program proceeds to S145 without executing S143. If the communication program 110 determines in S143 that the mode of directly transmitting to all connected devices is valid (S143: Yes), the program proceeds to S147, setting all connected devices as destinations (S144).
[0052] In response to determining that no device has been selected in S146 (S146: No), the communications program 110 ends the operation as a communication failure. In response to determining that no instruction to continue has been given in S149 (S149: No), the communications program 110 returns a communication failure to the upper program and ends the operation.
[0053] S114 to S118, S121 to S123, S131 to S133, and S141 to S149 are examples of a determination process for determining a destination device. If the information on the printer 20 specified by the information required for device search received in S111 is included in the device information 150 acquired from the OS 120, the determination process determines the printer 20 specified by the received information required for device search as the destination device (S133, S144). On the other hand, if the information on the printer 20 specified by the received information required for device search is not included in the device information 150 acquired from the OS 120, the determination process accepts a device designation from the user and determines the device designated by the user as the destination device (S146).
[0054] In S151 shown in FIG. 9, the communication program 110 judges whether there are multiple destination devices. In response to judging that there are multiple destination devices (S151: Yes), the communication program 110 starts up the same number of processes as the destination devices, and causes each process to execute the processing from S171 shown in FIG. 10 in parallel (S152). Next, the communication program 110 judges whether a communication error has occurred in any device (S153). In response to judging that there is a device in which a communication error has occurred (S153: Yes), the communication program 110 displays on the display unit 14 the identification name (device ID or serial number) of the device in which the communication error has occurred and a message prompting the user to check the connection state, and waits for an input from the user (S154). The user uses the input unit 13 to instruct whether to continue the processing. The communication program 110 judges whether the instruction to continue has been given (S155). If it is determined that an instruction to continue has been given (S155: Yes), the communications program 110 sets the device in which the communications error occurred as the destination (S156), and proceeds to S151.
[0055] If the communication program 110 determines that there is one destination device (S151: No), it proceeds to S171. If the communication program 110 determines that there is no device in which a communication error has occurred in S153 (S153: No), it returns a communication success to the upper program and ends the operation. If the communication program 110 determines that continuation has not been instructed in S155 (S155: No), it returns a communication failure to the upper program and ends the operation.
[0056] In the process shown in Fig. 10, a flag is used to prevent simultaneous writing by multiple programs. This flag is set to ON when a certain program is writing (communicating state), and is set to OFF when no program is writing.
[0057] 10, the communications program 110 judges whether the flag is ON. If the communications program 110 judges that the flag is ON (S171: Yes), it repeatedly executes S171. If the communications program 110 judges that the flag is OFF (S171: No), it proceeds to S172. Next, the communications program 110 specifies the device identification name (device ID, serial number, etc.) and requests the OS 120 for a communications handle for reading and writing the device port (S172). When the OS 120 receives the request for the communications handle from the communications program 110, it outputs the specified communications handle to the communications program 110 (S271).
[0058] Next, the communications program 110 judges whether the communications handle has been acquired (S173). If the communications program 110 judges that the communications handle has been acquired (S173: Yes), it sets a flag to ON (S174) and executes the two-way communications process shown in Fig. 11 (S175). Next, the communications program 110 judges whether a communications error has occurred in the two-way communications process (S176). If the communications program 110 judges that no communications error has occurred (S176: No), it sets the flag to OFF (S177), releases the communications handle (S178), returns a communication success to the upper program, and ends the operation.
[0059] In response to determining that a communication error has occurred in S176 (S176: Yes), the communications program 110 turns off the flag (S181), releases the communications handle (S182), returns a communication failure to the upper program, and terminates operation. In response to determining that a communications handle could not be acquired in S173 (S173: No), the communications program 110 executes S181 and S182, and terminates operation as a communication failure.
[0060] 11 illustrates the bidirectional communication process executed in S175. At the beginning of the bidirectional communication process, the communications program 110 specifies a device port and sends a status request to the OS 120 (S191). When the OS 120 receives the status request from the communications program 110, it writes the status request to the specified device port (S291). When the OS 120 writes the status request, the printer program 210 outputs a response value of the status request to the OS 120 (S391). When the OS 120 receives a response value from the printer program 210, it writes the received response value to the specified device port (S292).
[0061] The communication program 110 receives a response value of the status request from the OS 120 using the device port (S192). Next, the communication program 110 analyzes the response value of the status request (S193). Next, the communication program 110 judges whether the device is communicable (S194). If the communication program 110 judges that the device is communicable (S194: Yes), it divides the printer data into pieces of a certain length (S195). Next, the communication program 110, the OS 120, and the printer program 210 perform a process of transmitting the divided printer data (S196). Next, the communication program 110 ends the two-way communication process, and proceeds to S176 shown in FIG. 10.
[0062] In response to determining in S194 that the device is not communicable (S194: No), the communications program 110 ends the two-way communications process without executing S195 and S196, and proceeds to S176.
[0063] The device name specified in S172 is the one included in the device details 151 of the device information 150 received in S113. S151 to S156, S171 to S178, and S181 to S182 are an example of a transmission process in which data output from a higher-level program is transmitted to a destination device using the device information 150 related to the destination device. The above-mentioned determination process is a process in which a plurality of destination devices can be determined. When a plurality of destination devices are determined in the determination process, the transmission process transmits the data output from the higher-level program to each of the determined plurality of destination devices (S152). This transmission process is a process in which a process corresponding to each of the plurality of destination devices is started, and the data output from the higher-level program is transmitted to each of the started processes for each of the above processes.
[0064] [Effects of the embodiment] According to the above embodiment, the device details 151 are acquired from the OS 120 without using port information, and data is sent using the device information 150 including the device details 151 and the port information 152 related to the destination device, so that data can be sent without using device queue information. Therefore, even if the port information is not set correctly, data can be sent to the desired device.
[0065] Furthermore, the acquisition process not only acquires device information 150 relating to printers 20 whose port information 152 corresponds to port information 142, but also acquires device information 150 relating to printers 20 whose port information 152 does not correspond to port information 142, so that data can be sent to devices whose port information is not set correctly.
[0066] In addition, since the acquisition process acquires only device information 150 related to printers 20 that are physically connected to communicate, a destination device can be determined from among the printers 20 that are physically connected to communicate, and data can be transmitted to the determined destination device.
[0067] Furthermore, by determining the destination device in S133 and S144, data can be sent to the printer 20 specified by the upper program. Even if the port information related to the printer 20 specified by the upper program is not set correctly, data can be sent to the printer 20 specified by the upper program.
[0068] Furthermore, by determining the destination device in S146, data can be sent to the printer 20 specified by the user when the printer 20 specified by the upper program cannot be used. Even if the port information related to the printer 20 specified by the user is not set correctly, data can be sent to the printer 20 specified by the user.
[0069] The acquisition process is a process of acquiring device information 150 related to a type of device specified by the upper program from the OS 120. Therefore, the communication program 110 can handle a plurality of types of devices. The transmission process is a process of transmitting data output from the upper program to each of a plurality of determined destination devices. Therefore, data can be transmitted to a plurality of devices in parallel.
[0070] [Variations] Various modifications can be made to the above embodiment. For example, the communication program 110 may cause the CPU 11 to execute a determination process for determining the type of device based on data output from the upper program before S112 shown in Fig. 7. In this case, the acquisition process may be a process for acquiring device information 150 related to the type of device determined in the determination process from the OS 120. The communication program according to the modifications can also be compatible with multiple types of devices.
[0071] Moreover, an embodiment of the present invention includes a program set including a communication program 110 and a data generation program. This data generation program generates data to be sent to the printer 20, and calls the communication program 110 as a higher-level program. This results in a program set including the communication program 110 and a program that calls the communication program 110.
[0072] In the above embodiment, the case where print data is sent to a printer has been described, but the present invention is not limited to this. For example, the present invention can be applied to a case where a scan instruction is sent from an application program or a scanner driver. The present invention can also be applied to a case where a FAX transmission instruction or a FAX reception instruction is sent to a facsimile device from an application program or a FAX driver.
[0073] In the information processing device 10 and printer 20 of the above embodiment, an example has been described in which the various processes executed by the computer of the present invention are realized by the CPUs 11 and 21 executing various programs stored in the memories 12 and 22. However, the configuration of the computer is not limited to this, and a part or all of the configuration may be realized by hardware such as an integrated circuit. [Explanation of symbols]
[0074] 1. System 10...Information processing device 20...Printer (device) 110…Communication program (program) 120…OS 11...CPU (computer) 130...Application program (higher level program) 140...Print device information (device queue information) 141...Printer driver information (device driver information) 142...Port information (first port information) 150…Device information 151...Device details information (related information) 152...Port information (second port information) 160...Printer driver (device driver, higher level program)
Claims
1. A program executed by a CPU of an information processing device equipped with an OS, the OS stores device queue information including, for each device queue, device driver information, which is information related to a device driver installed in the information processing device, and first port information, and device information including, for each device, associated information related to the device and second port information, and has a function of, when called by an application program specifying one device queue, acquiring the first port information related to the specified device queue from the device queue information, acquiring the device information having the second port information corresponding to the acquired first port information, and transmitting data output from the application program to the device using the acquired device information, The above program is an acquisition process for acquiring the device information from the OS when called by a higher-level program; A determination process for determining a destination device based on the related information included in the device information acquired in the acquisition process; a transmission process of transmitting data output from the upper level program to the destination device determined in the determination process, using the device information related to the destination device.
2. The program according to claim 1, wherein the acquisition process is a process of acquiring, from the OS, the device information including the second port information corresponding to the first port information included in the device queue information, and the device information including the second port information that does not correspond to the first port information included in the device queue information.
3. 3. The program according to claim 1, wherein the acquisition process is a process of acquiring only the device information related to a device that is physically connected to the information processing device so as to be able to communicate with the information processing device.
4. The above program is causing the CPU to execute a receiving process for receiving device identification information from the upper program; A program as described in any one of claims 1 to 3, wherein in the determination process when information regarding a device identified by the identification information is included in the device information obtained from the OS, the device identified by the identification information is determined to be the destination device.
5. The above program is The program according to claim 4, wherein in the determination process when information regarding a device identified by the identification information is not included in the device information obtained from the OS, a device designation is accepted from a user, and the device designated by the user is determined to be the destination device.
6. 6. The program according to claim 1, wherein the acquisition process is a process of acquiring, from the OS, the device information relating to a device type designated by the upper level program.
7. the program causes the CPU to execute a determination process for determining a type of device based on data output from the upper program; 6. The program according to claim 1, wherein the acquisition process acquires, from the OS, the device information relating to the device of the type determined in the determination process.
8. the determination process may determine a plurality of the destination devices; A program as described in any one of claims 1 to 7, wherein the transmission process when multiple destination devices are determined in the determination process is a process of transmitting data output from the upper program to each of the multiple destination devices determined in the determination process.
9. The program described in claim 8, wherein the transmission process when multiple destination devices are determined in the determination process is a process of starting a process corresponding to each of the multiple destination devices and transmitting data output from the upper program for each of the started processes.
10. an installation process for installing the program according to any one of claims 1 to 9 and a device driver that calls the program as the upper level program in the information processing device; An addition process for adding a new port to the ports managed by the OS; an installation program that causes the CPU to execute a registration process of registering, in the device queue information, information relating to the device driver installed in the installation process and the first port information relating to the port added in the addition process;
11. A program according to any one of claims 1 to 9; a data generating program that generates data to be transmitted to a device and calls the program as the upper program.
12. A CPU, An information processing device including an OS, the OS stores device queue information including, for each device queue, device driver information, which is information related to a device driver installed in the information processing device, and first port information, and device information including, for each device, associated information related to the device and second port information, and has a function of, when called by an application program specifying one device queue, acquiring the first port information related to the specified device queue from the device queue information, acquiring the device information having the second port information corresponding to the acquired first port information, and transmitting data output from the application program to the device using the acquired device information, The CPU is an acquisition process of acquiring the device information from the OS in response to receiving an instruction to transmit data to the device; A determination process for determining a destination device based on the related information included in the device information acquired in the acquisition process; a transmission process of transmitting the data to the destination device determined in the determination process, using the device information related to the destination device.
13. A method executed on an information processing device having a CPU and an OS, the OS stores device queue information including, for each device queue, device driver information, which is information related to a device driver installed in the information processing device, and first port information, and device information including, for each device, associated information related to the device and second port information, and has a function of, when called by an application program specifying one device queue, acquiring the first port information related to the specified device queue from the device queue information, acquiring the device information having the second port information corresponding to the acquired first port information, and transmitting data output from the application program to the device using the acquired device information, The above method is an acquisition step of acquiring the device information from the OS in response to receiving an instruction to transmit data to the device; a determination step of determining a destination device based on the related information included in the device information acquired in the acquisition step; a transmitting step of transmitting said data to said destination device determined in said determining step using said device information relating to said destination device.
Citation Information
Patent Citations
Print system, server system, and job control method
JP2007200284A
Information processing program, information processor, and information processing method
JP2008027153A
Information processing apparatus and method of the same
JP2011076226A
Information processor, control method and program thereof
JP2016130970A
Information processing apparatus, control method, and program
JP2021022166A