150 likes | 330 Views
Plus Series DLL Introduction. DLL Compare for Plus Series. API List I. API List II. EZ2000 DLL Flow Chart. Begin. isready unnecessary. openport parameter : 0~6 6 is USB. sendcommand (or more API). setbaurdrate ( serial port only ). closeport. End. EZWeb DLL Flow Chart. Begin.
E N D
EZ2000 DLL Flow Chart Begin isready unnecessary openport parameter : 0~6 6 is USB sendcommand (or more API) setbaurdrate (serial port only) closeport End
EZWeb DLL Flow Chart Begin sendcommand (or more API) openport parameter : printer name in [control panel] [printers] endjob closeport beginjob End
FoxPro 5.0 for Windows 95 * PROGRAM FILE NAME :EZTT.PRG path="C:\EZ2\WIN95\EZTT95.DLL" declare mb[10] value=0 i=0 j=0 for i=1 to 10 mb[i]=0 next SET LIBRARY TO c:\vfp\foxtools.fll ADDITIVE mb [1]= RegFn32("openport","C","",path) mb [2] = RegFn32("setup","IIIIII","",path) mb [3] = RegFn32("closeport","","",path) mb [4] = RegFn32("sendcommand","C","",path) mb [5] = RegFn32("intloadimage","CCC","",path) mb [6] = RegFn32("extloadimage","CCC","",path) mb [7] = RegFn32("isready","","I",path) for j=1 to 7 if mb[j]= -1 RELEASE LIBRARY C:\vfp\FoxTools.FLL WAIT WINDOW "FAILURE!!" NOWAIT RETURN endif next value = CallFn(mb[7]) if value=1 = CallFn(mb[1],"0") = CallFn(mb[2],75,5,2,0,3,0) = CallFn(mb[4],"^P2") = CallFn(mb[5],"aeer.pcx","aeer","pcx") = CallFn(mb[4],"^L") = CallFn(mb[4],"BA,40,40,2,4,25,0,1,12345") = CallFn(mb[4],"Y40,100,aeer") = CallFn(mb[4],"E") else wait windows "PRINTER ERROR" nowait endif RELEASE LIBRARY C:\vfp\FoxTools.FLL
Visual Basic 4.0 Private Declare Sub openport Lib "c:\ez2\win31\eztt.dll" (ByVal no$) Private Declare Sub setup Lib "c:\ez2\win31\eztt.dll" (ByVal a%, ByVal b%, ByVal c%, ByVal d%, ByVal e%, ByVal f%) Private Declare Sub sendcommand Lib "c:\ez2\win31\eztt.dll" (ByVal command$) Private Declare Sub intloadimage Lib "c:\ez2\win31\eztt.dll" (ByVal filename$, ByVal image_name$, ByVal image_type$) Private Declare Sub extloadimage Lib "c:\ez2\win31\eztt.dll" (ByVal filename$, ByVal image_name$, ByVal image_type$) Private Declare Sub closeport Lib "c:\ez2\win31\eztt.dll" () Private Declare Function isready% Lib "c:\ez2\win31\eztt.dll" () Private Sub cmExit_Click() End End Sub Private Sub cmPrint_Click() Call openport("0") If isready = 0 Then MsgBox "Printer is not ready.", 16, "Printer status"
Visual Basic 4.0 Else Call setup(20, 10, 2, 1, 2, 0) Call sendcommand("^P1") Call intloadimage("c:\ez2\win31\aeer.pcx", "aeer", "pcx") Call sendcommand("^L") Call sendcommand("AD,10,30,1,1,3,0," & txText.Text) Call sendcommand("BE,10,100,3,3,50,0,1," & txBarcode.Text) Call sendcommand("Y400,20,aeer") Call sendcommand("E") End If Call closeport
VB.Net Example Imports EZWeb Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim gPrinter As New GodexPrinter() If OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.Cancel Then Return End If gPrinter.openport(ComboBox1.Text) gPrinter.beginjob(Integer.Parse(txtLabelLength.Text), Integer. Parse(cbDarkness.Text), Integer.Parse(cbSpeed.Text), 2, 3, 3)
VB.Net Example gPrinter.sendcommand("^L" + Chr(13) + Chr(10)) gPrinter.putimage(10, 80, OpenFileDialog1.FileName, 0) gPrinter.sendcommand(Chr(13) + Chr(10) + "E" + Chr(13) + Chr(10)) gPrinter.endjob() gPrinter.closeport() End Sub
Borland Delphi Example const DLLNAME='ez2000.dll'; procedure openport (no:string); stdcall;external DLLNAME; function readusb (c:PChar;d:PInteger):integer; stdcall;external DLLNAME; procedure sendcommand (command:string); stdcall;external DLLNAME; procedure setbaudrate (n:integer); stdcall;external DLLNAME; function readchar():integer; stdcall;external DLLNAME; procedure closeport; stdcall;external DLLNAME;
Borland Delphi Example VAR i:integer; pi:PInteger; Pws :string; ID:array[0..1024] of Char; pID : PChar; portno:integer; begin portno:=combobox1.ItemIndex; // port choose 0,1,2,3,4,5,6 case portno of 6 : begin openport(inttostr(portno)); setbaudrate(9600); // ~B feedback version sendcommand('~B'); Delay(500); // USB port read pi := @i; pID := @ID; readusb(pID , pi); showMessage(ID); // Show version closeport; end; end; end;
The End Thanks for your attention