Automatically start and run LabVIEW VI

Here is an AutoIT script and executable that takes a LabVIEW VI path, opens the VI and then runs the VI.

Script and download below.

#include <File.au3>

If $CmdLine[0] > 0 Then

; assume first parmaeter is the file and path of the VI
Local $sFilePath = $CmdLine[1]

Local $sDrive = "", $sDir = "", $sFilename = "", $sExtension = ""
Local $aPathSplit = _PathSplit($sFilePath, $sDrive, $sDir, $sFilename, $sExtension)

; generate the window title
Local $sTitle = $sFilename & $sExtension & " Front Panel"

; run the VI
ShellExecute($sFilePath )

; wait till the VI opens
WinWaitActive($sTitle)

; send CTRL-R to start to RUN
Send("^r")

EndIf

Open and Run LabVIEW VI AutoIt
Open and Run LabVIEW VI EXE

Use as follows;

open-run-labiew-vi.exe "C:\Users\UserName\Desktop\VIName.vi"

Log solar generated to PVOutput with LabVIEW

Here is the full LabVIEW code to read a CMS2000 inverter solar generation, including power, voltage and temperature, and then logging it to PVOutput.

The data is read from the CMS2000 every 1 second and averaged over 5 minutes, as PVOutput only supports 5 minute intervals. The averaged value gives a better representation of the parameter compared to a single read every 5 minutes.

Logged is power generated, inverter temperature, and DC voltage. PV Bean Counter only supports AC voltage which won’t vary too much, DC voltage is a lot more interesting, DC current can be calculated from the power and voltage values.

Don’t forget to change the API key and system ID strings.

Use the linked images below when dragging into LabVIEW as a snipped, not the thumbs.

Read CMS2000 inverter to PVOutput VI

Read CMS2000 inverter to PVOutput

Read CMS2000 inverter to PVOutput

Connect to CMS2000 solar inverter with LabVIEW and read power

After a few weeks of ‘chasing the sun’, finally got something I am happy with, LabVIEW connects to the CMS2000 via serial interface and reads the parameters.

Programmed as a state-machine, basic error checking and fail safes.

Note, I am using a RS232 to TCP/IP adapter, I am guessing a lot of the peculiarities are due to that.

Don’t use the thumb snippet, but the linked image.

Read CMS 2000 Inverter with LabVIEW

Read CMS2000 invert in LabVIEW VI

Phoenixtec (CMS2000) inverter protocols spreadsheet