Send StruxureWare Lite aka Can2Go data to Energy Operation
Gateways and Energy Servers
Schneider Electric support forum to share knowledge about product selection, installation and troubleshooting for EcoStruxure Panel Server, PowerTag, Com'X, Link150…
Send a co-worker an invite to the portal.Just enter their email address and we'll connect them to register. After joining, they will belong to the same company.
You have entered an invalid email address. Please re-enter the email address.
This co-worker has already been invited to the Exchange portal. Please invite another co-worker.
Please enter email address
Send InviteCancel
Invitation Sent
Your invitation was sent.Thanks for sharing Exchange with your co-worker.
Link copied. Please paste this link to share this article on your social media post.
2014-10-2007:01 PM
Send StruxureWare Lite aka Can2Go data to Energy Operation
Even though, we do have the great article from , many people have been asking for this old post from the defunct energyoperation.info blog. So there it is:
In our second topic about the StruxureWare Lite offer, we’ll show you how, thanks to the Lua scripting languague, you can create native EO file format (or any file format) and send them to Energy Operation.
First you need to identify the data you want to send and create the metes in Energy Operation. Again, since it’s all scripted in Lua, you could use whatever you want, but in our case, I decided to use the Name of the objects. You can see that in your explorer window:
For the temperature sensors, just select the sensor in the tree, and it will also appear in the grid.
Log in to Energy Operation, and create your metering tags where you want to see the data:
Now Energy Operation is ready to receive the data.
Next, we need to create the actual csv file in the StruxureWare Lite box. To do that, we need to create a Lua script.
In the explorer view, click on Add Objects (the little + green icon):
Then in the filter, select “Lua Program”. Select of of the available program which will then appear as selected in the right list, and click on Add Objects.
Now your script will appear in the Explorer windows for your SmartStruxure Controller.
Select the newly created script, and rename it to whatever makes sense to you. In our case, it’s “Create EO File Lua Program”.
Here is the code you need to put:
if createEOFileInit == nil then -- Initialization
createEOFileInit = true
-- Interval Length in minutes
intervalLenght = 5
-- Initialize list of devices.topics (tags) to be trended
-- The Object Name is the Unique ID in Energy Operation and should be unique to the implementation.
file, info = io.open(fileName, "a+") -- write to CSV
if file then
size = file:seek("end")
if (size == 0) then
-- file is empty. Ensure to add the header
file:write(header)
end
file:write(buffer)
file:close()
end
arglist = ""
flag = 1 -- Action completed once, no need to run more until the next interval
end
if timer.min % intervalLenght ~= 0 then
flag = 0
end
end
-- --------------------
As specified in the header, there are two parameters that you need to modify. The interval lenght (in minutes) which you should try to match to your utility. In addition, the list of objects that you want to export.
Once you run it, after the first interval is passed, you will start to see a file in the upload manager of your controller.
Now we only have to send the file. To do so, we will create another Lua script. Here is the code for it:
os.rename(fileName, "previous_" .. fileName) -- Create a new backup with current file
frequency = 3600
elseif ftp_err ~= nil then -- error
print("ftp put error : " .. ftp_err)
frequency = 60
end
end
end
-- -------------------------
The script will by default send data every hour, but you can change this, by changing the frequency at the end of the script from 3600seconds to whatever you would like. Be sensible about it though!
Finally, make sure to change the host, username and password to send the data to the right implementation.
That’s it! What thing we need to highlight though. The box currently does not support SSL encryption. You are sending data over FTP which means the data is not encrypted. After talking to the team, they seem to have a plan to add support for HTTPS, so more good things to come.