
www.instrument.com - Wednesday, January 7, 2009
Printer-friendly version of the page "EDAS CE Programmable Controller Software"
(URL: http://www.factoryview.com/ethernet-io-sample-programs.html)
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.
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.
|
|
83 kB |
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.
|
|
The Digital Inputs(Port 0) are configured to the following: |
256 kB |
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.
|
|
340 kB |
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.
|
|
164 kB |
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).
|
|
147 kB |
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.
|
|
157 kB |
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.
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.
|
|
This sample program toggles each digital output bit, 5 times. |
151 kB |
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.
|
|
This sample program toggles the digital output bits a large number of times. |
146 kB |
|
|
This sample program configures the module as two counters, with normal auxiliary digital inputs and normal auxiliary digital outputs. |
176 kB |
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.
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.
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.
|
|
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 |
Copyright 1996-2009 Intelligent Instrumentation Inc.