Current Cost Support Forum

A support forum for Current Cost users, partners and developers. Covering hardware, software and web.
Site Announcements

The support forum is moderated Monday to Friday, UK time. To submit a support ticket, please email: helpme [at] currentcost .com

It is currently Sun Feb 26, 2017 8:46 am

All times are UTC [ DST ]




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
PostPosted: Thu Feb 02, 2012 3:01 pm 
Offline

Joined: Sat Apr 16, 2011 1:10 pm
Posts: 328
Location: East Sussex
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.


Top
 Profile  
 
PostPosted: Sat Feb 04, 2012 10:35 pm 
Offline

Joined: Sat Apr 16, 2011 1:10 pm
Posts: 328
Location: East Sussex
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group