16 circuit protection, Circuit protection – High Country Tek emc-3L User Manual

Page 16

Advertising
background image

functionality. This step will help to minimize changes to the program at a later date. This step could take
considerable time, but will make the program much sampler to write. Refer to appendix F for an example.

Separate different functions into different logic Sequences and Bubbles.
It is not incorrect to place all of the program logic in the always code, but it can slow down the program and
make it more difficult to troubleshoot. Time critical logic should be contained in the ‘always’ code. Different
functions should be contained in individual Logic Sequences. For example, a pump control’s logic can be
contained in a bubble by itself. The logic to control the track drive of a bulldozer can be contained in a bubble
by itself. These functions may not be as critical as something such as looking for a high pressure situation.

Use meaningful variable names.
The limit on variable size is 32 characters. A variable that isn’t an input or output device is called an internal
variable. An internal variable that is for Valve1 minimum current setting for the program loader monitor could be
labeled Valve1MinCurA. This naming convention could be used throughout the program. An EEmem variable
for a valve’s minimum current setting could be named eeValve1MinCurA. Below are some other examples.

Joystick_1_AI1 – Analog Input # 1 (Variable names in capital letters designate an abbreviation.)
Output_shaft_RPM_UI1 – rpm Universal Input # 1.
EEC1.engine_speed_lo – The low byte of the engine rpm from the J1939 network.

eeDVC61_Contrast – EEmem variable.
ScreenCount – internal user defined variable.

Declare all variables in one location.
Declare all variable names in one area of one bubble. This area would include unsigned integers (Uint),
EEmemory variables (EEmem), Timers (timer), constants (const) and others. Declaring all the variables in one
location could make it easier to add another variable at a later time without duplicating the variable name and
provides for a cleaner, more structured program. Variables can be organized by type or grouped by function
depending on the preference of the programmer.


Comment important information into the program.
Information such as Programmer’s name, date of program creation, revision history, and any description of
something that is difficult to understand is appreciated by anyone offering assistance in troubleshooting the
program. Explaining a complex math equation can be beneficial at a later date to refresh the programmer’s
memory of why a function was built the way it was and to assist in troubleshooting. Comment as much or little
as necessary. Comments do not contribute to the compiled program (.PGM) file size. Remember to add a colon
(‘) before starting comments. The Intella software interprets the (‘) that the information to the right is not to be
compiled.

'Programmer's Name: J.Q. Codewriter

'Program creation date: 5/28/2010

'Revision history:

' Rev. 1, 5/28/10 - initial release

' Rev. 1.1, 6/12/10 - Modified Always code to add temperature sensor to engine coolant

' Rev. 2.0, 11/25/10 - Modified 'Tank level' bubble to add logic and hydraulic fluid level sensor

'Program description: This program will...

'The math function for the tank level takes into consideration the ...

1.16

Circuit Protection

Each of the modules require adequate circuit protection. Use AGC type fuse. Each module requires 150mA for
internal circuitry. These modules also include the dvc61. If the module is capable of driving an output, then the

P/N: 021-00163, Rev. A.0 - for V5.2 Tools

Page | 16

Advertising
This manual is related to the following products: