Resource temporarily unavailable

Post

Posted
Rating:
#1 (In Topic #957)
Enthusiast
AndyGable is in the usergroup ‘Enthusiast’
Hi Everyone

I hope someone can help

I am trying to print a End of day report to my Point of sale Printer but I keep getting "Resource temporarily unavailable" while it is printing

This is what I am using to print to the printer

Code (gambas)

  1. Private Sub PrintOnPrinter(DataToPrint As String)
  2.     Dim LineData As String
  3.     Dim TempDataPrint As String = Null
  4.     Dim i As Integer = 0
  5.    
  6.     Print Global.LineCount
  7.    
  8.     If Global.LineCount > 100 Then
  9.         Global.DataReadIn = Split(DataToPrint, "~")
  10.        
  11.         For Each LineData In Global.DataReadIn
  12.             TempDataPrint &= LineData & PrinterNewLine
  13.             i += 1
  14.    
  15.        If i = 10 Then
  16.                 Try Write #Global.PrinterPort, TempDataPrint
  17.                 Global.PrinterPort.Send  
  18.                  i = 0
  19.                 TempDataPrint = Null
  20.             End If
  21.         Next        
  22.     Else
  23.         Try Write #Global.PrinterPort, DataToPrint
  24.         Global.PrinterPort.Send  
  25.     End If
  26.    
  27.     Feed_CutPaper(Global.LinesToFeed)
  28.  

What I am trying todo is get 100 lines Ready to be sent to the printer and then send them and then wait 0.1 second and send another 100 or what ever is remaining but I can not get that to work (as you can see I have been trying to only send 10 lines at a time but nothing is working am i not working spliting the data correct? (it ends with a ~)

anything under 100 lines are printing with no issues. The report is 142 lines

Below is the dump from my PoS appliation to the Printer module

Code (gambas)

  1. <PIPE>L<PIPE>1--------------------------------------------------------~
  2. <PIPE>C<PIPE>B4END OF DAY~
  3. <PIPE>C<PIPE>B1WEDNESDAY~
  4. <PIPE>L<PIPE>1--------------------------------------------------------~
  5. <PIPE>L<PIPE>1Cash in drawer~
  6. <PIPE>L<PIPE>1~<PIPE>L<PIPE>B3Notes~
  7. <PIPE>L<PIPE>1--------------------------------------------------------~
  8. <PIPE>L<PIPE>B1VALUE              QTY              TOTAL~
  9. <PIPE>L<PIPE>B1 £5.00              0               £0.00~
  10. <PIPE>L<PIPE>B1£10.00              0               £0.00~
  11. <PIPE>L<PIPE>B1£20.00              0               £0.00~
  12. <PIPE>L<PIPE>B1£50.00              0               £0.00~
  13. <PIPE>L<PIPE>1--------------------------------------------------------~
  14. <PIPE>R<PIPE>B3Note Total £0.00 ~
  15. <PIPE>L<PIPE>1~<PIPE>L<PIPE>B3Coins~
  16. <PIPE>L<PIPE>1--------------------------------------------------------~
  17. <PIPE>L<PIPE>B1VALUE              QTY              TOTAL~
  18. <PIPE>L<PIPE>B1 £2.00              0               £0.00~
  19. <PIPE>L<PIPE>B1 £1.00              0               £0.00~
  20. <PIPE>L<PIPE>B1 £0.50              0               £0.00~
  21. <PIPE>L<PIPE>B1 £0.20              0               £0.00~
  22. <PIPE>L<PIPE>B1 £0.10              0               £0.00~
  23. <PIPE>L<PIPE>B1 £0.05              0               £0.00~
  24. <PIPE>L<PIPE>B1 £0.02              0               £0.00~
  25. <PIPE>L<PIPE>B1 £0.01              0               £0.00~
  26. <PIPE>L<PIPE>1--------------------------------------------------------~
  27. <PIPE>R<PIPE>B3Coin Total £0.00 ~
  28. <PIPE>L<PIPE>1~
  29. <PIPE>L<PIPE>B3Tender Summary~
  30. <PIPE>L<PIPE>1--------------------------------------------------------~<PIPE>
  31. R<PIPE>B1User Total £0.00 ~
  32. <PIPE>R<PIPE>B1SYSTEM Cash in Draw £0.00 ~
  33. <PIPE>L<PIPE>1~<PIPE>R<PIPE>B1SYSTEM TOTAL £0.00 ~
  34. <PIPE>L<PIPE>1~<PIPE>C<PIPE>B4Cash drawer~
  35. <PIPE>C<PIPE>B4Balanaced~
  36. <PIPE>L<PIPE>1~
  37. <PIPE>L<PIPE>B3Lottery Summary~
  38. <PIPE>L<PIPE>1--------------------------------------------------------
  39. ~<PIPE>C<PIPE>1** THIS REPORT IS ONLY FOR THIS TERMINAL **~
  40. <PIPE>L<PIPE>B1  NATIONAL LOTTERY                  £0.00~
  41. <PIPE>L<PIPE>B1     EURO MILLIONS                  £0.00~
  42. <PIPE>L<PIPE>B1      SET FOR LIFE                  £0.00~
  43. <PIPE>L<PIPE>B1       THUNDERBALL                  £0.00~
  44. <PIPE>L<PIPE>B1   LOTTO HOT PICKS                  £0.00~
  45. <PIPE>L<PIPE>1~<PIPE>L<PIPE>B1      SCRACH CARDS                  £0.00~
  46. <PIPE>L<PIPE>1--------------------------------------------------------~<PIPE>
  47. R<PIPE>B3Lottery Total £0.00 ~
  48. <PIPE>L<PIPE>B3PoS Summary~
  49. <PIPE>L<PIPE>1--------------------------------------------------------~
  50. <PIPE>L<PIPE>1~
  51. <PIPE>L<PIPE>B3Sales~
  52. <PIPE>L<PIPE>1--------------------------------------------------------~
  53. <PIPE>L<PIPE>B1TENDER TYPE                         TOTAL~
  54. <PIPE>L<PIPE>B1              CASH                  £0.00~
  55. <PIPE>L<PIPE>B1              CARD                  £0.00~
  56. <PIPE>L<PIPE>B1           COUPONS                  £0.00~
  57. <PIPE>L<PIPE>B1        GIFT CARDS                  £0.00~
  58. <PIPE>L<PIPE>B1     GIFT VOUCHERS                  £0.00~
  59. <PIPE>L<PIPE>B1            CHEQUE                  £0.00~
  60. <PIPE>L<PIPE>B1        ON ACCOUNT                  £0.00~
  61. <PIPE>L<PIPE>1--------------------------------------------------------~
  62. <PIPE>R<PIPE>B3Sales Total £0.00 ~
  63. <PIPE>L<PIPE>1~
  64. <PIPE>L<PIPE>B3Refunds~
  65. <PIPE>L<PIPE>1--------------------------------------------------------~
  66. <PIPE>L<PIPE>B1TENDER TYPE                         TOTAL~
  67. <PIPE>L<PIPE>B1              CASH                  £0.00~
  68. <PIPE>L<PIPE>B1              CARD                  £0.00~
  69. <PIPE>L<PIPE>B1           COUPONS                  £0.00~
  70. <PIPE>L<PIPE>B1        GIFT CARDS                  £0.00~
  71. <PIPE>L<PIPE>B1     GIFT VOUCHERS                  £0.00~
  72. <PIPE>L<PIPE>B1            CHEQUE                  £0.00~
  73. <PIPE>L<PIPE>B1        ON ACCOUNT                  £0.00~
  74. <PIPE>L<PIPE>1--------------------------------------------------------~
  75. <PIPE>R<PIPE>B3Refunds Total £0.00 ~
  76. <PIPE>L<PIPE>1~
  77. <PIPE>L<PIPE>B3Float Summary~
  78. <PIPE>L<PIPE>1--------------------------------------------------------~
  79. <PIPE>L<PIPE>B1          FLOAT IN                  £0.00~
  80. <PIPE>L<PIPE>B1         FLOAT OUT                  £0.00~
  81. <PIPE>L<PIPE>1--------------------------------------------------------~
  82. <PIPE>R<PIPE>B3Differance  £0.00 ~
  83. <PIPE>L<PIPE>1~<PIPE>L<PIPE>B3PoS Summary~
  84. <PIPE>L<PIPE>1--------------------------------------------------------~
  85. <PIPE>L<PIPE>B1    CUSTOMER COUNT                      0 ~
  86. <PIPE>L<PIPE>B1     NO SALE COUNT                      0 ~
  87. <PIPE>L<PIPE>B1 TOTAL VOIDS COUNT                      0 ~
  88. <PIPE>L<PIPE>B1 TOTAL VOIDS VALUE                  £0.00~
  89. <PIPE>L<PIPE>1~
  90. <PIPE>L<PIPE>B1   SAFE DROP VALUE                  £0.00~
  91. <PIPE>L<PIPE>1~
  92. <PIPE>L<PIPE>B3Terminal Total~
  93. <PIPE>L<PIPE>1--------------------------------------------------------~
  94. <PIPE>R<PIPE>B4£0.00~
  95. <PIPE>L<PIPE>1
  96. ~<PIPE>L<PIPE>B3Safe Drop Summary~
  97. <PIPE>L<PIPE>1--------------------------------------------------------~
  98. <PIPE>L<PIPE>1~
  99. <PIPE>L<PIPE>B1Drop Date : 10/09/2022~
  100. <PIPE>L<PIPE>120:42 1105 Andrew                                 £100.00~
  101. <PIPE>L<PIPE>120:42 1105 Andrew                                 £100.00~
  102. <PIPE>L<PIPE>B1Drop Date : 11/09/2022~
  103. <PIPE>L<PIPE>120:30 1105 Andrew                                 £100.00~
  104. <PIPE>L<PIPE>B1Drop Date : 07/10/2022~
  105. <PIPE>L<PIPE>110:03 1105 Andrew                                 £100.00~
  106. <PIPE>L<PIPE>B1Drop Date : 13/10/2022~
  107. <PIPE>L<PIPE>122:47 1105 Andrew                                 £100.00~
  108. <PIPE>L<PIPE>B1Drop Date : 17/10/2022~
  109. <PIPE>L<PIPE>116:33 1105 Andrew                                 £100.00~
  110. <PIPE>L<PIPE>B1Drop Date : 23/10/2022~
  111. <PIPE>L<PIPE>121:44 1105 Andrew                                 £100.00~
  112. <PIPE>L<PIPE>B1Drop Date : 26/10/2022~
  113. <PIPE>L<PIPE>109:16 1105 Andrew                                 £100.00~
  114. <PIPE>L<PIPE>B1Drop Date : 31/10/2022~
  115. <PIPE>L<PIPE>119:32 1105 Andrew                                 £100.00~
  116. <PIPE>L<PIPE>B1Drop Date : 01/11/2022~
  117. <PIPE>L<PIPE>116:09 1105 Andrew                                 £100.00~
  118. <PIPE>L<PIPE>B1Drop Date : 03/11/2022~
  119. <PIPE>L<PIPE>122:21 1105 Andrew                                 £100.00~
  120. <PIPE>L<PIPE>B1Drop Date : 05/11/2022~
  121. <PIPE>L<PIPE>118:15 1105 Andrew                                 £100.00~
  122. <PIPE>L<PIPE>B1Drop Date : 06/11/2022~
  123. <PIPE>L<PIPE>117:37 1105 Andrew                                  £10.00~
  124. <PIPE>L<PIPE>117:37 1105 Andrew                                  £10.00~
  125. <PIPE>L<PIPE>B1Drop Date : 13/11/2022~
  126. <PIPE>L<PIPE>119:26 1105 Andrew                                 £100.00~
  127. <PIPE>L<PIPE>B1Drop Date : 28/11/2022~
  128. <PIPE>L<PIPE>115:02 1105 Andrew                                 £100.00~
  129. <PIPE>L<PIPE>B1Drop Date : 30/11/2022~
  130. <PIPE>L<PIPE>113:29 1105 Andrew                                 £100.00~
  131. <PIPE>L<PIPE>1--------------------------------------------------------~
  132. <PIPE>L<PIPE>30 Drop(s)                                   Total £0.00~
  133. <PIPE>L<PIPE>1--------------------------------------------------------~
  134. <PIPE>C<PIPE>B1Wednesday 14 December 2022~
  135. <PIPE>C<PIPE>B120:05  000445  1105  001  0000~
  136.  
Online now: No Back to the top
1 guest and 0 members have just viewed this.