Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: Airmonitor USB Key Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
krommetje
Super User
Super User
Avatar

Joined: December 29 2004
Location: Netherlands
Online Status: Offline
Posts: 695
Posted: January 14 2011 at 02:12 | IP Logged Quote krommetje

Hello all,

I purchased an Airmonitor USB Key. It works very good and would like to get the readings into PH... I packed the installed driver and software into a zip and here is a screencap:



the installed driver can be dl here: (this is not the installation package, this is installed...)

http://www.krommetje.nl/tempstuf/airmonitor.zip

Here is information about the hardware:

Code:

Application Version: 2.19.0 (Id: Form1.frm 1053 2010-06-30 11:00:09Z patrik.arven@appliedsensor.com )

Device 0:
Name: iAQ Stick
Firmware: 1.4p1 $Revision: 346 $
Protocol: 1
Hardware: C
Processor: ATmega32U4
Serial number: S/N:394132463534150A0A05
Web address: www.voltcraft.de
Plot title: Air Quality Trend

Channels: 5
... Channel 0:CO2/VOC level
... Channel 1:Debug
... Channel 2:PWM
... Channel 3:Rh
... Channel 4:Rs
Knobs: 6
... Knob CO2/VOC level_warn1:2000
... Knob CO2/VOC level_warn2:3500
... Knob Reg_Set:162
... Knob Reg_P:3
... Knob Reg_I:10
... Knob Reg_D:0
Flags: 4
... WARMUP=&h0000&
... BURN-IN=&h0000&
... RESET BASELINE=&h0000&
... CALIBRATE HEATER=&h0000&

@2BC0;;DEBUG:
g_u16_loop_cnt_100ms=&h0A22;;\x0A



The program can log to a file so reading the log should be doable.... but connecting through Windows Messaging? Can that be done? perhaps the DLL-file?

can you codewizz help me?

Peter

Edited by krommetje - January 14 2011 at 02:20
Back to Top View krommetje's Profile Search for other posts by krommetje Visit krommetje's Homepage
 
airmonitor
Newbie
Newbie


Joined: January 19 2011
Location: Sweden
Online Status: Offline
Posts: 1
Posted: January 19 2011 at 12:13 | IP Logged Quote airmonitor

Hello

There are no required drivers for that, the Airmonitor program uses Windows HID subsystem.

There is a trick to enable the experimental built-in telnet server in Airmonitor, and then you can talk to that (localhost) to get samples out in real time. Maybe that is a way to talk to PH?

There are also discussions going on about a Linux server for the iAQ sticks.

Sign up as a beta tester to get info and links to latest beta releases:

Airmonitor mailing list

Also, you can send requests for additional features to that list and they may even add it within a week.

Latest Airmonitor beta release is 2.40.0, latest firmware beta 1.12p5.

For Voltcraft Airmonitor it's here:

Voltcraft Airmonitor



Edited by airmonitor - January 19 2011 at 12:20
Back to Top View airmonitor's Profile Search for other posts by airmonitor Visit airmonitor's Homepage
 
krommetje
Super User
Super User
Avatar

Joined: December 29 2004
Location: Netherlands
Online Status: Offline
Posts: 695
Posted: January 30 2011 at 07:24 | IP Logged Quote krommetje

Well, perhaps the telnet server could be a solution but also the log to file is a solution but I need to know if there is a limit to the filesize.

This engineeringmode is a good one...
I tried with telnet and it does work... perhaps there is a way to have PH setup a telnet conn. to the program.

Peter

Edited by krommetje - January 30 2011 at 08:07
Back to Top View krommetje's Profile Search for other posts by krommetje Visit krommetje's Homepage
 
krommetje
Super User
Super User
Avatar

Joined: December 29 2004
Location: Netherlands
Online Status: Offline
Posts: 695
Posted: January 30 2011 at 08:08 | IP Logged Quote krommetje

Code:

AirMonitor engineering mode
===========================
To enter the (unsupported) engineering mode, do the following:
- Hold down left CTRL-key and double-click on the right top logo


Posting a bug report
--------------------
If the program crashes you will most probably see a requester on the form
"Fatal program error in Airmonitor: ...".
As the requester say, the error has been copied to your clipboard.
Please do a "paste" operation when sending the bug report to us (e.g in an email).
That way you do not need to send us a screen dump of the error.


Get sensor information
----------------------
To get technical information about the connected sensors,
open "Help"-"About" and click on "Sensor info...".
You can copy and paste the text e.g into an email.

Sensor Reading time
-------------------
The time required for reading all connected sensors is shown as a constant flag "tr=XX.XX"
in the upper left corner. This time must not exceed the sampling interval.

File menu
---------
Some extra functions are now available:
- Save current buffer data...          ;           ; : Saves what you see on the screen to a file.
- Erase flash         & nbsp;         & nbsp;         & nbsp;         & nbsp;         & nbsp;         & nbsp;: Erases any records stored in the stick

The stick can record data when not enumerated (= connected to a power source only).
This is enabled by setting the "knob" LogInterval to something else than 0.
If the knob "LogInterval" does not exist the stick does not support that functionality.


Support tools
-------------
This menu is only available in engineering mode.

- Edit knobs...
This menu will give access to the "knobs" (analogue settings) in each stick,
like warning levels, PID setting etc. "Flags" are also displayed.
A value can be changed by double-clicking on it. You can get back to the factory settings by
sending the "RST" command to the stick(s), see Airmonitor command line options in the help file.

Some knobs (stored in EEPROM):
CO2/VOC level_warn1:      Lower warning level
CO2/VOC level_warn2: Upper warning level
   Reg_Set:        &nbs p;         &nbs p;         &nbs p;      Regulator setting. Don't touch.
   Reg_P:                                            Regulator P setting. Affects speed/stability. Don't touch.
   Reg_I:                                            Regulator I setting. Affects speed/stability. Don't touch.
   Reg_D:                                            Regulator D setting. Affects speed/stability. Don't touch.
   LogInterval:                           (Default 0=Turned off). Seconds between samples recorded to flash when
                                                               stick is powered but not enumerated (i.e in a wall plug).
   ui16StartupBits:       &n bsp;       Config bits:
                                                               Bit 0   : Default 1= Reset baseline on power up
                                                               Bit 1-15: Reserved
                                                               
Some flags (volatile):
(if bit 15 is set on a flag it is displayed in the Airmonitor graph)
   WARMUP                                            Stick is in warmup state and flashes the red/green led
   BURN-IN          ;           ;           ;           ; Burn-in minutes left
RESET BASELINE        &nbs p;   Sent from the PC to start a baseline reset procedure
CALIBRATE HEATER           Sent from the PC to start a calibrate heater procedure


    
Inside the form for this menu selection there is also a network section.
This is an experimental network support. Airmonitor can either be off the network,
act as a server (waiting for other AirMonitor programs to access it at the specified port),
or act as a client (connect to the specified port on the specified ip/host name).
Network support protocol is described later in the section "Network protocol".

- Recalibrate heater
This will send a command to all sticks and tell them to recalibrate the chip heater PID parameters.

- Search for updates
This will simply start a web browser and access the url stored in the first iAQ Stick.
Usually this brings you to the manufacturers web page.

- Upgrade firmware
This will place all connected sticks in DFU (Device Firmware Upgrade) mode. They will deatach
themselves from the USB host, reconfigure as DFU devices and re-connect.
The driver needed to talk to a DFU is included in Atmels FLIP package (search the Internet for "Atmel FLIP" or
browse to http://www.atmel.com/dyn/products/tools_card.asp?tool_id=388 6).
The driver is typically located in "C:\Program Files\Atmel\Flip 3.3.4\usb" after installation of the FLIP package.
When FLIP is installed you can use it (the windows gui or BATCHISP) to reprogram the sticks firmware.
Only do this on one stick at the time. You will need an Intel HEX file from the iAQ stick vendor with
the new firmware.
When the upgrade is done, reset the stick (reload eeprom defaults) by, at the command prompt, write
"airmonitor.exe /RST" (see Airmonitor command line options in the help file).

Settings-Plot
-------------
This menu exists in non-engineering mode as well, but now there are some more settings available.

Curve
-----
There are more curves available in a stick than just the VOC level. The new pull-down box gives you
the possibility to set the parameters for each available curve.
By default Airmonitor only shows the first curve.

Scroll
------
Unchecking this box will give "wandering cursor" type of graph instead of the scrolling graph.
The benefit is that the "wandering cursor" is less cpu demanding and easier to measure with the cursor.

Margins
-------
This sets the margins, in pixels, for the plot area.


----------------------------------------------------------


Network protocol
----------------
The network protocol can be tested by placing the Airmonitor program in "server" mode (see above) and
telnet to localhost 5800 (default). A telnet session might look like this:

c:\>telnet localhost 5800
iAQ USB server Version 2.40.0 svn:$Rev: 1702 $ $Date: 2011-01-17 11:23:13 +0100
Ready
0001:iAQ>

The available commands are:

add [USB:0] mcu|nChannels|CH0|.ChID|.Ylabel|.Yunit|.LastValue   ;  Add a sensor to the server
   help         &n bsp;  Help text
   bye         &nb sp;   Exit
   ls         &nbs p;    Get list of all sensors
m <message>     Print message
   trg         &nb sp;   Get all sensor readings
update [USB:0] nChannels|.LastValue|.LastValue|.LastValue...  &nb sp;  Update values for specified sensor
updateplot      Update server plot

If you are a client and you only wish to read out the values of the server sensors,
simply use the commands "ls" initially and then "trg" at regular intervals.
Remember to wait for the prompt "iAQ>" before sending a new command.

add
---
Adds a new "virtual" sensor to the server. In this case the server adds
a sensor provided by the connecting client.
The parameter is an identifying list of sensor channels, formatted like:

[interface:path] mcu|number-of-channels|channel-0-name|channel-0-id|channel-0 -Ylabel|channel-0-Yunit|channel-0-last-value
|channel-1-name|channel-1-id|channel-1-Ylabel|channel-1-Yuni t|channel-1-last-value
| ...
|channel-n-name|channel-n-id|channel-n-Ylabel|channel-n-Yuni t|channel-n-last-value

Example:
0003:iAQ>add [EMU:0:0]EMU|5|0|RND() level|ppm|1537|1|Debug|i16|1568|2|PWM|ui16|1542|3|Rh|ohm|15. 62|4|Rs|ohm|1556
0004:iAQ>add [USB:\\?\hid#vid_03eb&pid_2013#6&1f0ff5bf&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}:0]ATmega32U4|5|0|CO2/VOC level|ppm|350|1|Debug|i16|815|2|PWM|ui16|412|3|Rh|ohm|0|4|Rs |ohm|0
0005:iAQ>

help
----
Prints a short help text.

bye
---
Close connection.

ls
---
Lists all connected sensors. The list is formatted as sequential "add" commands and is ended with the "updateplot"
statement. This is so that a connecting AirMonitor can use the same parser for incoming messages as for queries.

Example:
0006:iAQ>ls
add [EMU:0:0]EMU|5|0|RND() level|ppm|1537|1|Debug|i16|1568|2|PWM|ui16|1542|3|Rh|ohm|15. 62|4|Rs|ohm|1556
add [USB:\\?\hid#vid_03eb&pid_2013#6&1f0ff5bf&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}:0]ATmega32U4|5|0|CO2/VOC level|ppm|350|1|Debug|i16|815|2|PWM|ui16|412|3|Rh|ohm|0|4|Rs |ohm|0
updateplot
0007:iAQ>

m <message>
-----------
This prints a message on the Airmonitor screen. For test purposes.

Example:

    0006:iAQ>m Hello World!
    0007:iAQ>

trg
---
Get current sample values. This gest a list in the following form:

update [interface:path]number-of-channels|channel-0-value|channel-1-value| ... channel-n-value

Example:

   0003:iAQ>trg
   update [USB:\\?\hid#vid_03eb&pid_2013#6&1f0ff5bf&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}:0]5|350|814|400|0|0
   update [USB:\\?\hid#vid_03eb&pid_2013#6&1f0ff5bf&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}:0]5|350|814|400|0|0
   0004:iAQ>

update
------
This command updates values for a "virtual" server sensor previously added with the "add" command.
The syntax is the same as the string response to the "trg" command:

update [interface:path]number-of-channels|channel-0-value|channel-1-value| ... channel-n-value


updateplot
----------
This sends a request to the server to update his plot, typically after a virtual sensor has been added.
The server plot will be cleared.


perhaps this helps guys?
Back to Top View krommetje's Profile Search for other posts by krommetje Visit krommetje's Homepage
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: January 07 2012 at 16:23 | IP Logged Quote dhoward

Peter,

Looking this over, writing a plugin would probably be the
cleanest way to integrate with the Airmonitor. Of
course, if you're not a programmer, I think the next best
way would be to use the PH generic socket plugin. To
give this a shot, follow the steps below:

Open PowerHome Explorer and navigate to PowerHome|Setup|Plugins. On a new line, give the plugin
an ID or AIRMON with Launch Data of PH_Socket.phsocket.
Leave the initialization data blank. Restart PowerHome.

Open PH Explorer and navigate to PowerHome|Triggers.
Create a new trigger. Fill out appropriate ID, desc,
etc. Set the Trigger Type to Generic Plugin, the Trigger
ID to AIRMON, the Trigger ID Number to Command 1 and the
Trigger Value to Option 1. This trigger will be fired
anytime data is received by the socket with the received
data in the [TEMP5] variable. As such, you should set
the trigger action type and action to a macro so you can
parse the returned data for the values you need. The
easiest way would probably be using one of the ph_regex??
functions.

Anytime you want to retrieve the values, you would
execute the following formula:

ph_picmd(5,"AIRMON",2,5800,0,"127.0.0.1","") +
ph_picmd(5,"AIRMON,1,0,0,"trg~r~n","")

This command should retrieve the current values which
should cause the trigger to fire with the returned data
in [TEMP5]. To finish the routine up, the macro that is
called from the trigger should probably have as its first
line the following formula:

ph_picmd(5,"AIRMON",3,0,0,"","")

The rest of the macro commands should parse the data.

Based upon what Ive read above, this should be a good
start. Of course, it may require some tweaking but I
would expect this to be pretty close to getting the data
into PH. You would then just want a timed event to
execute once a minute or so to call the first two
ph_picmd functions that initiate the data transfer.

Hope this helps,

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
krommetje
Super User
Super User
Avatar

Joined: December 29 2004
Location: Netherlands
Online Status: Offline
Posts: 695
Posted: January 11 2012 at 09:36 | IP Logged Quote krommetje

I am getting a synthax error on ph_picmd(5,"AIRMON",2,5800,0,"127.0.0.1","") +
ph_picmd(5,"AIRMON",1,0,0,"trg~r~n","")
you left a " out...


Edited by krommetje - January 11 2012 at 10:09
Back to Top View krommetje's Profile Search for other posts by krommetje Visit krommetje's Homepage
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: January 11 2012 at 10:05 | IP Logged Quote dhoward

Peter,

My bad, looking over the code you posted (and I posted as well), I left out a double quote. In the second ph_picmd, you need a closing double quote around AIRMON. It should look like this:

ph_picmd(5,"AIRMON",2,5800,0,"127.0.0.1","") +
ph_picmd(5,"AIRMON",1,0,0,"trg~r~n","")

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
krommetje
Super User
Super User
Avatar

Joined: December 29 2004
Location: Netherlands
Online Status: Offline
Posts: 695
Posted: January 11 2012 at 10:09 | IP Logged Quote krommetje

be back soon, trying now...

Update: trigger fires but a synthax error:





Peter

Edited by krommetje - January 11 2012 at 12:54
Back to Top View krommetje's Profile Search for other posts by krommetje Visit krommetje's Homepage
 
krommetje
Super User
Super User
Avatar

Joined: December 29 2004
Location: Netherlands
Online Status: Offline
Posts: 695
Posted: January 11 2012 at 11:25 | IP Logged Quote krommetje

Now all of a sudden the thing doesn't trigger anymore...
Servermode is active...

for some reason the plugin returns a time-out however when I telnet to both 127.x and network IP's the conn. works and measurements can be collected.

There is also a possibility to do a - menu - edit - copy graph -, then the measurements of the last 30 seconds can be pasted using Ctl-V to e.g. notepad...

Edited by krommetje - January 11 2012 at 13:00
Back to Top View krommetje's Profile Search for other posts by krommetje Visit krommetje's Homepage
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: January 11 2012 at 13:45 | IP Logged Quote dhoward

Pete,

It looks like it worked (for the most part) but the formula from the plugin to fire the trigger choked on the returned data (you can see part of the returned data in the error message). After you got the error, the plugin probably would no longer work until you either restart or reinit to clear the error condition.

Ive been through the current plugin code and there isnt currently an option to "escape" the return data to prevent this type of error. I could make an update to the plugin but it would be a little while before I could get to it.

I don't think it will work, but you might try this formula to see if you get anything returned. Since it doesnt appear that the socket is closed upon completion by the server, it may just hang but it doesnt hurt to try.

ph_sendsocketdata1("127.0.0.1",5800,6,"trg~r~n")

May just get lucky .

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
krommetje
Super User
Super User
Avatar

Joined: December 29 2004
Location: Netherlands
Online Status: Offline
Posts: 695
Posted: January 14 2012 at 07:53 | IP Logged Quote krommetje

well you are correct, after a reinit, the macro can be run again and again a synthax error...
see:


and when I then use the ph_sendsocketdata1("127.0.0.1",5800,6,"trg~r~n")

you are right again: nothing is returned:


When I do a reinit after this, and send the raw socketdata again, nothing ir returned...

Edited by krommetje - January 14 2012 at 08:05
Back to Top View krommetje's Profile Search for other posts by krommetje Visit krommetje's Homepage
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: January 16 2012 at 16:29 | IP Logged Quote dhoward

Pete,

Can you copy/paste the actual text of the formula syntax error so I can try and determine what is actually causing the error? It may be something that can be easily fixed/worked around.

Thanks,

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
krommetje
Super User
Super User
Avatar

Joined: December 29 2004
Location: Netherlands
Online Status: Offline
Posts: 695
Posted: January 20 2012 at 02:26 | IP Logged Quote krommetje

Here it is Dave: (sorry for the wait...)

Code:

Syntax Error in Formula: ph_pitrigger(~'AIRMON~',1,1,0,232,5800,~'update [USB:\\?\hid#vid_03eb&pid_2013#7&1f246763&0&0000#{4d1e55b2-f 16f-11cf-88cb-001111000030}


Peter

Edited by krommetje - January 20 2012 at 02:27
Back to Top View krommetje's Profile Search for other posts by krommetje Visit krommetje's Homepage
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: January 25 2012 at 12:01 | IP Logged Quote dhoward

Peter,

Hmmm...if that was all that was sent then I guess thats what would cause the syntax error. The function isnt even complete with a closing parenthesis...not to mention its missing the closing quote and another parameter. I was thinking it was something in the data but it may actually be a bug of some sort. I'll have to look at the sourcecode and see what I can come up with.

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
krommetje
Super User
Super User
Avatar

Joined: December 29 2004
Location: Netherlands
Online Status: Offline
Posts: 695
Posted: January 29 2012 at 07:58 | IP Logged Quote krommetje

OK, I'll be waiting...

BUMP

Edited by krommetje - February 05 2012 at 10:58
Back to Top View krommetje's Profile Search for other posts by krommetje Visit krommetje's Homepage
 
krommetje
Super User
Super User
Avatar

Joined: December 29 2004
Location: Netherlands
Online Status: Offline
Posts: 695
Posted: October 14 2012 at 07:53 | IP Logged Quote krommetje

Hi All,

this key can now log to a file:

Code:

"Date time[yyyy-mm-dd Hh:Nn:Ss]"      "CO2/VOC level[ppm]"     
2012-10-14 14:41:33      870     
2012-10-14 14:41:34      865     
2012-10-14 14:41:36      864     
2012-10-14 14:41:37      870     
2012-10-14 14:41:38      867     
2012-10-14 14:41:39      875     
2012-10-14 14:41:40      869     
2012-10-14 14:41:41      862     
2012-10-14 14:41:42      857     
2012-10-14 14:41:43      862     
2012-10-14 14:41:45      865     
2012-10-14 14:41:46      863     
2012-10-14 14:41:46      861     
2012-10-14 14:41:47      861     
2012-10-14 14:41:48      855     
2012-10-14 14:41:49      857     


can we use this to read measurements?
Back to Top View krommetje's Profile Search for other posts by krommetje Visit krommetje's Homepage
 
krommetje
Super User
Super User
Avatar

Joined: December 29 2004
Location: Netherlands
Online Status: Offline
Posts: 695
Posted: October 14 2012 at 10:33 | IP Logged Quote krommetje

Hey Guys,

Here is what I get thus far:
- a check is made to see if the logfile exists
- I retrieve the last measurement with ph_readfile(...
- The whole measurement is stored in a GV like this:
Code:
2012-10-14 17:25:01      691

- then the file is deleted and the macro waits 60sec.
- it checks to see if the logfile exists and then raads the file again.
- stores the former measurement in a different global for history purposes.
- goes back to the beginning of the macro

I would like to have the date and time filtered out so that the last 3 decimals
stay in the global.

can you help me with this?

Peter
Back to Top View krommetje's Profile Search for other posts by krommetje Visit krommetje's Homepage
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: October 14 2012 at 11:55 | IP Logged Quote dhoward

Peter,

I put together a little macro based on what you posted.
Code:
insert into macroheader values ('AIRMON','AirMonitor',0,0,1);
insert into macrodetail values ('AIRMON',1,26,'',NULL,'START',0,'','');
insert into macrodetail values ('AIRMON',2,27,'',NULL,'if(ph_fileexists("c:\download\airmon .log") = 0,"WAIT","")',0,'','');
insert into macrodetail values ('AIRMON',3,15,'[LOCAL1]',NULL,'ph_readfile("c:\download\airmon.log")',0,'','');
insert into macrodetail values ('AIRMON',4,38,'',0,'ph_deletefile("c:\download\airmon.log") ',0,'','');
insert into macrodetail values ('AIRMON',5,10,'AIRMON',NULL,'long(right(ph_getvar_s(1,1),7) )',0,'','');
insert into macrodetail values ('AIRMON',6,38,'',0,'ph_writefile("c:\download\airmonhist.lo g",0,ph_getvar_s(1,1))',0,'','');
insert into macrodetail values ('AIRMON',7,26,'',NULL,'WAIT',0,'','');
insert into macrodetail values ('AIRMON',8,31,'',NULL,'60',0,'','');
insert into macrodetail values ('AIRMON',9,27,'',NULL,'"START"',0,'','');


It assumes a global variable named AIRMON to store the most current value. It also assumes the file to check for is located in c:\download\airmon.log. Of course, you can change these settings to match your actual environment. I also take whatever is logged and add it to a history log so that you'll always have history as well.

The only trick part is in line 50. I cant tell from what you've posted if the air value is separated from the date/time by a tab character or space characters. The formula assumes space characters and may need tweaking if its a tab. Since the macro only checks for the existence of the file every 60 seconds, I assume its possible that the airmonitor can actually save more than 1 reading. So the formula takes the rightmost 7 characters from the file (2 for the crlf, 3 for the value, and 2 space characters or 1 space and a 4 digit value). It then passes this to the long() function which will take that 7 character value and convert it to a numeric. This has the dual effect of stripping off the crlf and any leading spaces.

Hope this helps,

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
krommetje
Super User
Super User
Avatar

Joined: December 29 2004
Location: Netherlands
Online Status: Offline
Posts: 695
Posted: October 15 2012 at 11:27 | IP Logged Quote krommetje

Hi dave,

Yep, a small tweak:

I had to change long(right(ph_getvar_s(1,1),7) to long(right(ph_getvar_s(1,1),8) for all 3 digits to be imported and I added 5 more GV's for history:



And here is a small bargraph page a quickly whippedup...



I two words: IT WORKS

funny thing is... when A lot of people are in the room where the key measures, you see the airtrend going bad...

Edited by krommetje - October 15 2012 at 11:43
Back to Top View krommetje's Profile Search for other posts by krommetje Visit krommetje's Homepage
 
krommetje
Super User
Super User
Avatar

Joined: December 29 2004
Location: Netherlands
Online Status: Offline
Posts: 695
Posted: November 10 2012 at 14:22 | IP Logged Quote krommetje

Hey guys,

I have 15 historic GV's and a current GV, all measurements of the airquality. I want to calculate a trend out of these 15 GV's in relation to the current measurement.

How can this be done?

Peter
Back to Top View krommetje's Profile Search for other posts by krommetje Visit krommetje's Homepage
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum