3 Replies Latest reply on Nov 11, 2013 12:46 PM by philmodjunk

    Printing loop



      Printing loop



      Operating system version


      Description of the issue

      We have a remote desktop setup that allows us to dial into a desktop and control that instead of fmnet over the web. (speed)
      The down side of this setup is being able to print. We can redirect normal printers over remote but our users have receipt and label printers as well. The remote desktop can not handle that too well.

      We had a solution. We can remote into the desktop but also have a print spooler running locally on the system. A simple file that has a loop set to go out and check the hosted files for any jobs. If it gets one it can print to the local printer with all the settings it needs. Pretty simple and seems to work for the most part.

      The issue is that the simple loop seems to stop at random. When this happens it takes the user some time to spot there is an issue and most of the time a simple restart of the software seems to fix it.

      Steps to reproduce the problem

      Loop works for a while and catches the jobs it needs to do just fine. Then at random it will just stop the loop and be sitting there. No pattern on what job or anything. Sometimes just in the middle of 2 jobs to the same printer. Sometimes different printers. We have even seen it quit after doing about 8 jobs then sitting for about 20min. User came back and it was not running the loop.

      Expected result

      We want it to keep looping no matter what. Nothing should make it just stop without any error letting us know why.

      Actual result

      The never-ending loop ends.

      Exact text of any error message(s) that appear

      None being captured or shown

      Configuration information

      This setup allows one session to write the log of what needs to print. The looping session just goes out grabs the records that are ready, prints them to the printers needed, and then pauses for 10 sec to run again.


      We have tried flush cache in the loop to just clean it out but it seemed to take too long to the point the user would think it is not in the loop and just restart.

        • 1. Re: Printing loop

               Please describe this "loop" in more detail. Is this a looping script? If so, a post of the actual script may be helpful.

               Other ways to periodically perform a script:

               InstallOnTimer Script

               Server scheduled script

               Robot file

          • 2. Re: Printing loop

                 Here is the loop on the server side. We set the client up with a file to just open this server file and run this. That preform script is in its own loop. All the print scripts just find that stations ID and sees what records are not marked as printed. Then a page setup and print. Each script just does a different page setup and different printer. Nothing else is done in scipts deeper than this.

                 We have tried the ontimer script and were it seemed to get lost more than the loop. Not sure if anything can be done server side to print to remote systems. The setup we have is kinda like a robot file but it need to keep going by itself.

                 Hope this helps as I have been going insane trying to find what could stop the loop. 

            Client side - Loop
                 open printing file on server and preform script.
                 Global Setting Scripts: printJobber
                 Go to Layout [ “printLog” (printLog) ]
                 Enter Find Mode [ ]
                 Set Field [ printLog::printed ; "=" ]
                 Set Field [ printLog::workstation ; "==" & $$workstationName ]
                 Perform Find [ ]
                 If [ Get (FoundCount) > 0 ]
                 Go to Record/Request/Page
                 [ First ]
                    Set Variable [ $job; Value:printLog::type ]
                    Set Variable [ $id; Value:printLog::id ]
                    If [ $job = "receipt" ]
                    Perform Script [ “Print Receipt” ; Parameter: $id & "¶" & 1 ]
                    End If
                    If [ $job = "guest check" ]
                    Perform Script [ “Print Guest Check” ; Parameter: $id ]
                    End If
                    If [ $job = "gift receipt" ]
                    Perform Script [ “Print Gift Receipt” ; Parameter: $id ]
                    End If
                    If [ $job = "gift certificate" ]
                    Perform Script [ “Print Gift Certificate” ; Parameter: $id ]
                    End If
                    If [ $job = "supply list" ]
                    Perform Script [ “Print Consignment Receipt ” ; Parameter: $id ]
                    End If
                    If [ $job = "consignment contract" ]
                    Perform Script [ “printConsignmentContract” ; Parameter: printLog::msg ]
                    End If
                    If [ //$job = "inventory label"
                    PatternCount ( $job ; "label" ) >= 1 ]
                    Perform Script [ “Print Label” ; Parameter: $id ]
                    End If
                    If [ $job = "cc auth slip" ]
                    Perform Script [ “Print Credit Card Auth Slip” ; Parameter: $id ]
                    End If
                    If [ $job = "till pmt totals" ]
                    Perform Script [ “Print Till Pmt Totals” ; Parameter: $id ]
                    End If
                    If [ $job = "till pmt details" ]
                    Perform Script [ “Print Till Pmt Details” ; Parameter: $id ]
                    End If
                    If [ $job = "pop" ]
                    Perform Script [ “Print PopDrawer” ; Parameter: $id ]
                    November 11, 2013 14:14:17 paygo_printing.fmp12 - printJobber -1-
                    Global Setting Scripts: printJobber
                    End If
                    Go to Layout [ “printLog” (printLog) ]
                    Set Field [ printLog::printed ; thyTimeStamper ( $$param_time_zone ) ]
                    Go to Record/Request/Page
                    [ Next; Exit after last ]
                 End Loop
                 End If
                 Go to Layout [ “Blank Window” (Printing_Interface) ]
                 November 11, 2013 14:14:17 paygo_printing.fmp12 - printJobber -2-
            Client - pause 10sec
            Client end loop
            • 3. Re: Printing loop

                   An InstallOnTimer Script would seem a simpler option than the outer loop documented in Bold Face in your script listing.

                   Looking for a looking for a "failure point" where something might cause this system to fail draws my attention to this Step in your script:

                   Set Field [ printLog::workstation ; "==" & $$workstationName ]

                   Have you tried setting something up so that when this mysteriously stops working, a quick check of the values in the variable and the field can be made?

                   If something happens, for example, that clears/changes the value in the global variable or if something on the client's session fails to enter correct data into the workstation field, your script will fail to find the records for your print jobs.

                   And closing/re-opening the file could very well restore the value of the global variable--which also seems consistent with what you are describing.