Home Forums HTBasic Forum HTBasic 2021 LPT printer

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #9312
    Bert Weusten
    Participant

      We were using HTBasic 9.3 and Windows XP, I checked the pooling box and added LPT1 with my printer.
      Originaly the programs were created in HP Basic, back in 1992.

      Recently we transfered to HTBasic 2021 and Windows 11.
      Now we can’t get the programs to print.
      The code sends the print data to LPT 26.

      What is the fix for this problem?

      #9313
      Ralph Wilson
      Keymaster

        Hi Bert,

        There are two things that you may need to do to fix this.

        First, if you are accessing a network printer, you need to map it to lpt1 with NET USE. If the printer is on another computer, you will need the password of a user on that computer so that you have permission to execute this as follows:

        NET USE LPT1: \\computer_name\printer_name /PERSISTENT:YES /USER:userid thePassword

        This user does not have to be logged in, but simply exist.

        Second, since you are now on a new computer/OS, the default setting for the printer may need to be changed in Properties/Advanced with the option “Print directly to the printer” vs “Spool print documents…”.

        If you are still having problems with these settings, a possible workaround is the following:

        In your program, direct your output to a file instead of lpt1 (ISC 26). Then, when you are ready to print the file, use:

        EXECUTE "start /min notepad /p "&Path$&File$ ! where Path$ is the folder path to your file and File$ is the name of the file

        Alternately, if you are actually printing to lpt1, you could try:

        EXECUTE "print /d:lpt1 "&Path$&File$ ! since lpt1 is the default, you can omit /d:lpt1

        Or, if printing to a network printer named “printer1” on a computer named “copyroom”:

        EXECUTE "print /d:\\copyroom\printer1 "&Path$&File$

        Note: In the above examples, a command line window is opened by EXECUTE that you will have to manually close.

        Let us know if any of this helps.

        Ralph

        #9314
        Ralph R
        Participant

          Hi Ralph/Bert,

          Yes, some of this helps, but you need more background on our situation. We are experiencing these issues regarding LPT1 only under Windows 11 using HTB 2021.1.015 and have tried several paths to troubleshoot the issue, some you have suggested- more details in a moment. The previous combination was using either HTB 2021, HTB 10.1 or HTB 8.3 under Windows 7 without any issues with regard to printing on LPT1. All of our 50-60 very large software packages were using an HP dot printer at address 701 many years ago. We easily converted to address ISC26 with minimal changes and kept all the embedded PCL scripting that formats the pages. From Windows XP up through Windows 7, the printers were connected to the parallel port and worked well. Since enterprise printers stopped supporting parallel ports, we migrated to network printers. Again, while under XP through Win7, we have either used utilities to capture the LPT1 port or the NET USE command to redirect the output to a network print queue as you have described in the previous post.

          Since migrating to Windows 11, we have been unable to find a stable combination. We have tried the following:

          – Creating virtual LPT1, LPT2, LPT3 and LPT4 ports without making any difference in correcting the problem.

          – “NET USE” capturing the LPT port does not work under Win11 for HTB.
          Nothing goes to the printer from HTB using the “OUTPUT 26” command during program execution.
          Under Win11, files can be copied to NET USE captured LPTx port from a command prompt and do print, but nothing from HTB 2021
          LPT2, 3, 4 have all been tested and do not work. The CONTROL statements within HTB were used to change the LPTx without success

          – changing the properties/advanced options for a printer is irrelevant because ISC26 is a direct connection to the printer bypassing the Win print queue

          – using the windows print queue (default ISC 10) is not an option if you are sending PCL commands directly. This will strip the commands
          and hold pages in queue without printing. Again, formatting would require a complete rewrite which would take months.

          – We have used the National Instruments VISA driver to create a TCP direct socket to a printer using PORT 9100. Then, under HTB 2021 have
          loaded a VISA driver to ‘talk’ to the socket directly. This works for a period of time and then just stops. It will recover if
          the HTB Program itself is completely closed and then restarted under Win11. While this seems like the most viable option for us, we
          cannot seem to trace out why it only works for a period of time? Seems like HTB is cause. Adjusting parameters under the VISA
          load timeouts seems to not make any difference.

          We are aware of the options that you have presented regarding printing to a file and sending each output to the printer. The way our software is structured would require a significant amount of rewrite to make that work. We need each page as it is filled or if a process is aborted. We cannot wait until the end to print everything, so it must be done in real time page by page. While this is possible, it would require heavy editing as I have described. When you look at the fact we have 50-60 large packages which are not the same, this is a daunting task.

          Have you tested HTB 2021 under Windows 11 and had success printing to ISC26? Are there any suggestions on what could be causing the VISA
          driver timeout?

          Thanks, Ralph R.-

          • This reply was modified 1 month, 1 week ago by Ralph R.
          #9316
          Seth Ackerman
          Participant

            Hi Ralph W. – Based on the additional details provided above, did you have any further suggestions we might be able to try to resolve our Win11/HTB2021 LPT1 printing issue with our existing code? NET USE LPT1 was implemented and didn’t resolve the issue. Also, confirmed that the printer pooling setting was checked under printer port settings. It doesn’t appear to be a permissions issue either, as we get the same error when logged in as an administrator.
            Thanks, Seth A.

            #9317
            RalphW
            Participant

              We have confirmed there is an issue on Win 11 and are looking into it. Hope to have a better answer for you in a few days.

              #9318
              Ralph Wilson
              Keymaster

                I think we have a fix for this. If you can email me at htbsupport@transera.com, I’ll send you a link.

                #9319
                Seth Ackerman
                Participant

                  Great news! I sent an email reply to htbsupport@transera.com, requesting the link.

                Viewing 7 posts - 1 through 7 (of 7 total)
                • You must be logged in to reply to this topic.
                Scroll to Top
                HTB icon

                Please Sign In