Current Cost Support Forum
http://currentcost.com/support/

An Alternative To This Product.
http://currentcost.com/support/viewtopic.php?f=16&t=20571
Page 1 of 1

Author:  Automan [ Thu Feb 02, 2012 3:01 pm ]
Post subject:  An Alternative To This Product.

I have been using this on a Samsung NC10 Netbook but after about ten hours of operation it starts to play up (to check for errors in data).

The data in the window starts to be in the past as I guess it is not keeping up with real time logging and it also eats lots of ram e.g. 900Megs.

It may just be the underpowered PC?

Anyway, based on a PowerShell script by SeekerAfterTruth I am trying this.

Code:
### EnviR Data Output.ps1 ############################################
#
# Routine to display power recorded by a Current Cost Monitor.
#               
################################################################

# Set Com Port To Match Your PC

$loop_forever = $true
$CommPort_in="COM7"
$BaudRate=57600

################################################################
$port_in= new-Object System.IO.Ports.SerialPort $CommPort_in,$BaudRate,None,8,one
$port_in.Open()

$data=$port_in.Readline() #Discard a possibly partial msg

do {
   $data=$port_in.Readline()
   Write-Host ($data)
   ($data) | Out-File -filepath "cc_debug.txt" -append
   } While ($loop_forever='true')
$port_in.close()
Write-Host ("DisplayENVI completed")



It makes a compatible cc_debug.txt in the folder you invoke this from, only one file edit is needed is the com port of your Envi or EnviR display.

It has only been running a few hours so I don't know if it works better or worse.

Automan.

Author:  Automan [ Sat Feb 04, 2012 10:35 pm ]
Post subject:  Re: An Alternative To This Product.

PowerShell seems to work well at this and I have made log files over 40Mb in size.

With this comes a new problem, which date & time did the event occur?

Thus a modified version which creates two files.

A classic version and a new version which contains the PC date and time.

Code:

### EnviR Data Output V2.ps1 ###################################
#
# Routine to save XML output by EnviR Display Unit.
#               
################################################################

# Set Com Port To Match Your PC

$loop_forever = $true
$CommPort_in="COM3"
$BaudRate=57600

################################################################
$port_in= new-Object System.IO.Ports.SerialPort $CommPort_in,$BaudRate,None,8,one
$port_in.Open()

$data=$port_in.Readline() #Discard a possibly partial msg

do {
   $data=$port_in.Readline()
   Write-Host ($data)
   $d = Get-Date -format d
   $a = Get-Date -format T
   "<dt>" + $d + "-" + $a + "</dt>" + ($data) | Out-File -filepath "cc_debug1.txt" -append
   ($data) | Out-File -filepath "cc_debug.txt" -append
   } While ($loop_forever='true')
$port_in.close()
Write-Host ("DisplayENVI completed")


Automan.

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/