API of rupsyslibmanu(c)
getArg ... Gets a start file name.
***** Syntax *****
char *getArg(void){}
Function value: Address to a start file name
***** Function *****
Gets a start file name.
Example 1 Executes "B:\HELLO.EXF."
->File name to be obtained: "B:\\HELLO.EXF"
Example 2 Executes "B:\PIM\company.ADR."
->"B:\SYSTEM\APPS\ADRVIEW.EXF" is executed by filer association.
->The name to be obtained by ADRVIEW.EXF is "B:\\PIM\company.ADR."
Lib-Index API-Index
Keyin ... Button interrupt and event acquisition
***** Syntax *****
int Keyin(int repeat,int blink){}
Function value: Input button status
f e d c b a 9 8 7 6 5 4 3 2 1 0
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| | | | | | | | | | | | | | | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| | | | | | | |K7K6K5K4K3K2K1K0
| | | | | | | |
| | | | | | | +--- /TEST Key input for inspection at shipment from factory
| | | | | | +----- CHGSNS Cell not mounted:1 Cell mounted: 0
| | | | | +------- RXD RS-232C connected but idle: 1 Others: 0
| | | | +--------- RXDL RS-232C connected: 1 RS-232C not connected: 0
| | | +----------- Always 0.
| | +------------- Always 0.
| +--------------- Always 0.
+----------------- EVENT Filer event:1 No filer event: 0
K0: FILER/TIME button
K1: MENU button
K2: EL button
K3: ENTER button
K4: Cursor pointer (Left key)
K5: Cursor pointer (Up key)
K6: Cursor pointer (Right key)
K7: Cursor pointer (Down key)
Parameter:
int repeat; Registration of key repetition or additional features. (0: Not registered)
int blink; Blink number for stopping key repetition (-1: Not registered)
***** Function *****
Gets a button interrupt or event. Holding down a key is registered.
Once the Keyin function is called, control remains in that function when the button interrupt and event don't occur.
In this case, this function causes the CPU to be halted or stopped like bi_getbtn().
* Also read "bi_getbtn( )" in the .
***** Pressing and releasing a button *****
Even when the button is pressed and released, the bi_getbtn() exits the function and returns the value 0, but control remains in the Keyin() function.
***** Pressing multiple buttons at the same time *****
When multiple buttons are pressed and held, control remains in Keyin().
***** Holding down a button *****
When a button subject to repeat registration is held down, the button state is returned continuously from the Keyin function for exit after 0.53-second monitoring. In this duration, a blink operation subject to blink specification is stopped.
.Time prior to initial key repeat: Approx.0.53 second
. Repeat interval Approx. 0.16 second
While the button is held down, the filer resource pSystemCtl->repflg flag is counted up. Normally, it is 0.
Example When K5(^ ) and K7(v) buttons are held down for setting
#define Bkey_up 0x20 /* K5 cursor pointer ^ */
#define Bkey_dw 0x80 /* K7 cursor pointer v */
:
while(1) {
bt = Keyin(Bkey_up|Bkey_dw,-1); /* Hold down for setting */
if (bt&Bkey_up) {
/* K5(^ ) button handling */
}
}
:
When the cursor pointer "K5 button" is held down:
Press=Hi, Release=Low
K5=20h +-------------------------------+ Hi
--------+ +----------- Lo
v v v v v v v v
Return value bt 20h 20h 20h 20h 20h 20h 20h 20h
When the cursor pointer "K5 button" is not held down for setting:
Press=Hi, Release=Low
K5=20h +-------------------------------+ Hi
--------+ +----------- Lo
v
Return value bt 20h
* For the blink function, refer to the .
***** Event *****
When the following settings are made in the filer resource pSystemCtl->EventManager->eventReq, an 1-second interrupt (EVENT_SEC) and a count-down timer 1-second interrupt (EVENT_TMDWN2) can be received (exit from the Keyin function).
.1-second interrupt
pSystemCtl->EventManager->eventReq |= EVENT_SEC;
.1-minute interrupt
pSystemCtl->EventManager->eventReq |= EVENT_MIN;
.1-hour interrupt
pSystemCtl->EventManager->eventReq |= EVENT_HOUR;
.Count-down timer 1-second interrupt
pSystemCtl->EventManager->eventReq |= EVENT_TMDWN2;
***** Handling multiple interrupts *****
When multiple interrupt events occur at the same time, Keyin( ) causes events once. For this reason, care should be taken for key-in wait routines not capable of handling multiple interrupts once.
***** EL button *****
EL button interrupt handling takes place within the Keyin function and the value 0x8000 returns.
To sense when the EL button is pressed:
:
bt=Keyin(0,-1);
if(bi_scanbtn()&0x04) {} /* EL button has been pressed */
:
***** FILER/TIME button *****
Though the state of the FILER button can be sensed, handling takes place within the EventExec function.
To validate the FILER button, the event flag of the FILER button is deleted from the button state obtained by Keyin, then the event state is passed to the EventCall function.
If the FILER button is pressed and held (approx. 1 second), the time display event occurs.
At this time, the return value is 0x8001.
***** Attached function (Double-click) *****
If a key is set in the parameter "repeat," double clicking or holding down the cursor pointer causes the reserved button to be returned.
At the same time, the click flag (EVENT_DBLCLICK) is set in the filer resource pSystemCtl->EventManager->event.
The following shows the return values when the buttons are pressed.
Double-click or key repeat repeat Return value
Cursor pointer (Right key) 0x4000(K6*0x100) K3: Enter button
Cursor pointer (Left key) 0x1000(K4*0x100) K1: Menu button
Cursor pointer (Up key) 0x2000(K5*0x100) K5: Up key
Cursor pointer (Down key) 0x8000(K7*0x100) K7: Down key
* Notes
This setting invalidates the repeat operation set by ***** holding down the button *****. To monitor double-clicking, a response to normal single-clicking delays approx. 0.11 second.
Example: Definition for double-clicking K5(Up) and K7(Down) buttons
#define Bkey_up 0x20 /* K5 cursor pointer UP key */
#define Bkey_dw 0x80 /* K7 cursor pointer Down key */
#define DBL_BIT 0x100
#define DBLCL_U (Bkey_up*DBL_BIT)
#define DBLCL_D (Bkey_dw*DBL_BIT)
:
while(1) {
bt = Keyin(DBLCL_U|DBLCL_D,-1); /* Definition for double-clicking */
if (bt&Bkey_up) {
/* K5 (Up) button processing */
if (pSystemCtl->EventManager->event&EVENT_DBLCLICK) {
/* Doubel-clicking */
}
else {
/* Single-clicking */
}
}
}
:
Lib-Index API-Index
EventCall ... Handles an event.
***** Syntax *****
int EventCall(int bt){}
Function value: 0: No event
1: Event execution request
-1: Application termination request
Parameter:
int bt; Event state
***** Function *****
Decides processing depending on the contents of the event obtained by the Keyin function.
***** Notes *****
When the return value is 1, blinking and timer display processing stops. The EventExec function is called. When the return value is -1, application epilog processing must be performed for dos_exit( );.
Lib-Index API-Index
EventExec ... Executes an event.
***** Syntax *****
int EventExec(void){}
Function value: 0: Normal
-1: Application termination request
***** Function *****
Executes the event obtained by the Keyin function.
***** Notes *****
When the return value is -1, application epilog processing must be performed for dos_exit( );.
When EventExec is called, window information is lost. For this reason, the window must be redrawn after control returns from EventExec.
***** EventExec limitation *****
EventExec() performs display processing such as mini filer, time check, etc., and uses a graphics mode area of the coordinates (0,0)-(101,63).
For this reason, the following processing must be performed for display:
(1) EventExec() preprocessing
User-specified blink, reverse display or display by timer interrupt is temporarily stopped.
For temporary timer routine stop method, refer to the item "bi_tmset" in the wbios Library Handbook.
(2) EventExec() postprocessing
The application window is redrawn.
For example, the window is captured before EventExec() and the captured window is pasted after EventExec().
User-specified blink, reverse display or display restart by timer interrupt takes place.
Program example
int bt; /* Button */
int rst;/* Application termination? */
while(1) {
bt=Keyin(0,-1);
rst = EventCall(bt);
if (rst==-1) {
return; /* Application termination request */
}
else if (rst==1) {
/* Display by application-specific timer interrupt is stopped. */
rst = EventExec();
/* LCD window is redisplayed */
/* Display by application-specific timer interrupt is restarted. */
if (rst==-1)
return; /* Application termination request */
}
else {
/* User original key processing */
if (bt==Bkey_up) {
}
:
}
}
Lib-Index API-Index
softkey ... Soft keyboard
***** Syntax *****
int softkey(void *sts, char *str ,int mode,char *fname){}
Function value: 0: Normal
1: Cancel
-1: Application termination request
Parameter:
void *sts; Soft keyboard table structure address
char *str; Input character string
int mode; Invalid carriage return:0 Valid carriage return:1
char *fname; Style statement file specification
(0: Standard style statement to be specified by a full path)
The soft keyboard table consists of the following structures (defined in softkey.h).
typedef struct{
unsigned int Ico; /* Pictograph to be displayed at the upper right corner */
char KeyType; /* Keyboard */
char KeyMaxRow;/* 2 */
char InSize; /* 2 */
char Curpos; /* Top of cursor:0 Rightmost end of cursor display:!0 */
char status; /* Filer key cancel:0 go to mini Filer:1 None:2 */
char dummy; /* 0 */
unsigned int inmax; /* Maximum number of input characters (max. 1024 bytes) */
}STRSTS;
There are four types of keyboards:
Fixed style statement 2
Uppercase letter (alphabet) 3
Lowercase letter (alphabet) 4
Numeric character 5
***** Function *****
Starts the soft keyboard for input.
***** Remarks *****
0 must always be set in dummy, and 2 must be set in the KeyMaxRow and Insize. When the return value from the function is -1, application epilog handling must be performed and dps_exit( ) must be executed.
Lib-Index API-Index
dispMess ... Displays a message.
***** Syntax *****
int dispMess(char *M[],int Num){}
Function value: 0: Normal
-1: Application termination request
Parameter:
char *M[]; Display message table
int Num; Number of display messages(1-3)
***** Function *****
Displays 1 to 3 lines of messages.
***** Remarks *****
When the return value is -1, application epilog handling takes place and dos_exit( ); must be performed. Unless any key is pressed, control does not return from this function.
Lib-Index API-Index
dispMessBar ... Displays one line of message and starts bar display.
***** Syntax *****
void dispMessBar(char *MSG){}
Function number: None
Parameter:
char *MSG; Display message
***** Function *****
Displays one line of message and starts bar display.
***** Remarks *****
After dispMessBar is called, the endMessBar function must be executed for display termination.
Lib-Index API-Index
endMessBar ... Displays one line of message and terminates bar display.
***** Syntax *****
void endMessBar(void){}
Function value: None
***** Function *****
Displays one line of message and terminates bar display.
Lib-Index API-Index
dispRenew ... Makes updates and starts bar display.
***** Syntax *****
void dispRenew(void){}
Function value: None
***** Function *****
Makes updates and starts bar display.
***** Remarks *****
After dispRenew is called, the endRenew function must be executed for display termination.
Lib-Index API-Index
endRenew ... Makes updates and terminates bar display.
***** Syntax *****
void endMessBar(void){}
Function value: None
***** Function *****
Makes updates and terminates bar display.
Lib-Index API-Index
dispYN ... Displays a Yes/No confirmation message(standard frame).
***** Syntax *****
int dispYN(char *MESS1,char *MESS2,int defCSR){}
Function value: 0: Yes
1: No
-1: Application termination request
Parameter:
char *MESS1; Display message line 1
char *MESS1; Display message line 2
int defCSR; Initial YES: 0 Initial NO: 1 System default: -1
***** Function *****
Displays the Yes/No confirmation message (standard frame).
***** Remarks *****
Enables two lines of messages to be displayed. When the return value of the function is -1, application epilog handling must be performed for dos_exit( ); for display termination.
Lib-Index API-Index
dispYNLarge ... Displays the Yes/No message (large frame).
***** Syntax *****
int dispYNLarge(char *MESS1,char *MESS2,int defCSR){}
Function value: 0: Yes
1: No
-1: Application termination request
Parameter:
char *MESS1; Display message line 1
char *MESS1; Display message line 2
int defCSR; Initial YES:0 Initial NO:1 System default: -1
***** Function *****
Displays the Yes/No confirmation message (large frame).
***** Remarks *****
Enables two lines of messages to be displayed. When the return value of the function is -1, application epilog processing must be performed for dos_exit( ); for display termination.
Lib-Index API-Index
dispCancelYN ... Displays the confirmation message "Do you want to cancel data input?"
***** Syntax *****
int dispCancelYN(void){}
Function value: 0: Yes
1: No
-1: Application termination request
***** Function *****
Displays the confirmation message "Do you want to cancel data input?" Yes/No.
***** Remarks *****
When the return value of the function is -1, application epilog processing must be executed for dos_exit( );.
Lib-Index API-Index
dispWaiting ... Starts the display of a wait animation.
***** Syntax *****
void dispWaiting(void){}
Function value: None
***** Function *****
Starts the display of a wait animation.
***** Remarks *****
After dispWaiting is called, the endWaiting function must be executed for display termination.
Lib-Index API-Index
endWaiting ... Terminates the display of a wait animation.
***** Syntax *****
void endWaiting(void){}
Function value: None
***** Function *****
Terminates the display of a wait animation.
***** Remarks *****
After dispWaiting is called, the endWaiting function must be executed for display termination.
The endWaiting function must also be executed to stop a start animation at the start of application.
Lib-Index API-Index
dispVOLerr ... Indicates a voltage error.
***** Syntax *****
void dispVOLerr(void){}
Function value: None
***** Function *****
Displays a voltage drop warning message when the message "Power error" or "Cell voltage drop due to cell service life or low temperature."
***** Remarks *****
When the return value of the extended function (dos_fcrnew, etc) is -2 (voltage drop), dispVOLerr function is called and after the dispVOLerr function is executed, application epilog processing must be executed for dos_exit( );
This voltage drop frequently occurs for cell service life, flash memory access in low temperature, cell usage with a heavy load beeping the buzzer. In such a situation, application epilog processing must be executed for dos_exit( ); because writing to the flash memory may cause data damage.
Lib-Index API-Index
dispMEMORYerr ... Displays the message "Out of Memory."
***** Syntax *****
void dispMEMORYerr(void){}
Function value: None
***** Function *****
Displays the message "Out of Memory" or "File is too large or insufficient available memory" as a memory overflow warning message.
***** Remarks *****
When a memory check error (dos_freespace, etc.) occurs, the dispMEMORYerr function is called, and application epilog processing must be executed for dos_exit( ); after the dispMEMORYerr function is executed
Lib-Index API-Index
aprMenu ... Dislays the application menu.
***** Syntax *****
int aprMenu(char *menuNAME,MENU *p,int Num){}
Function value: 0: Menu cancl
-2: Application termination request
-4: Return request from application
Parameter:
char *menuNAME; Item name character string
MENU *p; Menu table
int Num; Number of menu items
The menu table consists of the following structures.
typedef struct{
int (*func)(void); /* Function to be called from the menu */
char *str; /* Menu item name */
int moveR; /* Submenu not provided: 0 Provided: 1 */
int disable; /* No mask setting: 0 Mask setting: 1 */
}MENU;
***** Function *****
Displays an application menu and executes menu processing.
***** Remarks *****
When aprMENU is used as a submenu, its return value can be used to leave the main aprMENU. The setBackMenu function is used to return control to the application and the setExitMenu function to terminate the application. When the return value is -2, application epilog processing must be executed for dos_exit( );.
Lib-Index API-Index
setBackMenu ... Return function
***** Syntax *****
int setBackMenu(void){}
Function value: -1
***** Function *****
Returns the value 0 from the aprMenu() for exit.
Lib-Index API-Index
setExitMenu ... Function for application termination
***** Syntax *****
int setExitMenu(void){}
Function value: -2
***** Function *****
Returns the value -2 from aprMenu() for exit.
Lib-Index API-Index
dispList ... Application list selection menu
***** Syntax *****
int dispList(char *menuNAME,MENU *p,int Num,int *menuNO,int SETTING){}
Function value 0: Menu cancel
-2: Application termination request
-3: Enter setting value changed (menu termination by update)
-4: Enter setting value (menu termination without update)
Parameter:
char *menuNAME; Menu item character string
MENU *p; Menu table
int Num; Number of menu items
int *menuNO; Selected menu value
int SETTING; Operation mode
For the menu table, refer to the above aprMenu().
***** Function *****
Provides a desired data selection function by menu processing.
The first menu to be selected is set in menuNO. For example, 0 is set for the first menu. When the Enter button is used for selection, a selection list value is stored in menuNO.
SETTING sets an operation mode.
0: Small filer that can be shifted. Saver termination not possible. No confirmation for cancel >> No mark
1: Small filer that can be shifted. Saver termination not possible. No confirmation for cancel >> Mark
***** Remarks *****
Usually, NULL (or function for returning the value -3) is set in func of the MENU structure.
Lib-Index API-Index
dispTitle ... Displays the menu title.
***** Syntax *****
void dispTitle(char *NAME){}
Function value: None
Parameter:
char *NAME; Menu title name
***** Function *****
Centers the menu title.
Lib-Index API-Index
dispTitleMore ... Dislays the menu title (UP/DOWN gauge).
***** Syntax *****
void dispTitleMore(char *NAME){}
Function value: None
Parameter:
char *NAME; Menu title name
***** Function *****
Centers the menu title, considering the UP/DOWN gauge at the rightmost end of the menu title.
The UP/DOWN gauge must be provided separately.
Lib-Index API-Index
dispTitleUpDw ... Menu title UP/DOWN gauge
***** Syntax *****
void dispTitleUpDw(int sel,int top,int total){}
Function value: None
Parameter:
int sel; Selected list number
int top; List number on line 1
int total; Total number of lists
***** Function *****
Displays the UP/DOWN gauge at the rightmost end of the menu title. The display gauge varies as follows depending on the menu list position. The list item is assumed to have four lines for display, excluding the title.
Example
y0= 0, top=0, total=10 "+-+ "
y0= 5, top=1, total=10 "|-| "
y0=10, top=6, total=10 "+-+ "
Lib-Index API-Index
adjTime ... Corrects the time.
***** Syntax *****
int adjTime(void){}
Function value: 0: Time correction cancel
-2: Application termination request
-4: Time correction completed
***** Function *****
Calls the time correction window for time correction.
***** Remarks *****
This function can be called from the menu function aprMENU. The return value is -2. Application epilog processing must be executed for dos_exit( );.
Lib-Index API-Index
sendTime ... Transfers (sends) time data between substations
***** Syntax *****
int sendTime(void){}
Function value: 0: Normal termination of transmission
Others: Error code
-1 Communication port not available
-2 Communication error
-3 Canceled by button manipulation
-4 Open cell rear panel detected
-5 Time_out
-6 Canceled by the called party
***** Function *****
Transfers time data between the onHands/Ruputers.
***** Remarks *****
When the error code -4 is returned, application epilog processing must be executed for dos_exit( );.
Lib-Index API-Index
recvTime ... Transfers time data (reception) between substations.
***** Syntax *****
int recvTime(WatchDT *Rtime){}
Function value: 0: Normal termination of reception
Others: Error code
-1 Communication port not available
-2 Communication error
-3 Canceled by button manipulation
-4 Open cell rear panel detected
-5 Time_out
-6 Canceled by the calling party
Parameter:
WatchDT *Rtime; Time data storage buffer address
***** Function *****
Receives time data between the onHands/Ruputers.
***** Remarks *****
After completion of reception, the received time data must be written to the RAM time counter (refer to *pSystemCtl->CPUram). When the error code -4 is returned, application epilog processing must be executed for dos_exit( );.
Lib-Index API-Index
setRTC ... Updates the RTC (real-time clock).
***** Syntax *****
void setRTC(void){}
Function value: None
***** Function *****
Writes the filer time data to the RTC (real-time clock).
This function writes the time data of (resource: pSystemCtl->CPUram).
***** Remarks *****
After setRTC is called, the setRTCquit function must be executed to terminate processing.
Lib-Index API-Index
setRTCquit ... Terminates the RTC (real-time clock) update
***** Syntax *****
void setRTCquit(void){}
Function value: None
***** Function *****Executes epilog processing via the setRTC funciton.
Lib-Index API-Index
getRTC ... Reads the RTC (real-time clock).
***** Syntax *****
void getRTC(void){}
Function value: None
***** Function *****
Reads the value of the RTC (real-time clock) and updates the time data of filer information (resource pSystemCtl->CPUram).
Lib-Index API-Index
setWeeklyAlarm ... Sets the weekly alarm.
***** Syntax *****
void setWeeklyAlarm(void){}
Function value: None
***** Function *****
Makes the weekly alarm settings in the memory.
***** Remarks *****
weekly.ini must be updated in advance.
Lib-Index API-Index
setAlarm ... Sets the event alarm.
***** Syntax *****
void setAlarm(void){}
Function value: None
***** Function *****
Makes the event alarm settings in the memory.
***** Remarks *****
alarm.ini must be updated in advance.
Lib-Index API-Index
setSaverCounter ... Resets the saver counter.
***** Syntax *****
void setSaverCounter(void){}
Function value: None
***** Function *****
Clears the counter for measuring the time when the button is not manipulated. This function enables the power management functions (LCD display OFF, saver display) to be set up after the prescribed time.
Lib-Index API-Index
sendFile ... Communication between file substations (send)
***** Syntax *****
int sendFile(char *fmes,int fd,long size){}
Function value 0: Normal termination of transmission
Others: Error code
-1 Canceled by the calling party
-2 Communication time-out (during preparation for transmission)
-3 Invalid code
-4 Break (interrupt by button)
-5 No response from the calling party
-6 File write error
-7 Communication port not available
-8 Open cell rear panel detected
-9 Low voltage detected
-11 Communication time_out (during transmission)
Parameter:
char *fmes; Transmission message
int fd; Transmission file handle
long size; Transmission file size
***** Function *****
Transmits files between the onHands/Ruputers.
***** Remarks *****
The transmission file is opened and the return value (file handle) is set in the parameter. When the error code -8 is returned, application epilog processing must be executed for dos_exit( );.
Lib-Index API-Index
recvFile ... Communication between file substations (receive)
***** Syntax *****
int recvFile(char *fmes,int fd){}
Function value: 0: Normal termination of reception
Others: Error code
-1 Canceled by the calling party
-2 Communication time_out (during preparation for reception)
-3 Invalid code
-4 Break (interruption by button)
-5 No response from the calling party
-6 File write error
-7 Communication port not available
-8 Open cell rear panel detected
-9 Low voltage detected
-10 Memory shortage at receiving
-11 Communication time_out (during reception)
Parameter:
char *fmes; Received message
int fd; Received file handle
***** Function *****
Receives a file between the onHands/Ruputers.
***** Remarks *****
A received file is opened and the return value (file handle) is set in the parameter. When the error code -8 is returned, application epilog processing must be executed for dos_exit( );.
Lib-Index API-Index
TIMERStart ... Starts the count of the count down timer
***** Syntax *****
void TIMERStart(void){}
Function value: None
***** Function *****
Starts the count of the count down timer.
***** Remarks *****
The filer resource timer counter (TIMERdata) must be set in advance.
Only one timer counter is available, so multiple timers cannot be run once the EVENT_TMDWN2 event is requested, an event (EVENT_TMDWN2) is returned every 1 second from the Keyin function. The timer counter is saved in the system area with the following structure (Tdata). (Value reference by *pSystemCtl->TIMERdata). The timer state is indicated by the variable "TimerStart (Reset: 0 Stop: 1 Run: 2)" in the system area. (Refer to *pSystemCtl->TimerStat.)
typedef struct{
int hour; /* Timer hour */
int min; /* Timer minute */
int sec; /* Timer second */
int co; /* Timer 4Hz counter */
} Tdata;
Lib-Index API-Index
TIMERStop ... Stops the count of the count down timer.
***** Syntax *****
void TIMERStop(void){}
Function value: None
***** Function *****
Stops the count of the count down timer.
Lib-Index API-Index
NextExecute ... Executes the next process.
***** Syntax *****
int NextExecute(char *exename){}
Function value: 0: Target file not found 1: Completion of preparation for run
Parameter:
char *exename; Program path name
***** Function *****
Designates the next application to be started.
When the return value is 1, the running application is terminated, then the next application is executed.
Lib-Index API-Index
ChildExecute ... Executes a child process.
***** Syntax *****
int ChildExecute(char *path,int *rcode){}
Function value: 0: Normal termination, -1: Abnormal termination
At abnormal termination one of the following error codes is set in DOSerr.
2: File not found
3: Path not found
5: Access denied
8: Memory shortage
10: Invalid environment
11: Invalid format
-2: Voltage drop
Parameter:
char *path; Program path name
int *rcode; Rerurn code passed from child process
***** Function *****
Executes a child process.
Lib-Index API-Index
CheckExecute ... Executes the check.exf program.
***** Syntax *****
void CheckExecute(void){}
Function value: None
***** Function *****
Executes the check.exf program.
***** Remarks *****
The check.exf program checks the update of alarm information. For this purpose, the CheckExecute function must be executed to update the alarm information after time correction.
Lib-Index API-Index
dispNowWeek ... Displays the day of the week of filer time information (resource: pSystemCtl->CPUram).
***** Syntax *****
void dispNowWeek(int x,int y,int font,int dot,int mode){}
Function value: None
Parameter:
int x; Coordinate x assuming that the upper left corner (leftmost end) of the LCD panel is (0, 0)
int y; Coordinate y assuming that the upper left corner of (leftmost end) of the LCD panel is (0, 0)
int font; Display font code
int dot; Number of dots between display characters
int mode; 0
***** Function *****
Obtains the day of the week that can be counted in the RAM memory, then displays it on the onHand/Ruputer.
Lib-Index API-Index
dispNowDate ... Displays the date of filer time information (resource pSystemCtl->CPUram).
***** Syntax *****
void dispNowDate(int x,int y,int font,int dot,int YearNotDisp){}
Function value: None
Parameter:
int x; Coordinate x assuming that the upper left corner (leftmost end of the LCD panel is (0, 0))
int y; Coordinate y assuming that the upper left corner (leftmost end of the LCD panel is (0, 0))
int font; Display font code
int dot; Number of dots between display characters
int YearNotDisp; Year display: 0 No year display: 1
***** Function *****
Obtains the date counted in the RAM memory, then displays it on the onHand/Ruputer.
Lib-Index API-Index
dispNowAmPm ... Displays the AM/PM of filer time information (resource pSystemCtl->CPUram).
***** Syntax *****
void dispNowAmPm(int x,int y,int font,int dot){}
Function value: None
Parameter:
int x; Coordinate x assuming that the upper left corner (leftmost end) of the LCD panel is (0, 0)
int y; Coordinate y assuming that the upper left corner (leftmost end) of the LCD panel is (0, 0)
int font; Display font code
int dot; Number of dots between display characters
***** Function *****
Obtains the time data counted in the RAM memory, then displays it on the onHand/Ruputer.
Lib-Index API-Index
dispNowTime ... Displays the time data (hour, minute) of filer time information (resource pSystemCtl->CPUram).
***** Syntax *****
int dispNowTime(int x1,int x2,int x3,int y,int font,int dot,int Alldisp){}
Function value: 0: Time digit not changed 1: Time digit changed
Parameter:
int x1; Display coordinate x assuming that the upper left corner (leftmost end) of the LCD panel is (0, 0)
int x2; Display coordinate y assuming that the upper left corner (leftmost end) of the LCD panel is (0, 0)
int x3; Display coordinate x assuming that the upper left corner (leftmost end) of the LCD panel is (0, 0)
int y; Display coordinate y assuming that the upper lefyt corner of the LCD panel is (0, 0)
int font; Display font code
int dot; Number of dots between display characters
int Alldisp; Display of changed digit only: 0: Display of all digit: 1
***** Function *****
Obtains the time data counted in the RAM memory, and displays it on the onHand/Ruputer.
The time (hour, minute) is displayed.
Lib-Index API-Index
dispNowSec ... Displays the time data (second) of filer time information (resource pSystemCtl->CPUram).
***** Syntax *****
void dispNowSec(int x,int y,int font,int dot,int Alldisp){}
Function value: None
Parameter:
int x; Coordinate x assuming that the upper left corner (leftmost end) of the LCD panel is (0, 0)
int y; Coordinate y assuming that the upper left corner of the LCDpanel is (0, 0)
int font; Display font code
int dot; Number of dots between display characters
int Alldisp; Display of changed digits only: 0 Display of all digits: 1
***** Function *****
Obtains the time data counted in the RAM memory, then displays it on the onHand/Ruputer.
The time (second) is displayed.
Lib-Index API-Index
CheckVol ... Checks a heavy load voltage.
***** Syntax *****
int CheckVol(void ){}
Function value: 0: Normal
-1: Abnormal
***** Function *****
Virtually checks supply voltage variation with the heavy voltage applied to the onHand/Ruputer.
Lib-Index API-Index
pauseScroll ... Displays a scroll jump mark.
***** Syntax *****
int pauseScroll(int repkey,int flg,int y){}
Function value: 0: Normal processing
1: Interval, temporary halt of button processing
Parameter:
int repkey Repeat flag
int flg Jump mark flag
K5: Cursor pointer (UP) ... UP key display
K7: Cursor pointer (DOWN) ... DOWN key display
int y Coordinate y for mark display
***** Function *****
Displays the jump mark from beginning to end during upward or downward scrolling.
flg designates a jump mark.
repkey sets Bkey dw for the cursor at the top line, Bkey_up for the cursor at the buttom line or Bkey up|Bkey_dw for the cursor at the intermediate lines.
When repkey and flg coincide, the value -1 is returned. The value -1 is returned repeatedly so long as key repeat continues (approx. 0.8 second) and the repeat count from Keyin reaches 6. Then, a jump mark with flg specified is displayed (approx. 0.8 second). The function value 0 is returned so that cursor jump processing can take place.
Program example:
#define AUTOREPEAT Bkey_up|Bkey_dw /* K5(UP) or K7(DOWN) repeat definition */
#define LISTMAX 10 /* Scroll list maximum value */
int repkey; /* Repeat flag */
int cursor; /* Scroll list cursor position */
:
while(1) {
repkey=AUTOREPEAT;
if (cursor==0) repkey=Bkey_dw;
else if (cursor==LISTMAX) repkey=Bkey_up;
bt = Keyin(AUTOREPEAT,-1); /* Key repeat sensed */
if (bt&Bkey_up) { /* K5 (UP) button processing */
if (0==pauseScroll(repkey,Bkey_dw,30)) cursor--;
if (cursor<0) cursor=LISTMAX;
}
else if (bt&Bkey_dw) { /* K7 (DOWN) button processing */
if (0==pauseScroll(repkey,Bkey_up,30)) cursor++;
if (cursor>LISTMAX) cursor=0;
}
}
:
Lib-Index API-Index
getFilerVersion ... Obtains a filer build version.
***** Syntax *****
int getFilerVersion(void){}
Function value: 200: // MP110,120,140
322: // MC120
Subsequent values: // ???
--------------------------------------------------------------------------------
2. Extended psdos Functions
Lib-Index API-Index
dos_fcrnew ... Creates a new file.
***** Syntax *****
int dos_fcrnew(char *filepath){}
Function value: -1: Abnormal termination
-2: Abnormal voltage
Others: New file handle
At abnormal termination one of the following error codes is set in DOSerr.
3: Path not found
4: Too many files opened
5: Access denied
80: There is already a file with the same name.
-2: Voltage drop
Parameter:
char *filepath; File path name
***** Function *****
Creates a new file and returns the handle of the file.
***** Remarks *****
A new file cannot be created for abnormal voltage.
When the value -2 is returned, the dispVOLerr function is used to display an abnormal voltage warning. Then, application epilog processing must be executed for dos_exit( );.
Lib-Index API-Index
dos_fcreate ... Creates a file.
***** Syntax *****
int dos_fcreate(char *filepath){}
Function value: -1: Abnormal termination
-2: Abnormal voltage
Others: File handle
At abnormal termination one of the following error codes is set in DOSerr.
3: Path name not found
4: Too many files opened
5: Access denied
-2: Voltage drop
Parameter:
char *filepath; File path name
***** Function *****
Creates a file, then returns the file handle (for abnormal voltage).
***** Remarks *****
No file is created for abnormal voltage.
When the value -2 is returned, the dispVOLerr function is used to display an abnormal voltage warning. Then, application epilog processing must be execuited for dos_exit( );.
Lib-Index API-Index
dos_fopen ... Opens a file.
***** Syntax *****
int dos_fopen(char *filepath,unsigned int mode){}
Function value: -1: Abnormal termination
-2: Abnormal voltage
Others: File handle
At abnormal termination one of the error codes is set in DOSerr.
5: Access denied
6: Invalid handle
-2: Voltage drop
Parameter:
char *filepath; File path name
unsigned int mode; File open mode (0: Read, 1: Write 2: Read/write)
***** Function *****
Opens a file, then returns the hle handle.
***** Remarks *****
No file is opened for abnormal voltage.
When the value -2 is returned, the dispVOLerr function is used to display an abnormal voltage warning. Then, application epilog processing must be executed for dos_exit( );.
Lib-Index API-Index
dos_fclose ... Closes a file.
***** Syntax *****
int dos_fclose(int handle){}
Function value: 0: Normal termination
-1: Abnormal termination
-2: Abnormal voltage
At abnormal termination one of the following error codes is set in DOSerr.
6: Invalid handle number
-2: Voltage drop
Parameter:
int handle; Handle number
***** Function *****
Closes the file to be referenced with a designated handle.
***** Remarks *****
When the value -2 is returned, the dispVOLerr function is used to display an abnormal voltage warning. Application epilog processing must be executed for dos_exit( );.
Lib-Index API-Index
dos_fread ... Reads a file.
***** Syntax *****
int dos_fread(int handle,char *buf,unsigned int size){}
Function value: -1: Abnormal termination
-2: Abnormal voltage
Others: Number of read bytes
At abnormal termination one of the following error codes is set in DOSerr.
5: Access denied
6: Invalid handle
-2: Voltage drop
Parameter:
int handle; Handle number
char *buf; Read buffer address
int size; Number of bytes to be read (32K bytes or less)
***** Function *****
Reads a file or device to be referenced with a designated handle.
***** Remarks *****
At abnormal termination or abnormal voltage, data may be read normally. In this case, the dos_fclose function is used to close the file. In the case of abnormal voltage, the dispVOLer function is used to display an abnormal voltage warning. Then, application epilog processing must be executed for dos_exit( );.
When the number of written bytes is less than that of read bytes, this function indicates that further data cannot be read out.
Lib-Index API-Index
dos_fwrite ... Writes a file.
***** Syntax *****
int dos_fwrite(int handle,char *buf,unsigned int size){}
Function value: -1: Abnormal termination
-2: Abnormal voltage
Others: Number of written bytes
At abnormal termination one of the following error codes is set in DOSerr.
5: Access denied
6: Invalid handle
-2: Voltage drop
Parameter:
int handle; Handle number
char *buf; Write buffer address
int size; Number of bytes to be written (32K bytes or less)
***** Function *****
Writes to a file to be referenced with a designated handle.
***** Remarks *****
After the last executioNof dos_fwrite, the bi_vwrflush function is executed to update the flash memory.
Before a file is written, the WriteSpace function, etc. must be used to check the capacity of free memory. If dos_fwrite is executed when the memory capacity is not enough, flash memory may be damaged.
At abnormal termination or abnormal voltage, it is probable that data has not been written normally. In this case, the file must be closed once within the dos_fwrite function, then opened again when it is written again. In the case of abnormal voltage or abnormal voltage, the dispVOLerr function is used to display an abnormal voltage warning. Then, application epilog processing must be executed for dos_exit( );.
When the number of written bytes is less than that of bytes to be read, memory shoratge is indicated.
***** Note *****
At the end of a processing routine for writing to the flash memory (dos_write,dos_fwrite), the bi_vwrflush function must be called.
Example
:
EVENTTABLE table;
int fp;
/* Free capacity check in advance */
if ( -1==dos_freespace(4*sizeof(EVENTTABLE)) ) return;
/* New file creation routine */
if ( (fp = dos_fcrnew( ALARMINI ))<0 ) return;
/* Initialization with \0 */
memset( (char *)&table, '\0', sizeof(EVENTTABLE) );
/* Omission of error processing in the file write routine */
dos_fwrite( fp, (char *)&table ,sizeof(EVENTTABLE) );
dos_fwrite( fp, (char *)&table ,sizeof(EVENTTABLE) );
dos_fwrite( fp, (char *)&table ,sizeof(EVENTTABLE) );
dos_fwrite( fp, (char *)&table ,sizeof(EVENTTABLE) );
/* Closing the file handle */
dos_fclose( fp );
/* Flushing the flash memory */
bi_vwrflush(); /* bi_wrflush(1); + voltage check function */
:
Lib-Index API-Index
dos_fdelete ... Deletes the file.
***** Syntax *****
int dos_fdelete(char *filepath){}
Function value: 0: Normal termination
-1: Abnormal termination
-2: Abnormal voltage
-3: Flash memory write error
When the value -1 is returned for abnormal termination one of the following error codes is set in DOSerr.
2: File path not found
3: Path not found
5: Access denied
-2: Voltage drop
Parameter:
char *filepath; File path name
***** Function *****
Deletes a designated file.
***** Remarks *****
When the value -2 is returned, the dispVOLerr function is used to display an abnormal voltage warning. Return value
When the value -3 is returned, application epilog processing must be executed for dos_exit( );.
Lib-Index API-Index
dos_fseek ... Moves a file pointer.
***** Syntax *****
unsigned long dos_fseek(int handle,int mode,long offset){}
Function value: -1: Abnormal termination
-2: Abnormal voltage
Others: New pointer position
At abnormal terminatioNone of the following error codes is set in DOSerr.
1: Invalid function (Other than 0, 1, and 2 modes)
6: Invalid handle
-2: Voltage drop
Parameter:
int handle; Handle number
int mode; Mode 0=Byte offset from the top of the file
1=Byte offset from the current position of the file pointer
2=Byte offset from the end of file
long offset; Offset value for moving the pointer
***** Function *****
Sets a file pointer position corresponding to a designated handle.
***** Remarks *****
When the value -2 is returned, the dispVOLerr function is used to display an abnormal voltage warning. Then, application epilog processing must be executed for dos_exit( );.
Lib-Index API-Index
dos_freespace ... Checks space for file storage (bytes).
***** Syntax *****
int dos_freespace(long size){}
Function value: 0: Free space found
-1: Free space not found
Parameter:
long size; Space confirmation size (bytes)
***** Function *****
Checks in bytes the presence or absence of free space in writing a file with bytes specified in size to the flash memory.
Lib-Index API-Index
dos_freesect ... Checks the presence or absence of free space for file storage (sector).
***** Syntax *****
int dos_freesect(int size){}
Function value: 0: Free space available
-1: Free space not found
Parameter:
int size; Space check size (sector)
***** Function *****
Checks in sectors the presence or absence of free space for file storage.
--------------------------------------------------------------------------------
3. Extended wbios Function
Lib-Index API-Index
bi_vwrflush ... Writes a block cache buffer.
***** Syntax *****
int bi_vwrflush(void){}
Function value: 0: Normal termination
-2: Abnormal voltage
-3: Flash memory write error
***** Function *****
Writes the contents of the write cache buffer holding block data in the flash memory to the flash memory.
***** Remarks *****
A file must be closed before the bi_vwrflush function is executed.
When the value -2 is returned, the dispVOLerr function is used to display an abnormal voltage warning. Return value
When the value -3 is returned, application epilog processing must be executed for dos_exit( );.
Lib-Index API-Index
bi_vsecread ... Reads a sector.
***** Syntax *****
int bi_vsecread(int drv,int head,int cyl,int secno,int snum,void *rbuf){}
Function value: -1: Abnormal termination
-2: Abnormal voltage
Others: Number of actually read sectors
Parameter:
int drv; Drive number(1=RAM disk)
int head; Head number
int cyl; Cylinder number
int secno; Sector number
int snum; Number of sectors to be read
void *rbuf; Read buffer address
***** Function *****
Reads the contents of a designated sector to the buffer.
Lib-Index API-Index
bi_vsecwrite ... Writes a sector.
***** Syntax *****
int bi_vsecwrite(int drv,int head,int cyl,int secno,int snum,void *wbuf){}
Function value: -1: Abnormal termination
-2: Abnormal voltage
Others: Number of actually written sectors
Parameter:
int drv; Drive number (1=RAM disk)
int head; Head number
int cyl; Cylinder number
int secno; Sector number
int snum; Number of sectors to be written
void *wbuf; Write buffer address
***** Function *****
Writes the contents of a designated sector to the buffer.
===============================================================================
Copyright (c) 1998-1999. Seiko Instruments Inc. All rights reserved.
===============================================================================
Lib-Index API-Index