Program Routing

Program Routing Statements using XMLNotepad editor

Routing Statements are defined in this section. Routing statements are used to control the operation of the program. They specify how each step will terminate and what will happen when the termination occurs. Up to 32 Routing statements can be specified. Specifying a Routing Statement does not mean that it will be used. In order to use the Routing Statement it must be assigned to a particular step in the Steps section. Routing Statements can be assigned in more that 1 step. The Routing Statement defines a decision that the device will repeatedly examine and execute whenever it happens to be true. There are 3 types of Routing Statements:

  1. Termination: Used to generate a step termination. All termination statements are examined by the micro controller approximately once per second. When a termination statement is true the step will terminate. This same termination statement will also specify the next step the routine should execute. It will also specify if a counter should be incremented and if the accumulated data should be preserved.
  2. Conditional: Conditional routing statements are only used by the routine when a step terminates based on a termination statement. Once a termination has occurred then all conditional statements assigned to the step are also examined. The first conditional statement found to be true will over-ride the GoTo, Counter and Preserve values specified in the termination statement that caused the termination. The termination will still occur, but these other items that specify the action to take are changed. Conditional statements are examined from the lowest statement number to the highest. The first conditional statement found to be true is the one that takes effect.
  3. Message: Message routing statements specify which text message will be displayed in the console Results Data area. A message is very useful because it can examine the numerical data from the terminating and provide a text answer to the results. For example you can have the message statement calculate if a parameter is within range or defined threshold and give the user a meaningful message such: Pass, Fail, Good, Bad, Marginal etc. etc. There is a wide range of messages to select from. See Program Messages section for detail.

When the Program listing is Opened & Previewed in Battery Console, the format for Routing Statements will look like:
Reading Routine Statement

  • n – Routing Statement number
  • type – Defines type of routine statement. Must be: spare, term, cond, mess
  • parameter – One of the available operational parameters. See list.
  • operator – Operator used to determine if routing statement is true/false. See list.
  • value – numerical value the parameter is compared to
  • step – For term & cond types this is the step number the program will route to when statement is true. For mess types this is the message number.
  • preserve – This optional item will appear in the preview listing only if preserve=yes otherwise preserve=no is assumed.
  • Inc CountX – This optional item will appear if a Counter is assigned to this routing statement.

Example: R8:(term)If voltage < .75 GoTo 2 (Battery removed during session)

Build these routing statements by specifying items in this Routing section of the xml file.

Routing_Note

This is just any helpful comment used to document the statement.

Type

Select from: spare, term, cond, mess

  • spare – Routing Statement is unused
  • term – This Routing Statement will be used to generate a termination
  • cond – This Routing Statement will only be examined when a termination occurs. If this cond Routing Statement happens to be true then this GoTo step number will determine the next step. This cond Routing statement GoTo step number will over-ride the term GoTo step number. Note that cond statements will not generate a termination. They only provide for alternate routing if and when and term statement is true. If more than one cond statement is true then the first one evaluated (lowest number) will be the one that take precedence.
  • mess – This statement is only used to calculate a message for display purposes whenever a termination occurs.

If

This is the parameter that gets compared to the specified value using the specified operator. Use all lower case and observe proper syntax. Select from:

  • blank: Routing Statement not used.
  • voltage: Battery voltage(V).
  • current: Positive value expressed in Amps(A).
  • time: Step Time expressed in minutes. Minimum Value 0.02min(1.2sec), Maximum Value 938249min(651 days). Do not use Value=0 because it will disable the term statement.
  • break: Special time counter used to break away from a step, perform some function (eg. IR test) and return to step keeping Step Time and other accumulated values intact. Use Preserve=yes when breaking and Preserve=yes when returning.
  • amphour: Positive accumulated charge value expressed in AH.
  • watthour: Positive accumulated energy value expressed in WH.
  • %capacity: Measured AH/Rated Capacity expressed as a percentage.
  • %watthour: Measured WH/Rated WH expressed as a percentage.
  • tapercurrent: Measured Current/Rated Rated Capacity expressed as a percentage.
  • negdv: This is how much the voltage has dropped from the peak charge voltage. Used to terminate nicd.
  • temp: Battery Temperature(°C) as measured with the thermistor cable.
  • dtdt: Rate of temperature rise(°C/Min) as measured with the thermistor cable.
  • irtest: Battery Internal Resistance(m&#8486).
  • chargefactor: Charge Factor is the ratio of the mAH for this step to the mAH for the last Discharge step since a reset. The device will remember the mAH from the last discharge and calculate the Charge Factor on subsequent steps. This can be used to charge as a % of a previous discharge, or perhaps even perform another cycle based on the results of this step. This can save time by allowing you to do conditional charging, discharge or cycling based on the results and not have to perform more steps than required.
  • bulktimefactor: When termination is based on current, the device will remember the step time and calculate a Bulk Time Factor on subsequent steps. The Bulk Time Factor is the ratio of the Step Time from the last step, that terminated on current, to this Step Time. This allows for equalization charging and other enhanced charging algorithms.
  • counter1-7: Route based on the value of counter1 to counter7.

Operator

Select from: =, <>, >, >=, <, <=

Value

Numerical value that parameter is compared to. Note: A value of 0 will disable the term statement.

Go_To

For term or cond statement types this is the next step that will execute when this step terminates. For mess statements this is the message number to be associated and displayed with the Results Data. Using Go_To = 0 will mean advance to the next step. This is very useful because it means the termination statement is generic and can be used many times in multiple steps. This will reduce the number of routing statements required because you can use the same one in many different steps. Statements assigned in multiple steps must be of the same Type

Counter

There are 7 internal counters available. They can be used for information or to control advanced program routing. Putting a counter number from 1 to 7 will cause the counter to increment when the step terminates. Note: when a step is terminated the Results Data is saved to memory before the counters are incremented. This means when using Counter 1 as a cycle counter you have to increment Counter 1 before beginning the step that will eventually correspond to Counter 1. This way Counter 1 (#) in Results Data will correspond correctly to the right step. This may mean inserting an extra step for the sole purpose of getting the counter to increment before a new step begins.

  • Counter 1: This is normally used as a cycle counter and is displayed in the Real Time Data Cycle: field. It is displayed in Saved Data in the ” # ” column. This counter is cleared at the beginning of each Reset step
  • Counter 2: General use counter displayed in Real Time Data section. This counter is cleared at the beginning of each Reset step
  • Counter 3: A special counter that only gets reset on power off/on. It does not get cleared with a new session. It can be used as a session counter for daily/weekly production counts. This counter is incremented at the beginning of each Reset step.
  • Counter 4: A special permanent counter that gets saved to flash memory. This counter can be used to keep a record of production. Like a car odometer it is never reset. Count 4 is displayed in the lower status bar section 8 on the main window.This counter is incremented at the beginning of each Reset step.
  • Counter 5: General use counter. This counter is cleared at the beginning of each Reset step
  • Counter 6: General use counter. This counter is cleared at the beginning of each Reset step
  • Counter 7: General use counter. This counter is cleared at the beginning of each Reset step

Preserve

In some cases it may be desirable to keep accumulated values, such as mAH, StepTime, etc. when advancing to another step. This allows the new step to just continue on. Normally you would always clear these values. However the data can be preserved when using an algorithm that is still continuing the same task with different parameters. Use 1 of 2 possible values:

  • no: Do not preserve any real time data when advancing to the next step.
  • yes: Preserve accumulated data when advancing to the next step.

Routing Notes:

  • Any step that does not have a method of termination defined will never advance to another step, unless, of course, it is forced with a vector command such as the software “Restart” or the hardware “Vector” push button.
  • Any Routing statement that is not assigned in some step is simply ignored. Leaving unused Routing Statements in the listing for possible future use is fine.
  • When preparing custom routines be aware that you must Save the data for any step that is to appear in the Results Data. Do this by setting Save=yes for the desired steps in the xml program file. Also note that Counter 1 is a special counter that gets saved with the Results Data and is used to assign a number(#) to the Result Data row. Results Data is saved to memory before counters are incremented. Therefore it is necessary to increment Counter1 before beginning the step that will eventually correspond to Counter 1. Keep this in mind when programming custom routines to ensure that Counter1(#) will match with the correct Results Data row.
  • If a statement is assigned in more that one step, it must always be assigned as the same type: term, cond, mess.