แสดงบทความที่มีป้ายกำกับ printing แสดงบทความทั้งหมด
แสดงบทความที่มีป้ายกำกับ printing แสดงบทความทั้งหมด

๔/๑๒/๕๐

Buy a new printer or new catridge

My nephew's Lexmark inkjet printer X3350 AIO shows "unsupported catridge" last week. After search for a solution lately last night from Lexmark support website.

http://support.lexmark.com/cgi-perl/knowledgebase.cgi?ccs=213:1:0:480:0:0&framed=&docid=ENUS24097&relevance=1

The last answer is it requires a new genuine catridge, so next day I went to Pantip Plaza. But I did not get a new catridge, it costed about 1,400 baht(black + color). I have found that a new Lexmark X1270 price 1,590 baht, or with X1420 a new printer with WIFI at 1,990 baht, or pay only 1,190 baht less than the catridge for X3350 you can get a new Z1320.



With 1,xxx baht you can also choose other new inkjet printer as Canon, HP or Epson.

My decision is never use Lexmark anymore. Bye bye...

๖/๑๑/๕๐

DOS printing with USB printer

(ดูภาษาไทย พิมพ์ DOS ด้วยเครื่องพิมพ์ USB)

Most DOS programs use parallel port (LPT1:, LPT2: LPT3:) for printing only, can not support other port type as USB port (some new laser printers) or serial port (some model of POS printers). Although those printers can understand DOS printing commands.

In Windows we will make use of network redirector ability, capturing data from parallel port and send it to the network printer. A DOS program still prints to parallel port as usual, but all data will redirect to prefer network printer (include the network printer that directly connected at the machine).

There are 2 easy steps:
1. Setting the network printer by sharing the printer.
2. Capture parallel port and redirect to the network printer.

Setting the network printer.
If your computer has a valid network connection, simply share the printer. If your computer does not have any valid connection, you need to create a fake connection by adding loop back adapter.

Adding Microsoft loop back adapter
For standalone computer, Windows does not allow sharing the printer without a network connection. You can install the Loop Back Adapter to create network connection connects to itself.



> From Control Panel select "Add Hardware".
> Click Next at first page of wizard.
> Select "Yes", then click Next.
> Scroll down and select "Add a new hardware device" then click Next.
> Select "Install the hardware that I manually...", then click Next.
> Select "Network adapters" then click Next.
> Select "Microsoft" -> "Microsoft loop back adapter" then click Next.
> And Next, Next, ... until finish.

Don't forget to assign the IP address for loop back connection you created.
> In Control Panel select "Network Connections".
> Right click at the connection then select "Properties".
> Double click at "Internet protocol (TCP/IP)".
> Select choice "Use the following IP address".
> Fill a valid IP address number with sub net as 192.168.1.100 / 255.255.255.0

Sharing the printer
> In Control Panels select Printers and Faxes,
> then right click at the printer you want to share.
> Select Sharing in context menu.



> In printer properties page select Share this printer
> named your share printer for easy to remember.

Capture parallel port and redirect to the network printer.
Open Command Prompt window by doing this.
> From menu Start -> select Run -> type CMD in Open box.



In Command Prompt window
> Check the computer name by typing command
net view
> Check the printer name by typing
net view \\computername
> Redirect parellel port to network printer by typing
net use lpt1: \\computername\printername /persistence:yes

พิมพ์ DOS ด้วยเครื่องพิมพ์ USB

โปรแกรม DOS ส่วนใหญ่มักพิมพ์ออกทาง parallel port (LPT1:,LPT2:, LPT3:) ทำให้ไม่สามารถใช้กับเครื่องพิมพ์ที่เชื่อมต่อทางอื่น เช่น USB port (เครื่องพิมพ์ laser รุ่นใหม่ๆ)หรือ serial port (เครื่องพิมพ์สลิป POS - Point Of Sale) ถึงแม้ว่าเครื่องพิมพ์เหล่านั้น สามารถรับคำสั่งพิมพ์จาก DOS เหมือนกับเครื่องพิมพ์ parallel port ทั่วไป

ภายใต้ Windows เราสามารถใช้ประโยชน์จาก network redirector เพื่อดักข้อมูลที่ส่งพิมพ์ออกทาง parallel port ให้เปลี่ยนไปออกทาง network printer ที่เรากำหนด ด้วยวิธีนี้ ถึงแม้ว่า โปรแกรม DOS ยังคงส่งข้อมูลออกทาง parallel port เหมือนเดิม แต่ข้อมูลที่ส่งออกไป จะถูกเปลี่ยนทางให้ไปออกที่ network printer รวมถึง network printer
ต่อกับเครื่องคอมพิวเตอร์ตัวเองด้วย

ขั้นตอนการทำมี 2 ขั้นตอนง่าย ๆ ดังนี้
1. ตั้งเครื่องพิมพ์ที่ต่ออยู่ให้กลายเป็น network printer
2. ดักข้อมูลที่ออกทาง parallel port ให้ไปออกที่ network printer แทน

ตั้งเครื่องพิมพ์ให้กลายเป็น network printer
สำหรับคอมพิวเตอร์ที่ไม่มีการเชื่อมต่อ network ไม่สามารถตั้ง network printer ได้ เนื่องจากไม่มี network connection เราต้องติดตั้ง Loop Back Adapter เพื่อสร้างการเชื่อมต่อ network ภายในเครื่องเดียวกันเอง เพื่อให้ Windows ยอมให้เราตั้ง network printer

ติดตั้ง Microsoft loop back adapter
ถ้าคอมพิวเตอร์ของคุณมี network connection อยู่แล้ว คุณเพียงสั่งแชร์เครื่องพิมพ์ แต่ถ้าคอมพิวเตอร์ของคุณไม่มี connection คุณต้องสร้าง connection หลอกขึ้นมา โดยติดตั้ง loop back adapter



> ใน Control Panel เลือก Add Hardware เลือก Next
> ที่หน้าแรกของ wizard เลือก Yes แล้ว กด Next
> เลื่อนลงมาที่รายการด้านล่าง เลือก "Add a new hardware device" แล้วกด Next
> เลือก "Install the hardware that I manually..." แล้วกด Next
> เลือก "Network adapters" แล้วกด Next
> เลือก "Microsoft" -> "Microsoft loop back adapter" แล้วกด Next
> กด Next ต่อไปเรื่อยๆ จนเสร็จ

กำหนด IP address สำหรับ loop back connction ที่คุณสร้างขึ้นมา
> ใน Control Panel เลือก "Network Connections"
> ใช้เมาส์ปุ่มขวาที่ชื่อ connection นั้น แล้วเลือก "Properties"
> ดับเบิลคลิกที่ "Internet protocol (TCP/IP)"
> เลือกหัวข้อ "Use the following IP address"
> ใส่หมายเลข IP adress และ sub net เช่น 192.168.1.100 / 255.255.255.0

การแชร์เครื่องพิมพ์
> ใน Control Panels เปิด Printers and Faxes
> แล้วกดเมาส์ปุ่มขวาตรงเครื่องพิมพ์ ที่คุณต้องการ เลือก Sharing จากเมนู



> ในหน้า Printer properties ให้เลือก Share this printer
> ตั้งชื่อเรียก network printer นั้น ให้จดจำได้ง่าย

ดักข้อมูลที่ parallel port ให้ไปออกที่ network printer แทน

เปิดหน้าต่าง Command Prompt ดังนี้
> จากเมนู Start -> เลือก Run -> พิมพ์ CMD ลงในกล่อง Open



ในหน้าต่าง Command Prompt
> ดูชื่อคอมพิวเตอร์ โดยใช้คำสั่ง
net view
> ดูชื่อเครื่องพิมพ์ โดยใช้คำสั่ง
net view \\ชื่อคอมพิวเตอร์
> เปลี่ยนทางข้อมูลของ parallel port ไปที่ network printer โดยใช้คำสั่ง
net use lpt1: \\ชื่อคอมพิวเตอร์\ชื่อเครื่องพิมพ์ /persistent:yes


Some useful links
Microsoft NET service command
HOWTO: Print to a USB Printer from DOS in Windows XP
Printing from DOS with Windows 2000 or XP

๕/๑๑/๕๐

How to make DOS programs printing faster in Windows

ทำอย่างไรให้โปรแกรม DOS ภายใต้ Windows พิมพ์ได้เร็วขึ้น


Introduction: This article explains how to speed up printing from DOS to a DOS compatible printer on Windows.If you need to print from DOS to a Windows printer which is not DOS compatible, like a Windows-Only (GDI) USB printer or a virtual printer (WinFax, PDF writers, etc.), please see: How to print from DOS to Windows-Only printers.

บทความนี้ อธิบายวิธีที่ทำให้การพิมพ์จากโปรแกรม DOS ใน Windows ไปยังเครื่องพิมพ์ที่สามารถรับคำสั่ง DOS ได้โดยตรง ถ้าคุณต้องการพิมพ์จาก DOS ไปยังเครื่องพิมพ์ที่รับคำสั๋ง Windows อย่างเดียว เช่น GDI USB printer (inkjet printer) หรือ เครื่องพิมพ์เสมือนบน Windows เช่น WixFax, PDF writers จะต้องไปดูเรื่องของ วิธีการสั่งพิมพ์จาก DOS ไปยังเครื่องพิมพ์ของ Windows

The Problem: If you run a DOS application on NT-based Windows systems (Windows 2000, XP, 2003, Vista), you may find that your print jobs are spooled after many seconds, sometimes minutes, especially when printing to a network printer. It may even happen on Windows 95/98/ME machines.

ถ้าคุณใช้โปรแกรม DOS ภายใต้ระบบ Windows แบบ NT เช่น Windows 2000, XP, 2003, Vista มักมีปัญหาคือ เมื่อสั่งพิมพ์งานออกไปแล้ว จะต้องรออีกหลายวินาที บางครั้งอาจนานเป็นนาที โดยเฉพาะเมื่อส่งพิมพ์ไปยัง network printer บางครั้งปัญหานี้ ก็เกิดขึ้นเมื่อทำงานภายใต้ Windows 95/98/ME ด้วย

The problem has two main causes:
ปัญหาเกิดขึ้นจาก 2 สาเหตุ

  1. How the DOS program manages the printing device
    วิธีที่โปรแกรม DOS จัดการเครื่องพิมพ์
  2. How the DOS program uses the CPU on the machine
    วิธีที่โปรแกรม DOS ใช้ขีดความสามารถของ CPU

Managing the DOS printing device
การจัดการเครื่องพิมพ์ของ DOS

In the age of DOS, most of the printers were dot-matrix and connected to a parallel port (LPT1:, LPT2: or LPT3:)

ในยุคของ DOS เครื่องพิมพ์ส่วนใหญ่ เป็นแบบ dot-matrix
และต่อผ่าน parrallel port (LPT1:, LPT2: หรือ LPT3:)

A typical DOS program sends binary data (characters) to one of these ports (usually LPT1:). A dot matrix printer can start printing that data as soon as it's sent to the port and before all the data has been sent by the program.
โปรแกรมบน DOS ส่วนใหญ่ ข้อมูลตัวอักษรออกทาง port เหล่านี้ (มักจะใช้ LPT1:) และเครื่องพิมพ์ dot-matrix สามารถเริ่มพิมพ์ข้อมูลทันที ที่ได้รับข้อมูลทาง port นั้น โดยไม่ต้องรอให้โปรแกรมส่งข้อมูลที่จะพิมพ์จบ

A DOS programmer did not need to close the printing device (port) when the print job ended, because the printer had already finished its job.

ดังนั้นโปรแกรมเมอร์ที่เขียนโปรแกรมสมัยนั้น จึงไม่จำเป็น ส่งคำสั่งปิดงานพิมพ์ไปยังเครื่องพิมพ์ เมื่อส่งข้อมูลจบ

Under Windows things are different. Laser and other graphical printers need to receive an entire page before rendering it on paper. Additionally, multiple applications running/printing on the same machine introduced the need for a printing queue, especially with network printers.
So, if the DOS program does not close the printer port at the print job end, then Windows does not know the job is really finished. It waits for a timeout value to expire before deciding to finally spool the next job.
แต่เมื่อเราใช้งานภายใต้ Windows ผลที่ได้กลับแตกต่างออกไป
เพราะเครื่องพิมพ์เลเซอร์ และเครื่องพิมพ์ graphic จะเริ่มพิมพ์ต่อเมื่อได้รับข้อมูลครบหน้ากระดาษ ยิ่งไปกว่านั้นโปรแกรมบน Windows หลายตัวที่กำลังทำงานอยู่และต้องการพิมพ์ ก็ต้องใช้งานผ่าน print queue โดยเฉพาะเวลาส่งพิมพ์ไปยัง network printers ถ้าโปรแกรมบน DOS ไม่ส่งคำสั่งปิด printer port เมื่อจบงาน Windows ก็ไม่สามารถทราบได้ว่างานพิมพ์นั้นจบหรือยัง มันจะต้องรอรับข้อมูลที่โปรแกรม DOS ส่งมาพิมพ์ต่อไปอีกระยะหนึ่ง จนครบเวลา timeout ที่ตั้งเอาไว้ จึงปิดงานพิมพ์ของโปรแกรม DOS นั้น

If you're in this situation, you can close the DOS program as soon as it finishes printing. You'll see your print job start immediately because all the DOS handles will be closed by the Operating System itself, including the printer port.

ถ้าคุณเคยเจอปัญหาอย่างนี้ คุณสามารถสั่งปิดโปรแกรม DOS หลังจากที่โปรแกรมส่งข้อมูลที่จะพิมพ์จบแล้ว เพื่อให้เครื่องพิมพ์เริ่มพิมพ์ทันที เนื่องจาก port เครื่องพิมพ์บน DOS ถูกปิดอัตโนมัติเมื่อเราปิดโปรแกรม DOS

The best solution for this problem should be to fix the DOS program, if you are the original programmer. In further articles I'll show you how to do this with popular DOS programming languages, like Basic and Clipper.

การแก้ปัญหาดีที่สุดคือ แก้โปรแกรม DOS ถ้าคุณเป็นผู้เขียนโปรแกรมนั้นเอง แต่ถ้าคุณไม่สามารถแก้ไขโปรแกรมได้ ก็คงต้องแก้ปัญหาโดยวิธีอื่น ตามที่จะแนะนำต่อไป

If you're not a programmer, you can change the Windows timer above, to make the delay shorter. Do not set the value too low or the printer could start printing before the DOS program has really finished creating the job.

ถ้าคุณไม่ใช่โปรแกรมเมอร์ คุณสามารถตั้งค่า timeout ใหม่ ให้น้อยกว่าเดิม แต่ต้องระวังอย่าตั้งค่าน้อยเกินไป จนเครื่องพิมพ์เริ่มพิมพ์ก่อนที่โปรแกรมจะส่งงานพิมพ์นั้นออกไปเสร็จ

1) If you're running an NT based Windows system (2000, XP, Vista)
The timeout value is stored into a Registry entry. TAKE CARE using RegEdit. It could be rather dangerous. If you'll perform the wrong actions, your machine could even refuse to reboot.

สำหรับ Windows ที่ใช้ระบบ NT (2000,XP,Vista) ค่า timeout อยู่ใน Registry เราต้องใช้คำสั่ง RegEdit ระวัง ถ้าคุณเข้าไปแก้ไขผิดที่ อาจทำให้เครื่องคอมพิวเตอร์ของคุณ ไม่สามารถทำงานได้เมื่อ restart ใหม่
  • In REGEDIT ( START -> RUN -> REGEDIT )
    click :
    HKey_Local_Machine
    then click :
    System
    then click :
    CurrentControlSet
    then click :
    Control
    then click : WOW
Here you'll find the LPT_timeout property. Double clicking the value you can choose how many seconds you prefer, then reboot your machine to apply the change.
เมื่อเปิดเข้าไปใน WOW คุณจะเห็นชื่อ LPT_timeout ให้ double click ตรงค่าของมัน เพื่อเข้าไปแก้ให้เป็นค่าวินาที ที่ต้องการ เมื่อแก้ไขเสร็จแล้ว คุณต้องสั่ง restart เครื่องเพื่อให้ Windows ใช้ค่าที่กำหนดใหม่นั้น

2) If you're runnign an older Windows OS (9x/ME)
Search your C drive for the SYSTEM.INI file and open it with NOTEPAD (don't use Ms-Word or other word processors). In the [386enh] section search [Network] if it does not exist enter the following:

ถ้าคุณใช้ Windows รุ่นเก่า (9x/ME) ให้ใช้โปรแกรม NOTEPAD เปิดไฟล์ที่ชื่อ SYSTEM.INI ที่อยู่ใน drive C แล้วค้นหา บรรทัดที่มีคำว่า [386enh] แล้วหาบรรทัด [Network] ที่อยู่ภายใต้มัน หรือถ้าไม่พบ ให้เพิ่มบรรทัดตามตัวอย่างต่อไปนี้ลงไป
  • [Network]
    PrintBufTime=10
    [IFSMGR]
    PrintBufTime=10

This will set the timeout to 10 seconds. Reboot your machine to apply the changes.

คำสั่งนี้ เป็นการตั้งค่า timeout เท่ากับ 10 วินาที เสร็จแล้วให้ restart เครื่องเพื่อให้ Windows ใช้ค่าที่ตั้งใหม่ในการทำงาน
DOS CPU usage
การใช้ขีดความสามารถ CPU ของ DOS

Unlike Windows, MS-DOS was a single-user operating system. You could only run a single program at a time, which could even keep the entire CPU for itself, to work as fast as possible.
This causes a common problem for DOS programs running on recent Windows machines: the CPU hogging.
ข้อแตกต่างระหว่าง Windows กับ DOS คือ DOS สามารถเรียกโปรแกรมใช้งานทีละโปรแกรม ดังนั้น DOS จึงใช้ขีดความสามารถทั้งหมดของ CPU เพื่อให้ทำงานได้เร็วที่สุด และนี่คือปัญหาที่ทำให้โปรแกรมบน DOS หลายตัวเมื่อนำมาใช้งานภายใต้ Windows จะเกิดปัญหา การทำงานสะดุด ไม่ลื่นไหลเหมือนกับการทำงานบน DOS
Typically, when polling the keyboard (during a wait state), the DOS program performs an infinite loop, to check it as fast as possible. In DOS this did not cause any troubles at all, but on Windows, the system might be so "busy" that no other tasks can be performed (including the print spooling process, which usually starts when the DOS program has finished printing and is waiting for user input, typically on a menu).
กล่าวคือ ในระหว่างที่รอรับการกด keyboard จากผู้ใช้ โปรแกรมบน DOS จะวนรอเพื่อตรวจสอบการกด keyboard ตลอดเวลา แต่สำหรับใน Windows การทำงานดังกล่าว มีผลให้ระบบ ไม่สามารถแบ่งเวลาของ CPU ระหว่างที่รอรับ keyboard ไปให้โปรแกรมหรือการทำงานอื่นๆ ที่รออยู่ รวมทั้ง print spooler ของ Windows ที่รับข้อมูลจากโปรแกรม DOS มาส่งพิมพ์ ก็ไม่สามารถทำการประมวลผลได้เช่นกัน

To check if your own DOS program is actually hogging the CPU, please try to leave the Task Manager opened while it's on execution.

การตรวจสอบว่าโปรแกรม DOS นั้นกินเวลาของ CPU มากแค่ไหน สามารถดูได้จาก Task Manager ระหว่างที่เรียกใช้โปรแกรม DOS นั้น ดังนี้
  • Press CTRL+ALT+DEL
    Click the "Performance" tab

If the CPU usage often go to 100 percent while using your DOS program, then you're experiencing this problem.

ถ้าการทำงานของ CPU ขึ้นเป็น 100% ระหว่างที่เรียกใช้โปรแกรม DOS แสดงว่าเกิดปัญหานี้ขึ้นแล้ว
A DOS programmer cannot do much for this problem because the keyboard polling routine is usually implemented in a low level routine inside the DOS compiler itself. Fortunately some patches has been released for popular DOS compilers to include a "release CPU" command inside that loop.
สำหร้บโปรแกรมเมอร์ผู้เขียนโปรแกรม DOS เอง สามารถแก้ปัญหานี้ได้ง่ายกว่า โดยการปรับโปรแกรมในส่วนของ loop ที่รอรับ keyboard หรือถ้าสามารถ compile โปรแกรมใหม่ โดยใช้ compiler รุ่นใหม่ ที่มี option ที่สั่งให้ release CPU ภายใน loop รอรับ keyboard ให้เลือกอยู่แล้ว ก็เพียงแค่สั่ง compile โปรแกรมใหม่เท่านั้น
You can find some of the DOS 100% CPU patches at the Citrix website.
If the solutions in the page above does not apply to you, you may want to try TameDOS as a replacement for the Windows Command Prompt, which is supposed to solve this problem.
คุณสามารถหาโปรแกรมเล็ก ๆ ที่ใช้แก้ปัญหา 100% CPU จากเว็บของ Citrix หรืออาจลองใช้โปรแกรม TameDOS แทน Windows Command Prompt เดิมก็ได้

original article http://www.amazines.com/Software/article_detail.cfm/329253?articleid=329253

Google