Instruction/ maintenance manual of the product PA-2400W Casio
Go to page of 83
P A-2400W C Library Manual (V ersion 1.00) CASIO C omput er Co., Ltd. Copyright ©1999. A ll rights reserved. July 1999.
2 Table of C ontents Prefa ce 4 Chapter 1 Supported Fil es 5 1.1 Dedicated Li brary and Ut ilit y 7 1.1.1 System Librar y 7 1.1.2 SIPanel Li brary 7 1.1.3 I/O Boo tup Lib rary 7 1.1.4 File T ran sfe r U tility 8 1.1.5 File C heck Utility 8 Chapter 2 Development En vironment 9 Chapter 3 System Library 10 3.
3 7.7 Method of De scribing Pat hname 48 7.8 Conditi ons at Communicati on Partner 50 7.8.1 Rules of Nami ng File and Director y Pathname 50 7.9 Setting Up Registry 51 7.9.1 Setting Up Items 51 7.9.2 Setting Up Regi stry w ith User Application 52 7.10 Terminati on Codes 54 7.
4 Preface This manual desc ribes the C la nguage-dedicated library functions and ut ilities that run on the CA SIO PA-2400W (hereinafter referred to as "H/P C", which stands fo r Handheld PC). The PA-2400W uses the Wind ows CE operating system (Ver.
5 1. Supported Files The follo wing files will b e supported by the C -librar y functions and util ities descr ibed in this manual. Table 1.1 File Function Description System Library CA_BacklightOn Turns on the back light. CA_BacklightOff Turns off the backligh t.
6 Notes: 1. Since the “SIPanel.dll” and “S IPanel.exe” in English version are pre-installed in the ROM, you do not need to in stall it e very time you use the software inpu t panel. However, if you use other langua ge versions of the SIPanel, you need to rep lace them.
7 1.1 Dedicated Libr ary and Util ity 1.1.1 System Li brary Table 1.2 No. Function Description Page 1 CA_BacklightOn Turns on the back light. 11 2 CA_BacklightOff Turns off the backligh t. 12 3 CA_BacklightCheck Acquires the status o f backlight . 13 4 Sy ncPo we r Off Turns off after co mpletion of a ccess to a card.
8 1.1.4 File Transfer Utili ty Table 1.5 File transfer utilit y No. Comm and Descri ption Page 1 FLCE /Y Communicat ion environ ment setup /Idle start 58 2 FLCE /S File trans mission 59 3 FLCE /R File.
9 2. Dev elopment Env ironment Your own application prog ram can be developed by implementing the C ASIO’s dedicated librar y functions and utilit y commands li sted in the previous pages und er the fo llowing software d evelopment environ ment. Microsoft Visual C/C++ vers ion 6.
10 3. Sy stem Lib ra ry 3.1 Ov er vie w This System Library functions can provide you with various dedica ted functions such as backlight control, power O FF supplement control , power-ON control with alar m, etc.
11 3.2 Details of Func tion Title Function CA_BacklightOn Turns on the back light. If this function is called while the backl ight is alread y on, nothing will happen. C Language Interface Calling Sequence BOOL CA_Backligh tOn () Para meters None Return Values TRUE : N ormal end Header #include <CasioSys.
12 Title Function CA_BacklightOff Turns off the backligh t. C Language Interface Calling Sequence BOOL CA_Backligh tOff() Para meters None Return Values TRUE : N ormal end Header #include <CasioSys.h> Remar ks This function can turn off the b acklight which is turned on b y a keyboard operation.
13 Title Function CA_BacklightCheck Acquires the status of the backlight if i t is set to on o r off. C Language Interface Calling Sequence BOOL CA_Backligh tCheck() Para meters None Return Values TRUE : Backlight is on. FALSE : Backlight is of f. Header #include <CasioSys.
14 Title Function Sy ncPo we rO ff Turns off the power after access to an ins talled card is complete. C Language Interface Calling Sequence BOOL SyncPowerOf f() Para meters None Return Values TRUE : Normal end.
15 Title Function Disab lePo werO ff Disables power -off with the po wer button. This sett ing is cleared when the po wer is turned on. C Language Interface Calling Sequence BOOL DisablePowerOff() Para meters None Return Values TRUE : Normal end. Header #include <CasioSys.
16 Title Function EnablePowerOff Enables the po wer to be turned off with the power bu tton. C Language Interface Calling Sequence BOOL EnablePower Off() Para meters None Return Values TRUE : Normal end.
17 Title Function StatusPowerOff Acquires the status of “enab le/disable th e power to be turned off wi th the power but ton”. C Language Interface Calling Sequence BOOL StatusPowerO ff() Para meters None Return Values FALSE : Disable “the power to be turn ed off with the power bu tton.
18 Title Function ApoCountRese t Resets the counte r of APO time. By calling th is function before elapse of the APO ti me set at th e control panel, APO can be dis abled. C Language Interface Calling Sequence BOOL ApoCountRes et() Para meters None Return Values TRUE : Normal end.
19 Title Function SoftReset Resets the s ystem. After this fu nction is cal led, a worm-bootup is performed. C Language Interface Calling Sequence void SoftReset() Para meters None Return Values None Header #include <CasioSys. h> Remar ks When this funct ion is called, a warm-bootup is immed iately perfor med.
20 Title Function SetPowerO nAlarm Enables or d isables “the au tomatic power -on to be acti vated with the ala rm”. C Language Interface Calling Sequence BOOL SetPowerOnA larm ( BOOL bMode); Para meters BOOL bMode FALSE : Disab les “auto matic power-o n with the a larm” .
21 Title Function GetP owerOn Alarm Acquires the status of “au tomatic power-on with the alarm” if it is dis abled or enabled. C Language Interface Calling Sequence BOOL GetPowerOnA larm() Para meters None Return Values TRUE : Enable “auto matic power-on with the a larm”.
22 Title Function SetP owerE ventS tat Sets “power -on event notifica tion” enabled or disabled. C Language Interface Calling Sequence BOOL SetPowerEven tStat( BOOL bMode) Para meters BOOL bMode TRUE : Enable “power-on event notifi cation” . FALSE : Disab le “power-on even t notifica tion” .
23 Sample program to ac quire power-on e vent notification #include <w indows.h> stat ic HANDL E hEv entOn = NULL ; stat ic HANDL E hThre adOn = NULL ; DWORD WI NA PI OnTh r ea d( ) { LONG W ait.
24 Title Function GetP owerEventStat Acquires the status of “power -on event notif ication ” if it is ena bled or disabl ed. C Language Interface Calling Sequence BOOL GetPowerEven tStat() Para meters None Return Values TRUE : Enable noti fication.
25 4. SI Panel Library 4.1 O v e r v iew I n t h is cha p ter , the S I P anel w h ich is executed o n the Window s CE Ve r .2.11 ( on P A - 2 4 0 0 W ), an d t h e D L L ( D yn a mi c Lin k Li b rary) w h ich is calle d fr o m a user appl icati o n a r e describe d .
26 4.2 Use of SIPan el Lib rary Program for starting up the library Before use of the S IPanel lib rary, a dedicated prog ram must be crea ted to start up the library. The follo wing is the method to call. Create a dedicated progra m to call the library, separate fro m application progra m for business use.
27 4.4 Details of Function Title Function SIP _Exe cuteP anel Initia tion of the S IPanel Initia tes the S IPanel in the non -display mode. If it has already been initiat ed, it will be displayed as speci fied by the parameters.
28 Title Function SIP_ S how Pan el Displa y/Non-disp lay of the SIPanel Sets th e SIPanel to d isplay mode or non -display mode. C Language Interface Calling Sequence int S IP_ShowPanel (in t iC mdShow) Para meters int iC mdShow SIP_ SHOW : Displa ys the SIPanel if it is in the non-displa y mode.
29 Sample program to s tart up the SIPanel This is a sourc e program of Sip Tsr.exe which must be used tog ether with “ CallSip.exe”. // SipTsr.cpp : Define s the entr y point for the appli cation. // #include “stda fx. h” #include “SIPanel.
30 if (hWnd == 0) // Check whether val ues returned by CreateWindow() are va lid. return (FALSE); if (lsWindow(hWnd) != TRUE) return (FALSE); return (TRUE); // Window handle h Wnd is va lid.
31 Sample program of application software for business use Insta ll “SipTsr.exe”, and execu te the follo wing program. // CallSip .cpp : Defines the entry po int for the appl ication.
32 wc.style = CS_HRE DRA W | CS_VRED RA W ; wc.lpfnWndProc = WndProc; wc.cbClsExtra = 0; wc.cbWndExtra = DLGWIN DOWEXTRA; wc.hInstance = hInstance; wc.hIcon = NULL ; wc.hCursor = NULL; wc.hbrBackground = (HBRUSH) GetStockObject(L TGR A Y_BRUSH); wc.lpszMenuName = NULL; wc.
33 BOOL CallSip( HWND hWnd, W P ARAM wI d) { HWND hSip; UINT CmdMessage = WM_USER; hSip = FindW indow( C lassName_TSR, NULL); // Find "SipT sr" if ( hSip == NULL) { MessageBox( hWnd, TEXT(&q.
34 4.5 SI P A N EL.E XE 4.5.1 O v e r v i ew I n iti a te S I PAN E L .EXE and call S I PA N E L . D L L to contro l th e S I P anel. The S I P anel will b e i n itiate d i n the no n - d is p l a y m ode . I f it h as a lr e a d y bee n i n itiated, it w ill be d i s pl a yed a s s p ecified b y the c o mman d line o p tions.
35 5. I/O Bootup Library 5.1 Ov er vie w The I/O bootup libra ry monitor s the connection status of dedic ated I/O Box and notifie s user of the st at us.
36 5.3 D etails of Func tion Title Function iobox_chk This function monitors the connection and mounting status of PA-2400W terminal on I/O Box for a specified pe riod of t ime and returns a resu lt of it . When the power of I/O Box is turned off, the statu s is considered as improper connect ion of PA-2400W with I/O Box.
37 5.4 Use of iobox _chk Interna lly, this function creates an event object of I/O Box and waits for the object for a specified t ime. During the wait time, i t is possible to dispa tch another task. Th erefore, there are two wa ys of usage as sta ted below.
38 5.5 Sample Program This sample prog ram is created with the method of “Multiple -Thread Mode” under development environment of Visual C++ 5.0 plus and Windows CE SD K/ D DK. It introduces the IOBOX1.C program and its referen ce sources, and show s a list of environ ment variables.
39 InitCo mmonControls( ); // Ini tialize co mmon controls - command bar hInst = hInstance ; / / Save handle to create command bar hWnd = CreateWindow(szAppName, // Class s z T i t l e , / / T i t l e.
40 case WM_PAINT: hdc = BeginPaint(hWnd, &ps); GetClientRect(hWnd, &rect ); rect.top += CommandBar_Height(hWndCB); DrawText(hdc, TEXT("Hello Windows CE!"), -1, &rect , DT_SINGL E.
41 default: return (DefWindowProc(hWnd , message, u Para m, lParam)); } return (0) ; } VOID i oProc() { int r et; // re t=iobox_chk( INFINITE); // Wait for infinite ret=iobox_chk( 5 *1000); // Wait for 5 seconds PostMessage ( hWnd, WM_USER, ret, 0L); } // End of Hello Windows CE progra m.
42 6. Registry of Lib raries In this chap ter, regi stries which are used by the libraries of S ystem and SIPanel are described. The I/O Startup Library does not use an y registry. 6.1 System Libr ary The Syste m Library uses the fo llowing registries.
43 7. File Transfer Utili ty 7.1 Ov er vie w This file u tility performs f ile transfer eithe r between a host PC and PA-2400W or between two PA-24 00W termina ls.
44 7.2 List of Suppo rted Comm ands Among file transmis sion protocol, this fi le transfer utility (FLCE) can support the foll owing specific commands. Table 7.1 Lis t of supported c omm ands Supported No. Co mmand Specify on FLCE’s comma nd line Request by comm.
45 7.3 Use of FLCE The FLCE is an execution prog ram, and there are two methods for the use. FLCE individually FLCE as child-process in user applicat ion In the indi vidual use mode, it c an be started up by a shortcut in which necessar y parameters are set as argument.
46 7.5 Restrictions The fi le tran sfer utility (FL CE) is s ubje ct to th e follo wing restric tio ns: T he FLCE does not support communication with a 3-pin int erface or PCMCIA card. T he COM1 port and IrDA port cannot be used concurren tly because t hey must use the same ha r dware.
47 7.6 Communication Co mman ds Operational spec ifications for the FLCE should be made by in itiating an app ropriate command together with the follo wing arguments. A maximum of twenty commands ca n be described at one time, and the y will be processed se quentially in the o rder in which they are described.
48 7.7 Method of Describing Pathname Enclose every pathna me in a pair of paren theses. A pathname must have a length of 255 characters or less includ ing the two paren theses. A 2-b y te code charac ter is counted a s one character. Example: FL CE /S " asio dat a* .
49 Reference: Windows CE has no concept o f a drive letter. Accord ingly, an additional dr ive is assigned a directory dire ctly under the root d irectory.
50 7.8 Conditio ns at Communicat ion Partner 7.8.1 Rules of Naming File and D irectory Pathnam e Specify the pathname of fi le or director y at the communica tion partner acco rding to the n aming rule s o f communica tion partner -side OS. Table 7.4 Communicat ion partner 8.
51 7.9 Sett ing Up R eg ist ry By rewrit ing values in the registry it is possible to modify the de fault values of commands’ parameters for communica tion environ ment, etc. However, use the co mmand line argu ment (/Y) to specify the communica tion line or baud rate during normal use.
52 7.9.2 Setting Up Regis try w ith User A pplica tion Modify the reg istry as requi red from your applicat ion while ref erencing the fol lowing sample program. /************************************ ***********/ / * R e g i s t r y R e g i s t r a t i o n P r o g r a m * / /*********************************************** / #include <windows.
53 err= FALSE; } els e { err= FALSE; } if( e rr==TRU E) MessageBox( NULL, TEXT( "Success setting regis try!") , TEXT( "This i s MessageBox"), MB_OK); els e MessageBox( NULL, TEXT( .
54 7.10 Termination Codes The FLCE returns one of the codes listed in Tab le 7.6 as the ter mination code when communication is complete. Upper -level progra ms should perform an appropriat e action to ref erence these values. The communica tion function may return a code o ther than that described in the termina tion co des list.
55 Table 7.6 List of ter mination codes Error Code Cat egory cod e Deta il cod e Mean ing Possible C ause Re medy 00h 00h Normally termina ted Normal. - DCh to F5h 00h Nor mally termina ted Formatting of drive a:between 'A' and 'Z ' is speci fied fro m the partner station.
56 7.11 Log File The FLCE will create a log file to record co mmunication logs. Log File Name The current log file na me is fixed to "FLCE. LOG". This specif ication cannot be modified. Therefore, if the current log f ile needs to be s tored, use another f ile name.
57 7.12 Prec autions Under the state where the fi le transfer u tility is opera ting, if a file is trans mitted out o r received in a folder tha t is opened by the Explore r, the transfe r speed is redu ced considerably.
58 7.13 Deta ils of Command an d Option Title Command FLCE /Y This command sets up the device, baud rate, and co mmunicati on mode used for communicatio n. If this co mmand is o mitted, the default value { IrDA, , } is used. Any of the para meters can be omi tted.
59 Title Command FLCE /S This command tran sfers a fi le on the PA-2400W to the co mmunication partne r side of PA-2 400W. If an ident ical file na me exists in the des tinat ion director y of the partner side , it will be overwritten.
60 Title Command FLCE /R This command uses a pa thname request to specify f ile that ex ists on the co mmunication pa rtner side, th en receive the file. If an ident ical file na me exists in the re ception directo ry of the PA-2400W, it will be overwritten.
61 Title Command FLCE /A This command tran sfers the co ntents of f ile that exi sts on the P A-2400W and specified by the a ppend file p athnam e to the communica tion partne r side of PA -2400W, and append the contents to file that exists on the communication partner side .
62 Title Command FLCE /D This command dele tes a specifi ed file or di rectory that ex ists on the communication pa rtner s ide. For al l other operation s which must fo llow the condition s at th e communication par tner side, r efer to Chapter 7 .8 “Conditions at Co mmunication Partner ”.
63 Title Command FLCE /N This command mo ves a file tha t is specified b y the move sourc e pathname and that ex ists on the c omm unication partner side to the move de stination -side path. Specif y a file name for the move destination -side pathna me.
64 Title Command FLCE /T This command tran sfers the s ystem date and ti me of the PA-2400W to the communication p artner side for setting. Transmitted date and ti me is a local t ime. Depending on the line cond itio n, a few seconds of erro r may result.
65 Title Command FLC E (Idle Start) This command passes the requ est right to th e communication p artner s ide and operates accord ing to a command that is requested b y the communi cation partner. If star ting up the PA -2400W with this mode, only the /Y command can be spec ified.
66 7.14 Co mmand and Statu s Table 7.8 Status No. C o mm an d s o f the protocol S p e c i f i ca ti on b y F L C E Request b y p a rtn e r Re m a r k s 1 F ile t r an s m i ss i on C C 2 File recepti.
67 7.15 Retry Pr ocess Wh en Downloading File In th is chapter, ret ry process for downloading files by the FLCE at ti me of a communicat ion error is explained. 7.15.1 Overview The retry p rocess for fi le transmission can be implemented b y the file trans mission co mmand with update option o f the LMWIN.
68 Preparation at P A -2400W The flow of retr y operation is as follows. The opera tion is reco mmended only if such e rror as 0x0100 protocol erro r (data e rror on lin e) or 0xA020 line broken error occurs. Fig. 6.xx Fig. 7.1 According to the flow chart ab ove, another retry af ter the init ial retr y operation can be possib le.
69 8. File Check U tility 8.1 Ov er vie w The file check ut ility is used to check if an objective fi le has been successfu lly installed on the communication partner-side of PA- 2400W. This utility has the capability to detect an installation error irrespect ive of file transfer met hod used.
70 8.3 Operation Method This File Check Utilit y is to check if a fi le has been correct ly copied to other PA -2400W or not. In th is chapter, operat ing method to copy a fil e from PC to PA -2400W via RS-2 32C interface is described . Downloading file from PC to PA-2400W Fig.
71 Copying file w ith PC ca rd (from PA-2400W to P A -2400W) Fig. 8.2 Operation : 1) Set a file correctl y at the transmi ssion side of PA -2400W. 2) Specify a fi le (to be copied) in script f ile and crea tion of list f ile ( FCHK .LOG) in the same scrip t file .
72 8.4 Describ in g Meth od 8.4.1 Pathname Always enclose a pa thname in a pair o f quotation marks. One pathname must be 255 characters o r l ess including the two quota tion marks. A 2-b yte code character is counted as one character. Exam ple: FCHKCE / G " casi o data* .
73 8.5 D etails about C ommand and Option The total nu mber of characters must be 255 character s or less including "FCHK CE". If at lea st one incorrect parameter, such a s an incorrec t de.
74 8.6 Co mman d of FCH KCE 8.6. 1 Gener atio n of List Fil e If the na mes of file s to be transf erred (copied) f rom PA-2400W ar e specified, thi s command will cr e ate a list o f file s to be transfe rred (copied) and a list f ile that con tains the checksu m data c alculated from all the file s to be tr ansferred.
75 8.6.2 Comparison by List Fi le With this command the fol lowing comparison will b e made: Comparison between the fi le information t ransferred (copied) b y the PA-2400W (parent machine) and the contents o f the l ist file ( FCHK.
76 8.7 Format of List File The for mat of list file to be gen erated with the fi le check util ity is shown belo w. < FCHK LOG> :: = <FI LENO> <FILEINFO> < FILECHECKS UM> <L.
77 8.8 Syntax A naly sis of Scr ipt File If a scrip t file na me is specified when generating a l ist file, the syntax of the script fi le is anal yzed as follows before genera ting the list file. The specifica tions of the sc ript f ile syntax is given below.
78 <PATHNAME_ PAIR> :: = <PATHNAME> <DEL M> <PAT HNAME> <CMD_PARAM ETER> :: = <CMD_NAME> <STRING> <CMD_NAME> :: = <PA THNAME> <PATHNAME_ LIST&g.
79 8.9 Error Mess ages/ Codes Table 8.3 Code Message Meaning Remedy The making of list file co mpleted. 00 The conten ts o f list file a greed. Normal termination Not necessary. 01 Specified pa thname not foun d. File na me speci fied b y list file do es not exist.
80 8.10 Restric tio n Because of the l imitation fro m Windows CE some of the file s contain ed in the “ Windows ” f older cannot be duplica ted. As a result, they will not be listed in the list fi le.
81 8.11 Deta ils of Command an d Option Title Command FCHKCE /G If the na mes of file s to be transf erred (copied) f rom the PA-2400W are specif ied, this command will create a list o f files to be transferred (copied) and a li st file that contains th e checksum data ca lculated fro m all the f iles to be transferr ed.
82 Destination d irectory name Specify th e destination d irectory name of the file transmission ( copy). Specify the di rectory name in accordance w ith the na ming rules of OS used on t he transmission (copy) des tination side . If “/SC” option is specified, this paramete r can be disab led.
83 Title Command FCHKCE /C This co mmand will perfor m the following comparisons ; a comparison be tween the file infor mation t ransferred (copied) fro m the partne r statio n (parent machine) and the contents of the list f ile ( FCHK .
An important point after buying a device Casio PA-2400W (or even before the purchase) is to read its user manual. We should do this for several simple reasons:
If you have not bought Casio PA-2400W yet, this is a good time to familiarize yourself with the basic data on the product. First of all view first pages of the manual, you can find above. You should find there the most important technical data Casio PA-2400W - thus you can check whether the hardware meets your expectations. When delving into next pages of the user manual, Casio PA-2400W you will learn all the available features of the product, as well as information on its operation. The information that you get Casio PA-2400W will certainly help you make a decision on the purchase.
If you already are a holder of Casio PA-2400W, but have not read the manual yet, you should do it for the reasons described above. You will learn then if you properly used the available features, and whether you have not made any mistakes, which can shorten the lifetime Casio PA-2400W.
However, one of the most important roles played by the user manual is to help in solving problems with Casio PA-2400W. Almost always you will find there Troubleshooting, which are the most frequently occurring failures and malfunctions of the device Casio PA-2400W along with tips on how to solve them. Even if you fail to solve the problem, the manual will show you a further procedure – contact to the customer service center or the nearest service center