Host Engineering Forum
General Category => Do-more CPUs and Do-more Designer Software => Topic started by: PLCwannabe on November 10, 2023, 10:59:47 AM
-
I'm trying to modify memory data via import/export, but I keep getting the attached error whenever I try to import, even though I'm pretty sure all the data is correct. When I export memory data, and try to import again without making any changes, this same error happens every time.
-
Has anybody had success editing strings with Excel, and importing them into a project? I just can't get it to work. When 10 strings are exported,and the same file is imported again without any editing, the software imports 30 strings instead of 10. So whatever was in user1, is now in user4, user2 is now in user7 etc.
The strings are 20 characters in lenght, and they all contain either a timestamp or nothing at all.
-
If possible, can you post your .csv file with the values in question? I'd like to try it. Frankly, at this point, I'd probably ditch excel for GPT for tasks like this.
-
RecordStringsExport.csv.
You cannot upload that type of file. The only allowed extensions are doc,gif,jpg,mpg,pdf,png,txt,zip.
What is the best way to attach a .csv file?
-
Screenshot of string values.
-
If you've already got the .csv, just change the file extension to .txt.
-
Go to the Memory Configuration page and look at the size of your RecordStrings block. How many elements are allocated for that block?
-
BTW, you definitely need to upgrade Designer software to 2.9.4. 2.9.2 has some bugs.
-
Go to the Memory Configuration page and look at the size of your RecordStrings block. How many elements are allocated for that block?
I already increased block size to 1000, which allowed me to import the strings, but then each imported string seemed to take up 3 brx strings eg. string 2 was placed in string4, string3 was placed in string7 etc.
-
Go to the Memory Configuration page and look at the size of your RecordStrings block. How many elements are allocated for that block?
I already increased block size to 1000, which allowed me to import the strings, but then each imported string seemed to take up 3 brx strings eg. string 2 was placed in string4, string3 was placed in string7 etc.
Interesting CSV - there are no commas (Comma Separated Variable).
I am going to guess your strings are just date/time stamps and try it out.
-
So, I generated 100 random date/time stamps in SS block and then used File->Export->Memory Data
I specified 10 elements per row, but I did have to say "include element name on each row" in order for Excel to properly interpret the first column as being different than the next 10.
That Designer Export file is attached as maf1Original.csv.txt.
I then brought it into Excel and tweaked SS0 value to be just "abc". But when I save it in Excel, I get a whole bunch of extra double quotes (sad - not sure if this compounds the problem). This Excel-saved file is attached as maf1Edited.csv.txt.
When I tried to IMPORT that maf1Edited.csv.txt, I get VERY SIMILAR ERRORS (I blew out the Address column in the output window to see the actual line number). See the attached screen shot. I am guessing Excel added some extra rows or columns, but I need to check that out.
That's what I have so far. I will post more detail soon...
-
Yup - all those extra double quotes written by EXCEL mucked up the IMPORT of Designer.
I "tweaked" the Excel export file in a TEXT editor.
I basically re-formatted the doube quote delimiters done by Excel.
Excel changed a simple start/end double quote of the data to
" ""<data>"""
So in my favorite text editor, I replaced
double-quote space double-quote double-quote
that is at the beginning of every cell with
double-quote
In otherwords, I replaced
" ""
with
"
Then I replaced the three double quotes at the end of every cell with just one double-quote.
In otherwords, I replaced
"""
with
"
I was able to import that file via File-Import->Memory Data
(see attached Memory View of my SS block)
-
Here's the Tweaked Excel Edited file
-
Yeah, I tried and Excel does that to me too, and surprisingly there don't seem to be any configurable options during the save or in the general program options to make it stop. Verry odd.
I typically use Planmaker from Softmaker which I like a lot better than Excel anyway. There at least they give you options during the save. Strangely, the default delimiter character is a Tab (in a Comma Separated Value file!!?), but they do let you set that as well as text identifier character. None vs. ' vs. " vs. Auto. Oddly, Auto defaults to putting in the extras.
Anyway, consider this an endorsement for Planmaker in general. You can get the free version, which is almost complete, although I bought it for a couple obscure features I need. Perpetual license is like $50 or something, rather than renting it for more than that each year.
-
I forgot how cool Memory View is.
I noticed that the result of the import showed that SS0 changed its value to "abc" in Memory View. That is why the text color in the cell for SS0 is red, its value changed since the last time it was read from the PLC. But note that none of the other text string values are in red (they are still black), EVEN THOUGH THEY WERE ALL WRITTEN TO BY THE IMPORT mechanism. So rather than trying to "verify" that everything else imported exactly right, the Memory View pointed out that fact - those values DID NOT CHANGE after the import ;D
Attached is the key to all the colors (click on the key icon in the toolbar)
-
That IS cool! 8)
-
Yup - all those extra double quotes written by EXCEL mucked up the IMPORT of Designer.
I "tweaked" the Excel export file in a TEXT editor.
I basically re-formatted the doube quote delimiters done by Excel.
Excel changed a simple start/end double quote of the data to
" ""<data>"""
So in my favorite text editor, I replaced
double-quote space double-quote double-quote
that is at the beginning of every cell with
double-quote
In otherwords, I replaced
" ""
with
"
Then I replaced the three double quotes at the end of every cell with just one double-quote.
In otherwords, I replaced
"""
with
"
I was able to import that file via File-Import->Memory Data
(see attached Memory View of my SS block)
Could you run the attached .txt file through your favorite text editor and repost? I'm not getting anywhere with this.
-
Could you run the attached .txt file through your favorite text editor and repost? I'm not getting anywhere with this.
Start with a file that has the commas. Don't export with TAB separator, export with a COMMA separator. That will probably help you figure out what to do.
First, what version of Excel are you using?
Please provide the exact steps you are doing in Excel
1. to open the .CSV file
2. to save the .CSV file (some kind of export dialog shows up?)
Do you have Notepad++? I recommend that text editor. I can definitely help you with that. Even if it's not Notepad++, it's not that hard.
We can probably figure this out.
-
Office Home & student 2019.
1 I just double-click to open.
2 I click on the save icon to save.
I was able to download Notepad ++ and eliminate all the double-quotes as you described. Which allowed me to import correctly.
But why is Domore exporting as Excel files, if Excel can't format the data properly?
-
But why is Domore exporting as Excel files, if Excel can't format the data properly?
It's just .CSV (Comma Separated Variable) text file, which can work with Excel, Notepad, even database software. It's a very common and simple format for import/export of tables.
Excel can - it's just that I guess they decided to make it more complicated than it used to be.
-
Yeah, its Excel's problem. CSVs aren't really "Excel files" because they've been in use for stuff like this since before Excel existed, but since its a file format for tabular data, it ends up associated with your spreadsheet. Excel created this problem by phoning it in. You can override the association in Windows if you want (like to Notepad++, which I also use and like), but just use free Planmaker or Soft Office or Libre Office. I don't think any of them do this.
-
Yeah, its Excel's problem. CSVs aren't really "Excel files" because they've been in use for stuff like this since before Excel existed, but since its a file format for tabular data, it ends up associated with your spreadsheet. Excel created this problem by phoning it in. You can override the association in Windows if you want (like to Notepad++, which I also use and like), but just use free Planmaker or Soft Office or Libre Office. I don't think any of them do this.
I just "duckduckwent" best csv editor and one of the ones that popped up in this article (https://techcult.com/best-csv-editor-for-windows/) was Quattro Pro! It was the first GUI based spreadsheet (before Excel for Windows!) in the late 80's by Borland!
Still not sure what's best CSV editor, but anything is better than what Excel is currently doing. I could not even find an Export Wizard in Excel (they have an import/convert wizard - why not an export/convert wizard?). They used to. For example, if none of your text contains commas, then offer the option to NOT wrap text cells in double quotes! Or let me choose single quote (over double quote). Or use semicolon (or TAB?) instead of comma. Or format date fields as text (yyyy-mm-dd or mm-dd-yyyy or mm-dd-yy or ?). Sad, sad, sad.
-
In Excel, under the Data tab, there is button called Text to Columns. The allows you to define the delimiters (tab, semicolon, comma, space, etc) and preview the effects before implementing. I also think that the next time you open a "text" file, it will use the same delimiter setup as previously used, so that's probably your issue.
If you right click the file in Windows Explorer, and go to Open with... you can select a different program, and even make it permanent. If you have Notepad++ installed, it should even list Edit with Notepad++ right in the drop down menu already.
-
I just "duckduckwent" best csv editor and one of the ones that popped up in this article (https://techcult.com/best-csv-editor-for-windows/) was Quattro Pro! It was the first GUI based spreadsheet (before Excel for Windows!) in the late 80's by Borland!
That website is a joke, they list Windows Notepad but not Notepad++? I'm not saying Notepad++ is the be all, end all csv tool, but it's miles ahead of Notepad...
-
That website is a joke, they list Windows Notepad but not Notepad++? I'm not saying Notepad++ is the be all, end all csv tool, but it's miles ahead of Notepad...
Yeah, I saw that too. Caveat Emptor. My primary purpose was to point out Quattro Pro.
Trivia - the reason why Borland called it Quattro Pro was because Excel was NOT the #1 spreadsheet at the time. It was Lotus Uno-Dos-Tres ;D
-
I had Quattro. I remember that as being the program that made the 3D UI popular (in DOS!). Borland did a lot of cool stuff back then. Update - Oh, just read through your previous post and saw you already covered that! ;D
I also knew a guy that used 1-2-3 for everything. Spreadsheets, letters, whatever!
-
Seriously, use Planmaker. Years ago it could read XLS & XLSX files, but could only write XLS for Excel formats. For about 5 years now, it can both read and write XLSX, and you can even set that as the default file format instead of the native PMDX. I have the paid (like $50) version cause I need some of the features, but most would be fine with the free version. I like the WP from Soft Office (Write?) better than Textmaker, though.