eVC++ Sample Programs

EdasCE Programming - When developing programs that will run the EdasCE in a standalone or client/server environment you will need to install Microsoft's eMbedded Visual C++ 3.0 on your computer .  Note!!! Only the 1995-2000 version works. Please contact the factory (or see the SDK page) for the URL to download this free version.

Developing programs that run as standalone applications on the EdasCE raises the bar a bit as far as program challenges and goals are concerned.  With the Netlink software all the network communication was done transparently for you.  Sockets were opened and network communication was established.  You need not have done anything except execute the appropriate API calls to make it all happen.  That goes away with on-board programming.  The possibilities and versatility of the EdasCE become greater, as does programming development effort.

The EdasCE is essentially a headless device.  It has no monitor, no keyboard, no mouse.  It has no graphics abilities.  Any data that needs to go the outside world needs to get sent over the network  Any information that the unit requires is received from the network. 


Edas-2002M-1 Port-wide Sample program

This program toggles the 4 digital outputs on Port 1, and reads the value detected on digital input port 0. The value returned from reading port 0 will be a value between 0 and 255. The zipped file contains the complete Microsoft eMbedded Tools C++ project, a drawing that shows the workspace configuration, and a drawing that shows the external wiring configuration of the digital output lines to the digital input lines.


edasce_2002_dio.ZIP

83 kB


Edas-2002M-1 Bit-wide Sample program.

Digital Inputs(Port 0) are configured to the following:
Bit 0: DIOBIT_INPUT_COUNT_EVENT...high speed 16-bit counter (20Khz).
Bit 1: DIOBIT_INPUT_COUNT_UP...standard up counter (250hz max).
Bit 2: DIOBIT_INPUT_COUNT_DOWN...a standard down counter (250hz max).
Bit 3: DIOBIT_INPUT_LATCH_LOW...latch on a high-to-low transition.
Bit 4: DIOBIT_INPUT_LATCH_HIGH...latch on a low-to-high transition.
Bit 5: DIOBIT_INPUT_LATCH_STATE_CHANGE...latch on change of state.
Bit 6: DIOBIT_INPUT_NORMAL...standard Digital Input bit.
Bit 7: DIOBIT_INPUT_NORMAL...standard Digital Input bit.

Digital Outputs(Port 1) are configured to the following:
Bit 0 is configured as DIOBIT_OUTPUT_PULSE_HIGH.... 500ms duration.
Bit 1 is configured as DIOBIT_OUTPUT_DELAY_HIGH.... 500ms delay.
Bit 2 is configured as DIOBIT_OUTPUT_SQUARE_WAVE....100ms pulsewidth.
Bit 3 is configured as DIOBIT_OUTPUT_NORMAL.


edasce_2002_bit.ZIP

The Digital Inputs(Port 0) are configured to the following:

256 kB


Edas-2003M-1 Analog Input Sample program

The program demonstrates 4 different analog reading methods:

1. Read 1 analog channel, one time only.
2. Read 1 analog channel, 16 times with a single nsAIRead() command.
3. Read 16 analog channels, one time only.
4. Read 16 analog channels, 16 times with a single nsAIRead() command.


edasce_2003.ZIP

340 kB


Edas-2004M-1 Digital Input Sample program.

The EDAS-2004M Digital Input Module provides 16 channels of 5V, 24V, 120V or 240 Volt input range.

The digital inputs provide 500 V channel-to-channel isolation with one return per channel. The 16 channels are arranged as two 8 bit ports, Port 0 and Port 1.  LEDs provide visual feedback on the channels’ present states.

Reading each port results in a value reading between 0 and 255, representing the 8 bits of digital inputs that it reads.


edasce_2004.ZIP

164 kB


Edas-2005M-1 Digital Output(FET) Sample programs.

The EDAS-2005M Digital Output Module provides 12 channels of open drain, 24 VDC digital outputs. The digital outputs have 500 V channel-to-channel isolation with one return per channel. The 12 channels are arranged as two ports. Port 0 has 8 channels and Port 1 has 4 channels.

This module supports read back allowing the software to determine the value last commanded for each output. Each channel has a hardware switch that determines the channel’s power-on state. When a switch is in the on position during the power-up reset, the corresponding channel will be turned on.

Module has 12 digital outputs for 24 volt levels. FET outputs capable of switching to 24 volts or ground (PNP/NPN).


edasce_2005.ZIP

147 kB


Edas-2006M-1 Analog Output Sample programs.

The EDAS-2006M Analog Output Module provides 8 channels of 0 to 10 V analog output. This module uses eight 12-bit digital-to-analog converters (DAC). The module has a single LED that will blink when an output is updated.

This sample program demonstrates how to set up a EDAS-2006 Analog output module and  writes analog output voltages to the 8 analog output channels.

The program starts by writing 10 volts to all 8 outputs, and then repeats the process,  cutting the voltage by half, 8 times.


edasce_2006.ZIP

157 kB


Edas-2008M-1 Serial Module Sample programs.

The EDAS-2008M Serial Module provides four RS-232 serial ports. The serial ports are interfaced through 9-pin D-subminiature connectors on the bottom of the unit. The EDAS-2000E base unit can support 6 serial modules for a total of 25 com ports, one on the base plus 24 on additional serial modules.


edasce_tm2500.ZIP

This eVC++ 3.0 sample program demonstrates serial communication on the EdasCE. The EdasCE CPU module has a single serial port. Each Edas-2008M-1 module adds 4 more serial ports to the system. Up to 25 serial ports can work on a single EdasCE system. This program detects how many serial ports exist on a EdasCE system and creats a communication thread for each detected serial port. The serial ports are configured for 9600 baud, 8 bit, 1 Stop bit, no parity, and no hardware control. The program waits for data on each serial port. Upon receiving a 'CR', the program transmits back what it has just received. The program exits, when it receives a '-' (minus character) from any of the serial ports. The TM2500 in the zipped file name refers to the model number of our Serial Data Terminals used to test the serial communication with the EdasCE system.

197 kB


edasceserialsample.zip

The SerialSample sample application runs on the EDAS CE. It shows, in *very* simple terms, how to open and configure a serial port. It shows how to receive data from and write data to the port.

6.6 kB


Edas-2010M-1 Digital Output Relay Module Sample programs.

The EDAS-2010M Relay Output Module provides 12 channels of single-pole/single-throw normally open relay contacts capable of switching 2 A at either 250 VAC or 30 VDC. This module has power-up initialization hardware allowing the configuration of the power-up state of each output.


edasce_2010.ZIP

This sample program toggles each digital output bit, 5 times.

151 kB


Edas-2011M-1 Digital Output (Triac) Module Sample programs.

The EDAS-2011M Digital Output Module provides 12 solid state (triac) outputs capable of switching 2 A at 120 VAC. This module has power-up initialization hardware allowing users to configure the power-up state of each output.


edasce_2011.ZIP

This sample program toggles the digital output bits a large number of times.

146 kB


Edas-2015M-1 Quadrature Module Sample programs.


Edas_2015.ZIP

This sample program configures the module as two counters, with normal auxiliary digital inputs and normal auxiliary digital outputs.

176 kB


eVC++ Programming using Threads

A thread is a method available in eVC++ where you can generate independently running sub-routines within you application.  Threads are not a new concept, they are used in many other programming languages.  With repect to the EdasCE, this means you can write sub-routines for each EdasCE module and have them run pretty much independent of each other.  One thread could be reading the analog inputs on a Edas-2003M, while another thread could be reading the digital inputs on a Edas-2004M.

The following Sample program incorporates threads for all of the EdasCE modules.  If the program detects a specific module, a thread is created to access or contol that specific module.

 


edasce_thread_demo.ZIP

This program demonstrates the use of threads. The program determines which modules are present and creates a thread for each module. This way each module can act somewhat independently of the other modules. All modules detected will be configured to a specific state. Analog modules will be set to +/- 10 volts and a gain of one. Digital modules will ge programmed and accessed as port wide inputs and outputs. Analog output modules will be configured to 0-10 volts. Serial modules will have each COM port set to 9600,N,8,1. The program runs for 30 seconds and terminates. In real world applications the program would most likely run in a continuous mode.

284 kB


Reset/Watchdog Timer

The EdasCE has a watchdog timer that may be activated by an application. When the watchdog timer is activated, an application must "tickle" the timer every 2000 ms or the unit will reboot.

In the following sample program, we demonstrate how to generate a DLL that contains calls to activate the Watchdog timer and a sample program that activates and tests the Watchdog Timer.


edasce_watchdog_dll.ZIP

This sample program creats a DLL containing call routines to start, stop, and tickle the Edas WatchDog Timer. It is recommended that this DLL be saved in the \Storage Card\hardware folder on the EdasCE.

14.8 kB


edasce_watchdog_test.ZIP

This program demonstrates the use of a 'watchdog.dll' file that contains calls for enabling the watchdog timer in the EdasCE. A thread is created that continiously 'tickles' the EdasCE watchdog timer. The program runs for 30 seconds, then issues a command to stop 'tickling' the watchdog timer and the unit reboots. NOTE!!! When running in debugger mode expect the debugger to crash since the unit reboots and all connection to it stops.

177 kB


EdasCE NV-RAM Option

The EDAS-2000E is available with an optional 128 Kbytes of battery RAM. This NV-RAM provides high speed Non-Volatile storage. Applications such a fast control loops can use the NV-RAM for to hold state variables, allowing an application to recover variables after a power loss. The NV-RAM is memory mapped to 0xA0000 to 0xBFFFF.

 


edasce_nvram.ZIP

This project performs a simple demonstration on how to write and read data in the Non-Volatile RAM on the EdasCE. This is an introduction to get you familiar with accessing the NV-RAM.

163 kB


edasce_nvram_read.ZIP

This project reads the content of the NV-RAM. Data in this non-volatile section of memory should be retained through a power disruption. First, run the 'Edase_nvram" sample. Then, power cycle the unit, and run this program. The data written into NV-RAM should not change.

163 kB


edasce_nvram_ai.ZIP

This project reads the 16 analog inputs of a Edas-2003M-1 module, and saves the voltage values in the NV RAM. The program then reads back and displays the data in the NV-RAM. This program should be run in debug mode to see the results.

178 kB


Subscribe to our newletter:
Your name:
Email:
 Edit your data






lanpointcom pageid545
lanpointcomdate20080516
lanpointcommonth200805
English

1