Using program Stock control services via the command line / batch file
Use program: STOCK
There are several different options available:-
/IMPORTSTOCK - import stock
/OVERWRITESTOCK - overwrite stock
/ISSUESTOCK - issue stock
/ALLOCSTOCK - reserve stock
/RESET - month/year end report
/UDF - import
/UTF-8 - unicode 8 format import file
/UTF-16LE - unicode 16LE format import file
These are separate options for the Stock program.
Import stock
STOCK <filename> /IMPORTSTOCK [/FORMAT:n] [/UPDATEEXISTING] [/ADDNEWSTOCK] [/SEP:<separator>]
filename - file with stock information. This must include the correct file extension.
STOCK MyBoards.bdx /IMPORTSTOCK
The basic operation is to add incoming values to existing ones.
Import file
MFC15-03 2440 x 1220 98
MFC15-04 3660 x 1830 15
MFC15-05 2010 x 1680 61
Board library BEFORE AFTER
MFC15-03 2440 x 1220 320 MFC15-03 2440 x 1220 418
MFC15-04 3660 x 1830 26 MFC15-04 3660 x 1830 41
The format can be set via the System parameters in the user profile or via the /FORMAT switch. The format must match the file name extension.
STOCK MyBoards.bdx /IMPORTSTOCK /FORMAT:1
The numbers for the /FORMAT switch are:-
0 - BRD format
1 - BDX format
2 - Homag Automation stock file BESTAND.STK
3 - External SQL database
4 - User defined order - ASCII/Unicode CSV
5 - User defined order - Excel XLS
6 - User defined order - Excel XLSX
The Unicode format of files can be configured for stock import into the board library by using either /UTF-8 or UFT-16LE on the command line.
e.g. STOCK MyBoards.bdx /IMPORTSTOCK /UTF-8
To also add any new stock (Board and offcuts) use the /ADDNEWSTOCK switch.
STOCK MyBoards.bdx /IMPORTSTOCK /FORMAT:1 /ADDNEWSTOCK
Import file
MFC15-03 2440 x 1220 98
MFC15-04 3660 x 1830 15
MFC15-05 2010 x 1680 61
Board library BEFORE AFTER
MFC15-03 2440 x 1220 320 MFC15-03 2440 x 1220 418
MFC15-04 3660 x 1830 26 MFC15-04 3660 x 1830 41
MFC15-05 2010 x 1680 61
To increase / decrease any existing stock values with those in the import file use the /UPDATEEXISTING switch
STOCK MyBoards.bdx /IMPORTSTOCK /FORMAT:1 /ADDNEWSTOCK /UPDATEEXISTING
Import file
MFC15-03 2440 x 1220 98
MFC15-04 3660 x 1830 15
MFC15-05 2010 x 1680 61
Board library BEFORE AFTER
MFC15-03 2440 x 1220 320 MFC15-03 2440 x 1220 98
MFC15-04 3660 x 1830 26 MFC15-04 3660 x 1830 15
MFC15-05 2010 x 1680 61
For the BDX format only - a separator can be specified; this is useful where the BDX fields are separated by a character other than a comma, for example a colon.
STOCK MyBoards.bdx /IMPORTSTOCK /FORMAT:1 /SEP:":"
The separator can be specified as a character or a number e.g. /SEP:58 or /SEP:":"
For further details see Import/adjust stock from file
Overwrite stock
STOCK <filename> /OVERWRITESTOCK [/FORMAT:n] [/OVERWRITEEXISTING] [/SEP:<separator/]
[/BOARDOPTIONS:<nnn> /OFFCUTOPTIONS:<nnn>
filename - file with stock information. This must include the correct file extension.
STOCK MyBoards.bdx /OVERWRITESTOCK
The basic operation is to add new stock (Boards and offcuts) to the library.
Import file
MFC15-03 2440 x 1220 98
MFC15-04 3660 x 1830 15
MFC15-05 2010 x 1680 61
Board library BEFORE AFTER
MFC15-03 2440 x 1220 320 MFC15-03 2440 x 1220 320
MFC15-04 3660 x 1830 26 MFC15-04 3660 x 1830 26
MFC15-05 2010 x 1680 61
The format can be set via the System parameters in the user profile or via the /FORMAT switch. The format must match the file name extension
STOCK MyBoards.bdx /OVERWRITESTOCK /FORMAT:1
The numbers for the /FORMAT switch are:-
0 - BRD format
1 - BDX format
2 - Homag Automation stock file BESTAND.STK
3 - External SQL database
4 - User defined order - ASCII/Unicode CSV
5 - User defined order - Excel XLS
6 - User defined order - Excel XLSX
To overwrite the quantities of existing board codes use the /OVERWRITEEXISTING switch.
STOCK MyBoards.bdx /OVERWRITESTOCK /FORMAT:1 /OVERWRITEEXISTING
Import file
MFC15-03 2440 x 1220 98
MFC15-04 3660 x 1830 15
MFC15-05 2010 x 1680 61
Board library BEFORE AFTER
MFC15-03 2440 x 1220 320 MFC15-03 2440 x 1220 98
MFC15-04 3660 x 1830 26 MFC15-04 3660 x 1830 15
MFC15-05 2010 x 1680 61
For the BDX format only - a separator can be specified; this is useful where the BDX fields are separated by a character other than a comma, for example a colon.
STOCK MyBoards.bdx /OVERWRITESTOCK /FORMAT:1 /SEP:":"
The separator can be specified as a character or a number e.g. /SEP:58 or /SEP:":"
Use the /BOARDOPTIONS and /OFFCUTOPTIONS commands to control the overwrite process. e.g
STOCK.EXE /OVERWRITESTOCK /BOARDOPTIONS:1 /OFFCUTOPTIONS:0
The options are:-
0 = do nothing
1 = clear quantities
2 = remove items
3 = remove items and delete empty materials
For further details see Overwrite stock from file
Import or Overwrite stock from external SQL database
This follows the rules in the above sections. An example is:-
STOCK /IMPORTSTOCK /FORMAT:3 /UPDATEEXISTING /ADDNEWSTOCK
STOCK /OVERWRITESTOCK /FORMAT:3
The relevant system parameters must be set to make the link to the external database.
Issue stock
STOCK /ISSUESTOCK
This issues stock for the current run.
This can also include the command: /OPT to control the stock update, e.g.
STOCK /ISSUESTOCK /OPT:23
Options are:-
1 - Adjust boards
2 - Adjust offcuts
3 - Add offcuts
4 - Adjust edging
5 - Adjust fittings
6 - Adjust monthly summary
Reserve stock
STOCK /ALLOCSTOCK
Reservation records are assigned the current date in the 'cut date' field.
This allocates stock for the current run.
Reset Transactions
STOCK /RESET
Produces the End of Month / Year report. Stock transactions (audit trail) are automatically exported to an external file. The external file is located in the: Path for Stock libraries. For example:-
Transactions 2015-07-25 1305.csv
Import stock from file in user defined format
/UDF
Example: /UDF:"board import"
The default extension is ubx. If the file name is not set the program uses the file specified in system parameters.
Other options are:
[/UPDATEEXISTING] [/ADDNEWSTOCK] [/SEP:<separator>]
The /SEP option takes precedence over the separator specified in the board import parameters.
Notes
- separator can be any ASCII code between 32 and 127 except the following (0 to 9, A to Z or a to z).
- for /FORMAT the program runs in silent mode and any errors are sent to a .ERR file.
Stand alone Minimum free stock report
Use program: STOCK
STOCK /MINFREESTOCK
The output defaults to all materials rather than prompting for a range. The minimum free stock report appears on screen and may be printed in the usual way.