News:

  • September 29, 2026, 03:57:47 AM

Login with username, password and session length

Author Topic: Memory Import Errors  (Read 36529 times)

PLCwannabe

  • Hero Member
  • *****
  • Posts: 208
Memory Import Errors
« 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.

PLCwannabe

  • Hero Member
  • *****
  • Posts: 208
Re: Memory Import Errors
« Reply #1 on: November 13, 2023, 09:22:39 AM »
   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.

RBPLC

  • Hero Member
  • *****
  • Posts: 586
Re: Memory Import Errors
« Reply #2 on: November 13, 2023, 09:56:35 AM »
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.

PLCwannabe

  • Hero Member
  • *****
  • Posts: 208
Re: Memory Import Errors
« Reply #3 on: November 13, 2023, 10:49:43 AM »
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?

PLCwannabe

  • Hero Member
  • *****
  • Posts: 208
Re: Memory Import Errors
« Reply #4 on: November 13, 2023, 10:53:21 AM »
Screenshot of string values.

RBPLC

  • Hero Member
  • *****
  • Posts: 586
Re: Memory Import Errors
« Reply #5 on: November 13, 2023, 10:54:58 AM »
If you've already got the .csv, just change the file extension to .txt.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3847
    • Host Engineering
Re: Memory Import Errors
« Reply #6 on: November 13, 2023, 12:07:52 PM »
Go to the Memory Configuration page and look at the size of your RecordStrings block.  How many elements are allocated for that block?

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3847
    • Host Engineering
Re: Memory Import Errors
« Reply #7 on: November 13, 2023, 12:09:54 PM »
BTW, you definitely need to upgrade Designer software to 2.9.4.  2.9.2 has some bugs.
« Last Edit: November 13, 2023, 12:11:49 PM by franji1 »

PLCwannabe

  • Hero Member
  • *****
  • Posts: 208
Re: Memory Import Errors
« Reply #8 on: November 13, 2023, 12:26:15 PM »
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.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3847
    • Host Engineering
Re: Memory Import Errors
« Reply #9 on: November 13, 2023, 12:36:26 PM »
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.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3847
    • Host Engineering
Re: Memory Import Errors
« Reply #10 on: November 13, 2023, 01:10:41 PM »
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...




franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3847
    • Host Engineering
Re: Memory Import Errors
« Reply #11 on: November 13, 2023, 01:25:28 PM »
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)

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3847
    • Host Engineering
Re: Memory Import Errors
« Reply #12 on: November 13, 2023, 01:26:15 PM »
Here's the Tweaked Excel Edited file

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3626
  • Darth Ladder
Re: Memory Import Errors
« Reply #13 on: November 13, 2023, 01:44:54 PM »
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 retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3847
    • Host Engineering
Re: Memory Import Errors
« Reply #14 on: November 13, 2023, 01:58:25 PM »
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)