5 programming examples, 1 dvc variable types, 2 hello program – High Country Tek emc-3L User Manual

Page 56: Programming examples, Dvc variable types, Hello program

Advertising
background image

5 Programming Examples

This section illustrates how the DVC710 is programmed. The first example is a traditional Hello program. Hello
introduces you to the basic steps in writing a DVC application and using multi digit blink codes. The second
example is an Elapsed Time Clock that introduces you to logic sequences. For both of these examples you only
need to have a DVC710 and the DVC Programming Tool / Program Loader Monitor software installed. Other
examples are not explained in detail, but key points are highlighted and explained.

5.1 DVC variable types

The physical I/O for the DVC module uses 10 bit architecture, the decimal values for the variables can be 0-

1023. Internal variables are 16 bit, or decimal values 0-65535. It is recommended to write the program logic
using decimal values, but some may find it easier using logic statements such as true / false, on/off. As a
reminder, using decimal values and logic statements, care must be used that the programmer knows the
decimal value of a logic statement

true’ and ‘on’ have a decimal value of 65535

false’ and ‘off’ have a decimal value of 0.
Other constants can be defined such as the statement below
Const yes = 52

This variable ‘yes’ has been given a value of 52.

Always remember to try a variable using the virtual display to fully understand the decimal value of the variable
when turned on and off.

5.2 Hello Program

This is an example program to introduce you to most of the DVC programming concepts.
It is designed to operate with only a DVC710 connected to your Windows PC computer using the DVC RS232
cable and a +12 Volt DC 1.0 amp power source. The DVC RS232 serial cable is used to load your application
into the DVC controller’s memory from your Windows PC.

Program Description
The Hello program will flash the Status LED on the DVC710 with a code of “2, 5” followed by a code of “3, 6”.

Process

No IOs will need to be configured for this example.

Enter the Hello code in the Always bubble, Compile/Make the program and load the “.PGM” file into the
DVC710.

On the next pages are the steps you should follow and the resultant screen displays you should see. First, the
Programming Tool screens are shown followed by the Program Load
Monitor screens.

Programming Steps
Execute the Programming Tool by double clicking on the Programming
Tool icon on the desktop or in the Windows Start Programs Menu HCT
Products folder. Double click on the DVC710 Master icon to open the
Master DVC configuration window.
Enter Hello in the Program Name field.

Next, enter the Always bubble code. Double click the Always icon in
the Project window. Enter the code as shown into the empty edit
window. Select the Make item from the Compile menu in the Project

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

Page | 56

Always Code for Hello program

Advertising
This manual is related to the following products: