Hello, I want to create variables using EXCEL and import it into PLCNext engineer project with, for example, initial value, hardware address, access for OPC or HMI. I haven’t found anything about its kind of procedure. Is it possible to do that ? Best regards, Emmanuel P.
I second this question. Thanks.
Hello Emmanuel and Alex, An import/export feature is currently planned to be available in PLCnext Engineer version 2021.0. ~ Martin.
Is this allready available? I have quite a list of variables (can be imported from excel or csv) and want to add them to a program quickly.
Hey Arne, with PLCnext Engineer 2021.3 you can export and import as csv the PLC Data List (Globals) and all HMI Ressources. Especially the HMI Ressources export is very useful for translations of the HMI lables. Take care, Frank
Hello Arne, Can you please explain how can I read/write an Excel sheet as a FB in LD code environment? An example including the related part of the circuit would make a strong sense and I do appreciate it in advance. Best, Mehran.
I think Arne was referring to the process of manually copying and pasting (or otherwise importing) large amounts of variable definition data from a spreadsheet into a program’s Variable table. If you’re dealing with a spreadsheet in text format (e.g. CSV), then you can use the FILE_* functions in PLCnext Engineer to read /write data from/to the file.
Hello Martin, Yes definitely. My question was about the instruction to write data in specific format as a CSV file. For example, lets say I have some sensors/actuators are working in my plant and the online data stream are processed (and specifically manipulated with my controller). I need to have a *.CSV file with multiple columns which stored the sensors/ actuators outputs. The file has to be saved in /opt/plcnext directory. I have already implemented your disclosed instruction which included File_Open, STRING_TO_BUF, FILE_WRITE, and FILE_CLOSED function blocks. Now I can store the data in 4byte type as a .text file. As mentioned before, I do appreciate it if you can tell me how to store the data as a multi column *.CSV file. Thank you so much. Best, Mehran.
If you are able to write a String to file using FILE_WRITE, then the string can be a comma-separated data list, right? Or perhaps I’m missing something. Alternatively, if you are only writing to a CSV file (not reading), then you can consider using one of these libraries from the PLCnext Store: - Simple Logger - Data Logger Both of these can log data to file in CSV format. If you have questions about those apps, please contact the developers in the PLCnext Store.