This command reads data from a PocketForms file (*.xpf) into a new file in standard XML format.
Syntax
POCKETFORM "PocketForms_filename", "XML_filename"
PocketForms_filename
This should specify the file path and filename of the file created by PocketForms (typically filename.xpf).
If no file path is specified, GainSeeker will expect to find this file in the folder where GainSeeker program files (*.exe) exist.
XML_filename
Use this parameter to specify a file path and filename for the new file that will be created in standard XML format.
If no file path is specified, GainSeeker will create this file in the folder where GainSeeker program files (*.exe) exist.
Return value
This command returns one of the following numbers:
Return value: |
Explanation: |
1 |
the specified XML_filename was successfully created from the specified PocketForms_filename |
0 |
the specified PocketForms_filename was not found or was blank |
-1 |
file processing error |
-2 |
the specified XML_filename was blank |
-3 |
the correct version of Microsoft XML components (MSXML) is not installed on this workstation |
-4 |
the specified PocketForms_filename does not contain data |
-5 |
file open error |
-6 |
file write error |
Notes
This command also uses information about the form to set the value of three MySVar variables:
Form information |
MySVar name |
Form name |
PocketFormName |
Date created |
PocketFormDate |
Form comments |
PocketFormComments |
Each PocketForms file can contain one SPC data record and/or one DMS data record.
After synchronizing your Pocket PC with your computer, you should run a template that first uses the POCKETFORM command to convert the PocketForms file to XML format, and then uses XML and Record Buffer commands to process this XML file.
See also: Data entry setup for handheld devices
Sample template to read SPC data from a PocketForms file:
Cell |
Column |
Formula |
A1 |
Calculated |
INITVARS: DE_OPT 7, 0: SVar 99 = "F:\ Quality\PocketFormsData" |
B1 |
Calculated |
NVar 99 = Q_CONNECT 1, "GainSeeker71_B", "Y", "N" |
C1 |
Calculated |
SVar 98 = DIR (CONCAT SVar 99, "*.xpf"): If (Len SVar 98) = 0, GOTO [U1], (If (FSIZE (CONCAT SVar 99, SVar 98)) < 100, GOTO [T1]) |
D1 |
Calculated |
SVar 93 = CONCAT SVar 99, SVar 98: Nvar 98 = PocketForm SVar 93, (CONCAT SVar 93, ".xml") : If Nvar 98 < 1, (Message (CONCAT "Problem transforming file ", Svar 93, " (Error = ", CSTR Nvar 98, ")")) + GOTO [S1] : If Nvar 98 = -4, (Message "Please remove the template file from the data folder.") + GOTO [T1] |
E1 |
Calculated |
XML_MAP " Trace_One", "Trace_1" : XML_MAP "Data", "Data_Value" : Nvar 98 = XML_OPEN (CONCAT SVar 93, ".xml") : If Nvar 98 = 0, (Message (CONCAT "Problem opening file ", SVar 93, ".xml")) + GOTO [S1] |
F1 |
Calculated |
If XML_NEXT = 0, GOTO [S1] |
G1 |
Date/Time |
MYSVAR "PocketFormDate" |
H1 |
Traceability field 1 |
DB_VALUE " Trace_One" |
I1 |
Calculated |
SVar 95 = Prep_Q Trim DB_VALUE "Part_Number": SVar 93 = CONCAT "Select PartNo From ", Table "VSTDS", " Where PartNo = '", SVar 95, "'": NVar 99 = Q_START 1, SVar 93: If NVar 99 = 1, GOTO [K1] |
J1 |
Calculated |
Message (CONCAT "Standard not found (", DB_VALUE "Part_Number", ")") : EXIT |
K1 |
SPC standard |
DB_VALUE "Part_Number" |
L1 |
Data 1 |
DB_VALUE "Data1" |
M1 |
Data 2 |
DB_VALUE "Data2" |
N1 |
Data 3 |
DB_VALUE "Data3" |
O1 |
Data 4 |
DB_VALUE "Data4" |
P1 |
Data 5 |
DB_VALUE "Data5" |
Q1 |
Calculated |
SAVEROW |
R1 |
Calculated |
GOTO [F1] |
S1 |
Calculated |
XML_CLOSE: SVar 93 = CONCAT SVar 99, SVar 98: FDEL (CONCAT SVar 93, ".xml") : FREN SVar 93, (CONCAT SVar 93, ". sav") |
T1 |
Calculated |
GOTO [C1] |
U1 |
Calculated |
Q_DISCONNECT 1: If (TIMER_DELAY 0, 5, 0, 0, 0, -1, -1) = 1, GOTO [A1], EXIT |
Sample template to read DMS data from a PocketForms file:
Cell |
Column |
Formula |
A1 |
Calculated |
INITVARS: DE_OPT 7, 0: SVar 99 = "F:\ Quality\PocketFormsData" |
B1 |
Calculated |
NVar 98 = Q_CONNECT 2, "GainSeeker71_B", "Y", "N": NVar 97 = Q_CONNECT 3, "GainSeeker71_B", "Y", "N" |
C1 |
Calculated |
SVar 98 = DIR (CONCAT SVar 99, "*.xpf"): If (Len SVar 98) = 0, GOTO [P1], (If (FSIZE (CONCAT SVar 99, SVar 98)) < 100, GOTO [O1]) |
D1 |
Calculated |
SVar 93 = CONCAT SVar 99, SVar 98: Nvar 98 = PocketForm SVar 93, (CONCAT SVar 93, ".xml") : If Nvar 98 < 1, (Message (CONCAT "Problem transforming file ", Svar 93, " (Error = ", CSTR Nvar 98, ")")) + GOTO [N1] : If Nvar 98 = -4, (Message "Please remove the template file from the data folder.") + GOTO [O1] |
E1 |
Calculated |
XML_MAP "Defect", "Defect_Description" : XML_MAP "Count", "Defect_Count" : Nvar 98 = XML_OPEN (CONCAT SVar 93, ".xml") : If Nvar 98 = 0, (Message (CONCAT "Problem opening file ", SVar 93, ".xml")) + GOTO [N1] |
F1 |
Calculated |
DB_RESET 0: If XML_NEXT = 0, GOTO [N1] |
G1 |
Date/Time |
MYSVAR "PocketFormDate" |
H1 |
Choose SPC Standard |
|
I1 |
Calculated |
SVar 95 = Prep_Q Trim DB_VALUE "Part_Number": SVar 94 = Prep_Q Trim DB_VALUE "Process": SVar 93 = CONCAT "Select PartNo From ", Table "DSTDS", " Where PartNo = '", SVar 95, "' And Process = '", SVar 94, "'": NVar 99 = Q_START 3, SVar 93: If NVar 99 = 1, GOTO [K1]: SVar 93 = CONCAT "Select Process From ", Table "DPROC", " Where Process = '", SVar 94, "'": NVar 98 = Q_START 3, SVar 93: If NVar 98 = 0, GOTO [K1] |
J1 |
Calculated |
Message (CONCAT "Standard not found (", DB_VALUE "Part_Number", ")") : EXIT |
K1 |
Calculated |
DB_SET_VALUE "Part_Number", SVar 95: DB_SET_VALUE "Process", SVar 94: DB_SET_VALUE "DateTime", [G1]: DB_SET_VALUE "Trace_1", Prep_Q UCASE Trim DB_VALUE "Trace_1" |
L1 |
Calculated |
SVar 93 = DB_DATA_SQL "DMS*": NVar 99 = Q_EXECUTE 2, SVar 93: If (INSTR UCASE Q_ERRORDESC, "DUPLICATE KEY") > 0, SVar 94 = " DUP", SVar 94 = DB_DATA_AUX_SQL "DMS?": If (STRCOMP SVar 94, " DUP") = 0, (If (STRCOMP SVar 96, [G1]) = 0, NVar 96 = NVar 96 + 1, ((NVar 96 = 1) + (SVar 96 = [G1]))): If (STRCOMP SVar 94, " DUP") = 0, (GOTO [L1] + DB_SET_VALUE "DateTime", DATE_INCR DB_VALUE "DateTime", NVar 96): If (STRCOMP SVar 94, "1") = 0, SVar 95 = DB_DATA_AUX_SQL "DMS*", SVar 95 = "": If (Len SVar 95) > 0, (NVar 98 = Q_EXECUTE 2, SVar 95) |
M1 |
Calculated |
GOTO [F1] |
N1 |
Calculated |
XML_CLOSE: SVar 93 = CONCAT SVar 99, SVar 98: FDEL (CONCAT SVar 93, ".xml") : FREN SVar 93, (CONCAT SVar 93, ". sav") |
O1 |
Calculated |
GOTO [C1] |
P1 |
Calculated |
Q_DISCONNECT 2: Q_DISCONNECT 3: If (TIMER_DELAY 0, 5, 0, 0, 0, -1, -1) = 1, GOTO [A1], EXIT |