Overview
Fpos.dll is the main engine for driving retail operation. This is a single DLL which functions differently depending on the environment in which it is run. Fpos.dll is typically started by either PosService.exe or PosGreen.exe It requires these specialised launch programs and cannot be hosted by random programs.
Use
Command line arguments
data name | Supplies an alternative database name to the one used by default. The name argument can either be a path of a file, which is
typically used when accessed Microsoft Access databases are used. If the keyword prompt is used, then the POS will display an interactive file open screen, which allows you to select a file to open manually.
If you are using ODBC data-sources, such as SQL/Server, then you specify the data argument with the keyword ODBC in the first position and the relevant dsn information required for the
ODBC connection following this. For example |
write | Sets the database to be writable. If you use the -data option then you must also specify -write as the POS will default to read only mode. When the database name is not manually specified then the POS opens the database in read/write mode automatically. |
trace | Display a message at each point of the startup process. Used to analyse startup problems. Refer Fpos Startup Process for more details |
quick | Start the POS slightly quicker, by disabling all extra startup steps, such as the splash screen. |
core | Not documented at this time. |
xml | Specifies that an extract file should be formatted in XML form. |
noplug | Do not automatically start plugin modules. This option is useful for support where devices such as fuel controllers may not exist, which normally blocks the POS from starting. Using noplug overrides this action and allows the database to be opened. |
novault | Disable vaults. Do NOT use on trading systems as this will potentially break the distributed database engine by allowing uncontrolled access to the database engine. |
norun | Do not start the POS, simply execute any command line arguments and then exit. |
quit | Used for debugging purposes. Causes the POS to exit before starting. Superseeded by the norun option. This keyword may change or be removed in a future release. |
debug | Display the debug screen immediately. The screen is displayed before the database has been initialised, so many of the options on the debug screen will not function. |
impersonate | Attempt to locate any valid lane and location information in the database and use this information. If this command is not specified and the registry values do not match the database then the installation wizard is invoked. This command is most useful for support, and should not be used in live store environments. |
config | Display the config screen immediately. The POS exits when the config screen is cancelled. |
repeat | When using journal playback, repeat the journal forever. The only reliable way to abort this sequence is to reboot the computer, often by powerfailing the system. |
nocheck | Skip any environment checks, such as valid system dates. This can result in a fractionally faster startup time, but disabling this checking is not recommended. |
load | Retired. Do not use. |
master | Retired. Do not use. |
clean | Retired. Do not use in new installations |
merge | Retired. Do not use in new installations |
standby | Retired. Do not use in new installations |
extract | Extract the data from a table to a named file. The command syntax is -extract table filename The POS will extract all the records from the table into the named file. The file is created if required. If an XML format file is required the option -xml can be specified to change the extracted file format. |
posc | Specifies a POS-Command to be executed. This option is often used to invoke scripts or other overnight processing. When used the -norun option may be used to restrict POS function to executing the command and then stopping. A background POS can be invoked to execute commands while another foreground POS is operational. When used like this changes between the two systems are not synchronised. |
delay | Inserts a playback delay when using journal playback. This allows journals to be played at a uniform speed regardless of recording speed. |
location=NN | Manually set the location number, overriding the system defined value. |
lane=NN | Manually set the lane number, overriding the system defined value. |
ui=NN | Manually set the User Interface to use, overrriding the value defined in the database being used. |
web | Start the POS in web server mode, which allows it to handle HTTP requests, but not display a screen to allow interactive trading., |
title | Provides an alternative title for the POS, if it has a title bar. Most POS screens do not have these title bars, so this option has no effect. |
journal [play|record] filename | Start the POS using testing journals for either recording or playback of a previous operation. This mode is used by testing environments and is not used in normal operation |
nosetup | Removed. Do not use |
test | Invokes various internal tests. Possible values are
|
password or pwd | Provides a password to start the POS, if required. |
code directory | Sets the source directory path for where system code will be loaded from. The default is the current directory, but this may be changed where code is located in a different drive or share to the active directory. |
work directory | Specifies the work directory into which the POS should operate from. This parameter is reserved for core mode operation, which is an internal mode of operation used in multi user BIS servers. |
maxtime=NN | Sets a maximum elapsed time in seconds. If this program is still running after NN seconds a background thread will call TerminateProcess() to force delete the process. This is designed for background jobs using PosGreen in a non interactive way. There are some rare technical exceptions that may cause this maxtime value not to kill the job, so while this is a safety rail it is not guaranteed. The value NN must be greater than 60 seconds or it is ignored |
--posgreen | Invokes a sub mode of the launch program (posgreen.exe) to build self extracting EXE files and other installation and distribution options (more) |
Retired options
odbcshared | Retired P1105. The way databases were connected changed in P1105 (early 2000s) and this option was removed. To enable
the same functionality, add "dbcdao:isolate=1" to the fpos.ctl file.
(V2.4.5.5) By default ODBC connections do not share a common link and the POS opens multiple connections to the source database. On some combinations of database engines and ODBC driver versions, this might not be the desired behaviour. This switch causes the POS to use a single shared connection rather than multiple connections. |
Registry Values
POSGreen.exe does not require registry values to operate, other than licensing control. The following registry values are used for upward compatability only.
Fpos.ctl & Fpos_all.ctl & Fpos_fieldpine.ctl
During startup the files fpos.ctl and fpos_all.ctl are read and processed to define generic operating conditions for the Point of Sale. The file fpos.ctl is designed to be extremely lane specific and should contain commands that apply only to this individual lane. The file fpos_all.ctl should hold all general purpose configuration commands, and this file is intended to be cloned among multiple lanes
The file Fpos_Fieldpine.ctl contains commands required as part of the current version being run. This file is reserved to Fieldpine and should not be changed
Full details on fpos.ctl filesInternal Architecture
All POS versions consist of the following components
Core Engine | The main logic of the system. This component is the central brain of the POS responsible for interacting with the Operating System and controlling other components. |
Script Engine | The script engine is responsible for processing script, including parsing, precompiling and runtime execution. Script is used heavily to allow store level customistion without the use of complex programming languages. |
Security | Involves validating that active users have either direct permissions, or role permission to perform an operation. |
Database Layer | An external DLL that provides the link between the POS and the database engine being used. These DLLs are loaded by name if they match the pattern dbc*.dll |
Settings | A range of parameters that control the broad operation of the POS and the environment in which it operates. Altering a setting can have wide implications for how the POS processes in various circumstances. |
Plugins | Run time loaded extensions to provide specialised functions. |
Edt | Configuration DLL (fposedt.dll) used to assist in altering POS setup. |
UI | The screen presentation layer. |
Web Server | The built in web server, which enables web serving, POS to POS communication and SOAP over HTTP transport. |
Distribution Kit Building
With version 1.7.x.22 of PosGreen.exe the code is able to self build a distribution executable. This allows you to build a single download URL which when run will either install or normally run on a target machine. Most users will not need to manually build distribution kits as described below, you can mark a folder/URL in Gds and it will automatically create the distribution exe.
To invoke building mode, start PosGreen.exe with the first argument as "--posgreen". There are TWO hyphens at the beginning of this argument.
The format "PosGreen --posgreen /pack filename" packs the filename into the the PosGreen executable. Filename can be either a single file or a wildcard. You cannot add: posgreen.exe, posgreen.exe_packed, *.delete files. If a file is already in the packed executable, it will not be updated or replaced. If you issue the command several times it will add to the existing output file, but if the output file does not exist it will be created.
The output program is called posgreen.exe_packed. Generally you will want to rename this file when you are finished building.
Example - adding only key files
posgreen --posgreen /pack *.ui posgreen --posgreen /pack *.dll posgreen --posgreen /pack *.txt del posgreen.exe rename posgreen.exe_packed posgreen.exe
Example - adding all files
posgreen --posgreen /pack *.* copy posgreen.exe_packed \\CodeServer\Fieldpine\posgreen.exe
Startup Logic for Distribution Executables
The larger distribution PosGreen.exe is used exactly as the normal (smaller) PosGreen.exe files. However when starting PosGreen has the following additional logic:
- If the main dll (fpos.dll, lite.dll, retailmax.dll or one of several others) is not found then
- Check if this executable contains packed files and instructions
- Extract all packed files to the directory
- Repeat main loop one more time.
These steps ensure that PosGreen.exe will unpack files on initial installation only. It will NOT function as a version update. Once installed the system can continue to perform version updates as normal; the packed PosGreen.exe will eventually be replaced with a smaller unpacked version, but by this time the unpacked information is no longer required.