Epson TM-T20II-i Server Direct Print Users Manual for TM-i firmware ver.4.1 - Page 45

Status Notification, Refer to the programming below. File name: Test_status.php

Page 45 highlights

Chapter 4 Status Notification Program Example Refer to the programming below. (File name: Test_status.php)

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48

45
Chapter 4
Status Notification
4
Program Example
Refer to the programming below. (File name: Test_status.php)
<?php
header('Content-Type: text/xml; charset=UTF-8');
# Open the file to save status.
$fhandle = @fopen("ResultStatus.log", "wt");
# Update the printer status.
if (isset($_POST["Status"])) {
$status =
$_POST["Status"];
}
$xml = simplexml_load_string($status);
foreach ($xml->printerstatus as $printerstatus) {
$asb = hexdec($printerstatus['asbstatus']);
$strmsg = "";
if (($asb & 0x00000001) == 0x00000001)
{
$strmsg .= "
No TM printer response\n";
}
if (($asb & 0x00000002) == 0x00000002)
{
$strmsg .= "
Print completed \n";
}
if (($asb & 0x00000004) == 0x00000004)
{
$strmsg .= "
Status of the drawer kick number 3 connector pin\n";
}
if (($asb & 0x00000008) == 0x00000008)
{
$strmsg .= "
Offline status \n";
}
if (($asb & 0x00000020) == 0x00000020)
{
$strmsg .= "
Cover is open \n";
}
if (($asb & 0x00000040) == 0x00000040)
{
$strmsg .= "
During paper feeding by pressing paper feed switch \n";
}
if (($asb & 0x00000100) == 0x00000100)
{
$strmsg .= "
Waiting for online recovery \n";
}
if (($asb & 0x00000200) == 0x00000200)
{
$strmsg .="
Paper feed switch is being pressed (ON) \n";
}
if (($asb & 0x00000400) == 0x00000400)
{
$strmsg .= "
Mechanical error generated \n";
}
if (($asb & 0x00000800) == 0x00000800)
{
$strmsg .= "
Auto cutter error generated \n";
}