Mar 6 2013
Check if program is running
I was having trouble with my solar monitoring software closing down at random for no apparent reason every three to seven days, I was unable to find any pattern to this behavior.
To solve the problem I scheduled this vbscript to run every hour. I did not write it from scratch, I used examples to get the result you see here. The script looks for the program by name and starts the program if it’s not running. I have changed the script to notepad.exe for testing, change it to whatever your program name is.
The program I am using is SG-View.exe from solar-guppy. My solar hardware consists of 16 x 185 watt panels, a Xantrex T 2.8 inverter and an old laptop with a serial port. SG-View.exe is the program that collects the data from the inverter. The data is then uploaded to pvoutput.org.
There are some lines you will want to comment out once you are sure its working, like this message box Msgbox(“Notepad is not running, I will start it now”) it is only there for testing (put a ‘ in front of the line to comment it out).
'Msgbox("Notepad is not running, I will start it now")
Copy this code, open notepad paste it and save it as filename.vbs where filename is what ever you want to call it.
'Check if a program is running, if not run it. Set WshShell = WScript.CreateObject ("WScript.Shell") Set colProcessList = GetObject("Winmgmts:").ExecQuery ("Select * from Win32_Process") '============================================================================================== For Each objProcess in colProcessList If objProcess.name = "notepad.exe" then vFound = True End if Next If vFound = True then 'WshShell.Run ("C:\Windows\system32\cmd.exe") 'Add sleep if needed wscript.sleep 50 'send keys and kill taskin needed 'WshShell.sendkeys "taskkill /IM notepad.exe" 'wscript.sleep 50 'WshShell.SendKeys "{ENTER}" Msgbox("Notepad It is already running, nothing to do") Else Msgbox("Notepad is not running, I will start it now") sub shell(cmd) ' Run a command as if you were running from the command line dim objShell Set objShell = WScript.CreateObject( "WScript.Shell" ) objShell.Run(cmd) Set objShell = Nothing end sub shell "notepad.exe" End If
May 30 2013
Setup a Current Cost EnviR energy monitor to upload to pvoutput.org
I wanted to setup my Current Cost EnviR energy monitor to upload to pvoutput.org. I already have my solar generation uploading. It took a while to get it working because I could not find a few small pieces of information that I needed.
I could not find out what software pulled the data from the EnviR and created the log files for pvoutput integration service. It turned out that pvoutput integration service does this you just need to configure it.
One piece of vital information that was missing (or I could not find it) you need to create a folder for the EnviR log files (like c:/logs/CC) otherwise the pvoutput integration service will not start and you will see this below in pvoutput\logs\pvoutput.log
Startup Error: Number of directories must match number of formats
pvoutput.ini
dir=c:/logs/xantrex,c:/logs/CC
format=xantrex,currentcost
currentcost.ini
All I changed was the com port to 10 (one the EnviR using).
By sysadmin • Solar • 1