PxPlus User Forum

Twitter Twitter Twitter

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Mike King

Pages: 1 [2]
16
Tips and Techniques / Creating a log file to trap system failures
« on: October 21, 2019, 04:44:16 PM »
Whenever a application failure occurs within PxPlus (GPF, Segmentation fault, etc) the system will attempt to record key system information on the system LOGFILE in the hopes it will provide insight as to what caused the failure.  Given this, if you are having problems you should assign a log file to your tasks in order to assist in problem resolution, however managing these LOGFILEs can be problematic.

One simple solution is to create individual log file for each process, place these in a separate directory and have the system delete them if the process normally terminates.  Here is an example of some logic you can use to accomplish this:

Code: [Select]
x$="log_directory/log."+dte(0:"MMDD-%Hz%mz")+"."+str(tcb(89))+".txt
serial x$
setdev (0) set "Logfile" to x$

open (gfn) x$
setdev (lfo) set "DeleteOnClose" to "Yes"

Basically the logic creates a unique log file name based on the date, time and process id and assigns as the application LOGFILE.  In order to have the system automatically delete the file when the session closes, we OPEN the file on a global channel and then set its "DeleteOnClose" property so that when the PxPlus shuts down normally, the file will be deleted. 

Should the PxPlus process terminate abnormally for any reason the DeleteOnClose will not occur leaving the failing LOGFILE on the system for subsequent analysis.

NOTE: If desired you can have your application also write information to this LOGFILE using the SETTRACE RECORD string$

17
Tips and Techniques / Putting Bar charts in list boxes
« on: November 02, 2018, 03:47:16 PM »
One of the great features of PxPlus 2017 is its ability to include bar charts inside of formatted list boxes.  This functionality allows you to present a more visual representation of the data such as sales statistics, usage, and other numerical information.

For example:



Adding bar charts to formatted list boxes is done by using a 'FILL' mnemonic to define the column contents.  The 'FILL' mnemonic, when used in a list box, defines the percentage of the column that you want filled and the color. 

For example, a 'FILL'(50,"Yellow") will fill 50% of the column width with the color Yellow.  If you want multiple bars simply include multiple 'FILL' mnemonics. 

If desired you may also include standard text in the column contents with will be placed according to its position to the 'FILL' mnemonics. Should the total percentage filled plus text exceeds 100%., the contents will be truncated.  Should you want to make sure any text following the bar chart is displayed, keep the total filled less than 100%.

Below is a simple program that uses some hard coded data to show how you can create these type of bar charts.

Code: [Select]
  lv=10
  list_box lv,@(2,5,76,12),fmt="[Product]10C [Desc]15 [QOH]5C [Sold/Day]7C [Delivery]7c [Inventory Status]30",opt="r"
 !
  loaddata$=""
 !
  while 1
  read data productcode$,description$,qtyonhand,soldperday,delivery,end=*break
 !
  delivery=14+rnd(30)
  status=50+rnd(800)/10
  soldperday=(status*qtyonhand)/(delivery*100)
 !
 ! Compute likely state based on sales per day versus delivery time
 !
 ! Status > 100 means Delivery time exceeds days supply
 ! We want
 !
 ! status <= 80 to indicate good status (Green)
 ! status between 80->100 indicates marginal (Yellow)
 ! status over 100 indicates bad status (Red)
 !
 ! We divide all these number by 1.3 to allow for worst case of status of 130
 !
  dayssupply=qtyonhand/soldperday
  status=(delivery*100)/dayssupply
 !
  thebar$='fill'(min(80,status)/1.3,"GREEN") ! Show % good status
  thebar$+='fill'(min(20,status-80)/1.3,"YELLOW") ! Show % marginal
  thebar$+='fill'(min(30,status-100)/1.3,"Red") ! Show % Bad
 !
  loaddata$+=rec(iol=lv_iol)+$01$
  wend
 !
  list_box load lv,loaddata$
  escape
 !
 lv_iol: \
  iolist productcode$,description$,qtyonhand,soldperday,delivery,thebar$
 !
  data "BUS-3110-YLW","Bus - Yellow",684,12.89,32
  data "BUS-3111-CYN","Bus - Cyan",677,10.98,42
  data "BUS-3112-VIO","Bus - Violet",128,3.65,36
  data "BUS-3113-GRN","Bus - Green",173,4.21,41
  data "BUS-3114-RED","Bus - Red",122,3.92,37
  data "BUS-3115-BLU","Bus - Blue",65,3.24,18
  data "CAR-1320-GLD","Safari Jeep - Gold",585,18.75,37
  data "CAR-1321-CYN","Safari Jeep - Cyan",210,7.69,35
  data "CAR-1322-VIO","Safari Jeep - Violet",696,21.18,42
  data "CAR-1323-GRN","Safari Jeep - Green",235,5.72,25
  data "CAR-1324-RED","Safari Jeep - Red",665,27.43,29
  data "CAR-1325-BLU","Safari Jeep - Blue",543,14.39,34
  data "CAR-1410-SLV","Bug - Silver",487,15.03,30
  data "CAR-1411-ROS","Bug - Pale Rose",550,25.09,21
  data "CAR-1412-SEA","Bug - Seagreen",594,16.79,41
  data "CAR-1413-VIO","Bug - Violet",105,2.21,29
  data "CAR-1414-PRL","Bug - Pearl",376,11.56,32
  data "CAR-1415-WHT","Bug - White",151,2.64,39
  data "CAR-2220-PNK","Cabriolet - Fuschia",665,47.84,15
  data "CAR-2221-LME","Cabriolet - Lime",542,14.31,33

Colors:

If desired, you can specify two colors in the 'FILL' mnemonic.  When providing two colors, the first color will be the color used at the top of the bar blending down the second color.  If only one color is given, the system will attempt to shade it slightly with a lighter shade on the top and a darker shade on the bottom.

Grids:

Grids can also include horizontal bars in cells by setting the cell type to BarChart and setting the cells 'Text$ property to the percentage to fill and the colors desired.  Refer to our online documentation on the Grid directive under Horizontal Bar Charts in Grid Cells for more details.

18
Wish List / ODBC Access to Passworded Files
« on: August 14, 2018, 03:42:25 PM »
PxPlus native files can have passwords assigned to them to prevent unauthorized access and provide data encryption.  The ODBC driver however does not support any mechanism to supply file passwords thus the ODBC driver was not able to grant access to these files.

For PxPlus 2019 we have enhanced the native file encryption to include the ability to use the industry standard AES encryption algorithm so that more sensitive information such as credit cards numbers and personal data can easily and safely be included in your native files.

This however brings up the question as to whether we should provide access via ODBC and how this can be done.

Before we start looking into methods to provide this capability we would like to know if anybody would use this feature so we may plan accordingly.

19
FAQs / Why does PxPlus need/use external SSL libraries?
« on: August 07, 2018, 09:25:05 AM »
When running PxPlus on Linux/AIX or similar systems, the system will load the SSL libraries when the first reference is made to any component within the libraries is required.  The fact that the SSL libraries are not directly linked into the EXE allows these libraries to be independently updated.  The same is true for Windows however there we actually ship current SSL libraries with the product as opposed to relying on the OS supplying them.

Not all applications will need the SSL libraries, but the following PxPlus functions do require them to be present:

  • Any access to SSL/TLS communications (TCP, HTTPS, etc connections)
  • Use of the HSH functions other than the basic hashing algorithm (hash type 0)
Over time the SSL libraries on your system may need to be updated to address problems and deficiencies that may be discovered and corrected by the makers of openssl.   On Linux and most Unix based systems, these updates can be obtained using the OS supplied software update utilities.  For PxPlus for Windows, these can be extracted from newer versions of PxPlus and applied as needed.

Because security is so important we kept these libraries external from PxPlus so they may be updated as needed without having to replace/updated the whole PxPlus installation.

20
FAQs / What happens during PxPlus start up?
« on: June 29, 2018, 10:36:45 AM »
When a new session of PxPlus starts up a number of programs are run in order to establish the environment and launch your application.

The programs run are as follows:

  • Internally PxPlus determines the type of terminal being used to run PxPlus and runs its terminal setup program.  These are found in *dev directory.

    • For Windows this would be *dev/windows
    • For WindX connections using Simple CS, NTHost or the Application server this will be *dev/winterm
    • For Unix/Linux the system will get the terminal type from the environment variable TERM and run *dev/xxxxx where xxx is the terminal type in lowercase.  If this is not found the system will run *dev/termcap which will try to generate the device driver from the system termcap information.
      Note: For WindX connections using SSH or Telnet you should set the environment terminal type to winterm or ansi.

    The device driver will normally exit by running *TTY to load the device function and edit keys from the keyboard configuration file for the device.  This program will also check to see if there is a user device driver in *udev/devicetype and if present run it.

  • Once the terminal is configured an internal CALL to "*start.up" is executed to do the following

    • Call "*plus/start_up" to handle Plus special PxPlus extensions
    • Call your start up program specified in the environment variable PVXSTART or "START_UP" if the environment variable not set.
    • Check your product activation to see if it is current or needs updating

  • Runs the program specified on the command line if any (the "Lead" program found in LPG system variable).  If no program is specified the system will drop to the command line prompt.

If you want to set your system parameters, prefix(es), or do other initialization logic you generally will perform this in your start up program in the starting directory for PxPlus.  This will be run before your lead program is executed.

Note: As of PxPlus 2014, when using PxPlus Simple CS the system will run your START_UP program after the workstation connects.  Prior releases would run it before the connection was established.

Pages: 1 [2]