Storing data in Excel (Modicon M340, Magelis/Vijeo HMI)

rankhornjp

Member
Join Date
Dec 2008
Location
Georgia
Posts
241
I'm building a test station for water pumps. The HMI will display GPM, KWh, pressure, vacuum and speed.

Client currently manually writes down these values to keep for QC purposes. They want the data automatically entered in an Excel file.

How can this be done?


Thanks
 
Later today I will create a demo app from AdvancedHMI to show how to read from a Modbus device and write it to an Excel spreadsheet. I'll post a link to it here when I get it done.
 
I created a quick demo project that will read from a ModbusTCP device and write the value to an Excel spreadsheet. You can download the project from here:

https://sourceforge.net/projects/advancedhmi/files/advancedhmi/3.5/SampleProjects/

It is called AdvancedHMIModbusToExcel.zip

To run the program as is, extract the downloaded file and run \AdvancedHMI\bin\Debug\AdvancedHMI.exe

If you want to customize it, you will need to download and install Visual Studio from here:

https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx
 
Also to add.... If you want this to also show the values from your PLC and use as the HMI:

- Open solution in Visual Studio
- Project->Build
- In the Solution Explorer, double click MainForm
- Click on the ModbusTCPCom1 at the bottom
- Set the IPAddress to the address of your PLC
- From the ToolBox, add a DigitalPanelMeter
- In the Properties Window, set PLCAddressValue to the Modbus address such as 40001
- Run the application (F5)
 
Interesting project.

Not sure how quickly you need to or can transfer the data to Excel.
Another option is to log the data at the M340 and store it there.
Subsequently you may create a batch file in Windows to connect to the controller via ftp and extract the log file, as required or periodically.
Excel will be able to open the file and use the data after that.
 
I created a quick demo project that will read from a ModbusTCP device and write the value to an Excel spreadsheet. You can download the project from here:

https://sourceforge.net/projects/advancedhmi/files/advancedhmi/3.5/SampleProjects/

It is called AdvancedHMIModbusToExcel.zip

To run the program as is, extract the downloaded file and run \AdvancedHMI\bin\Debug\AdvancedHMI.exe

If you want to customize it, you will need to download and install Visual Studio from here:

https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx

Thank you, I'll take a look and see if I can incorporate it in this project.

Interesting project.

Not sure how quickly you need to or can transfer the data to Excel.
Another option is to log the data at the M340 and store it there.
Subsequently you may create a batch file in Windows to connect to the controller via ftp and extract the log file, as required or periodically.
Excel will be able to open the file and use the data after that.

They test a pump for ~30mins and they want the data stored after each pump.

Do you have a working example of using the processor and batch file?
 
Hello rankhornjp,

The batch file created in Notepad and saved as a .bat would be something like the following:


:: set the user name used to log into the FTP server
echo user USER>> ftpcmd.dat
:: set the password used to log into the FTP server
echo USER>> ftpcmd.dat
:: do a binary download instead of ASCII
echo bin>> ftpcmd.dat
:: specify which file you desire from the the PLC and where it goes on computer
echo put C:\Users\USER\Desktop\LogData.log /usr/log/LogData.log>> ftpcmd.dat
:: quit the FTP script
echo quit>> ftpcmd.dat
:: execute the FTP command to run with the generated file above
ftp -n -s:ftpcmd.dat 192.168.0.2
:: delete the generated file
del ftpcmd.dat


I have done this with the Modicon SoMachine based controllers ( M241/M251) thus the file and directory names above.

Alter to .csv instead of .log and check the acctual directory path for the log files in the M340 controller/SD card and your computer. As far as I know, creating a .csv in the M340 is possible but I've never done it before. Accessing it via ftp seems to be possible per the following :

http://www.schneider-electric.co.uk...ang=en&id=FA198219&locale=en_US&redirect=true

Creating the .csv file in the M340 seems to be possible with the BMX NOR 0200H module for the M340.

http://www.guilleviniag.com/downloads/Products/Schneider/M340/Manuals/M340 NOR 0200H Manual.pdf
 

Similar Topics

Hello, I have an int variable that updates the value every second. I want to store the 100 values in an array. Array should keep storing the...
Replies
7
Views
1,000
hi, i made a program of controlling temperature of 20 tanks using PID control. now i want to store the data of the present temperature of the...
Replies
4
Views
2,864
I'm on PLC 5000. So I'm trying to store mutiple things. And trying to find the shortest way to write it without using so many rungs. I'm using FFl...
Replies
0
Views
1,408
I have an AB L27ERM PLC and a Panelview Plus 1000 with a local network setup with a PC on the machiene. 1. What is the best method for exporting...
Replies
5
Views
2,859
Dear all, I would like to move data stored by Historian to another place on network drive with more space, but I'm facing problems as I cannot...
Replies
0
Views
1,750
Back
Top Bottom