Fieldpine Logo Documentation Home  

Fpos.dll


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 nameSupplies 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

-data "ODBC;dsn=mydb;uid=MANAGER;pwd=password;"
writeSets 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.
traceDisplay a message at each point of the startup process. Used to analyse startup problems. Refer Fpos Startup Process for more details
quickStart the POS slightly quicker, by disabling all extra startup steps, such as the splash screen.
coreNot documented at this time.
xmlSpecifies that an extract file should be formatted in XML form.
noplugDo 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.
novaultDisable vaults. Do NOT use on trading systems as this will potentially break the distributed database engine by allowing uncontrolled access to the database engine.
norunDo not start the POS, simply execute any command line arguments and then exit.
quitUsed 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.
debugDisplay 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.
impersonateAttempt 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.
configDisplay the config screen immediately. The POS exits when the config screen is cancelled.
repeatWhen 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.
nocheckSkip any environment checks, such as valid system dates. This can result in a fractionally faster startup time, but disabling this checking is not recommended.
loadRetired. Do not use.
masterRetired. Do not use.
cleanRetired. Do not use in new installations
mergeRetired. Do not use in new installations
standbyRetired. Do not use in new installations
extractExtract 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.
poscSpecifies 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.
delayInserts a playback delay when using journal playback. This allows journals to be played at a uniform speed regardless of recording speed.
location=NNManually set the location number, overriding the system defined value.
lane=NNManually set the lane number, overriding the system defined value.
ui=NNManually set the User Interface to use, overrriding the value defined in the database being used.
webStart the POS in web server mode, which allows it to handle HTTP requests, but not display a screen to allow interactive trading.,
titleProvides 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] filenameStart 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
nosetupRemoved. Do not use
testInvokes various internal tests. Possible values are
  • (16 Apr 2016, P1920) "Speed" to perform disk write speed check
  • "table" to perform a series of read tests on the database layer. Also includes "perf" test.
  • "perf" causes a timed database transaction to be executed
  • "writeloop". Generates a large number of write transactions by editing products. No recommended for systems except dev/test environments. Do not use on production machines.
  • "regression". Reserved to Fieldpine.
password or pwdProvides a password to start the POS, if required.
code directorySets 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 directorySpecifies 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=NNSets 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
--posgreenInvokes a sub mode of the launch program (posgreen.exe) to build self extracting EXE files and other installation and distribution options (more)

Retired options

odbcsharedRetired 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.

HKEY_LOCAL_MACHINE\Software\Fieldpine\POS

POSLane
(Required) A DWORD value that holds the Lane number of this system. This value is used to extract control paramters from the database.
POSLocation
(Required) A DWORD value that holds the Location number of this system. The location number defines the store in a chain of stores.
WorkDir
(Optional) Specifies a directory to which the POS moves when started.

HKEY_LOCAL_MACHINE\Software\Fieldpine\POS\POSDir

DAODir
(Required) A string value that holds the reference to the database to be used.

HKEY_LOCAL_MACHINE\Software\Fieldpine\POS\FreeTime

default
(Required) A internal value that holds installation control attributes. Moving or altering this value will result in POS stopping due to licence check failures.

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 files

Internal Architecture

All POS versions consist of the following components

Core EngineThe 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 EngineThe 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.
SecurityInvolves validating that active users have either direct permissions, or role permission to perform an operation.
Database LayerAn 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
SettingsA 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.
PluginsRun time loaded extensions to provide specialised functions.
EdtConfiguration DLL (fposedt.dll) used to assist in altering POS setup.
UIThe screen presentation layer.
Web ServerThe 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:

  1. If the main dll (fpos.dll, lite.dll, retailmax.dll or one of several others) is not found then
  2. Check if this executable contains packed files and instructions
  3. Extract all packed files to the directory
  4. 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.