Home  |  Buy on line  |  Contact us  |  Terms & Conditions  | 
  



New FOX Board G20



Buy on-line


FOX Board G20
FOX Board LX832
Easy Guardian
SMS FoxBox
Acme Systems srl




FOX Board LX832 is discontinued
To be informed about its availability and prices please CONTACT US
To know more about the new FOX Board G20 GO HERE

Build a virtual instrument Macromedia Flash MX

This article shows how to implement a virtual instrument using Flash MX 2004 and how to interface it with a FOX board LX to measure four different voltage levels


Fig. 1 - Virtual voltmeter

On this figure you can see the virtual voltmeter used in this example in action (you need to have a flash player installed on your browser).

Clicking on the grey buttons it simulates a voltage reading and moves the level indicator. In this demo, the positions are fixed at 0.5 Volt steps for practical reasons and simplicity but the voltmeter is able to show all the intermediate values.

The indicator movements simulates a real analog voltmeter with realistic acceleration and inertia behavior.

A C program daemon will run on the FOX Board LX to reads the voltage values from an A/D converter and push them, by a XML protocol on a TCP/IP socket, directly inside the virtual instrument.

To read voltage values on the FOX board LX we'll use an A/D converter chip illustrated in this article: Using the I2C bus.

The C code vmeter.c is a modified version of pcf8591nd.c that can accepts socket connections from the virtual instrument and push continuously the values in XML format.

The XML format we have chosen to transmit the voltage readings is this:

<analog>
  <input line="0" value="12"/>
  <input line="1" value="203"/>
  <input line="2" value="34"/>
  <input line="3" value="125"/>
</analog>

Where:

  • <analog> indentifies the begin and the end of data transmission from the FOX Board.
  • <input> contents the values read from each A/D chanel. line is the A/D line id (0 to 3) and value is the value read in the range 0 (0 Volts) to 255 (3.3 Volts).

Compile (Compile a C application) the program vmeter.c, copy the executable on /mnt/flash and run it:

# cd /mnt/flash
# ./vmeter

Open a telnet client on your PC to the FOX address and port 7000 (i.e. telnet 192.168.0.90 7070) to see the incoming XML data stream:


XML data coming from vmeter.c

Close the telnet session and copy the files vmeter4.swf and vmeter4.html in the /usr/html/local directory of the FOX board.


Virtual voltmeters from the FOX board LX web page

Open your browser on the FOX Board Web page:
http://192.168.0.90/local/vmeter4.html

Run again /mnt/flash/vmeter on the FOX board LX and press the button Connect on the Flash synoptic so try to rotate the four trimmers connected to the A/D converter.

The virual voltmeter will report promptly the voltage changes measured on each A/D chanel.

Download

  • vmeter.c Source in 'C' language of the XML server for the FOX (Compiled with Webcompiler)
  • Makefile Makefile to compile vmeter.c inside the SDK
  • etraxi2c.h Hearder filer requested by vmeter.c
  • i2c_errnoc.h Hearder filer requested by vmeter.c
  • vmeter4.html HTML file to be copied in the /usr/html/local FOX directory
  • vmeter4.swf Flash MX 2004 synoptic animation with 4 voltmeters con 4 voltmetri to copy in the /usr/html/local FOX directory
  • vmeter4.fla Source Flash MX 2004 of the synoptic panel with 4 voltmeters

Related articles

Related links