Author Topic: PLC Data EEPROM Manager 6.49 build 04  (Read 12376 times)

garysdickinson

  • Hero Member
  • Posts: 502
  • Old PLC Coder
    • View Profile
PLC Data EEPROM Manager 6.49 build 04
« on: April 20, 2015, 08:57:29 PM »
I am afraid that I've broken the tools, again.

This time it is with the "PLC Data EEPROM Manager" and 32-bit access to EEPROM.

Test hardware FMD1616-10 with FRAM-RTC installed, firmware r82A.

The program does not handle 32-bit integers very well.  There are mistakes in the code that are doing math as if the data is a 16-bit signed value and then sign extends it, incorrectly, to a 32-bit signed.

&H00008000 becomes &HFFFF8000 !

This is the PLC code:

' Quick test of EEP32 behaviors
'
' write a walking 1 pattern in memory
'
C = 1
for i = 1 to 32
   DM32 = C : C = C + C
next

a = 1      ' just a target for a break point

' copy first 32 DM32[] to eep32
for i = 1 to 32
   save_eep32 DM32, i
next

a = 2      ' just a target for a break point

' read eep32 back
'
for i = 1 to 32
   DM32[i+40] = load_eep32(i)
next

a = 3      ' just a target for a break point
[/font][/color]

The test code generates a walking 1 pattern in DM32[] writes this to EEPROM32, then reads it back without problem.

The EEPROM/FRAM manager can't do the same.

Look at location #16 in the jpeg for the problem with &H00008000 the EEPROM manger things that this location is &HFFFF8000!

The ".csv" file that can be produced contains the same error.

If the ".csv" file is edited and corrected then the value &H00008000 is loaded into EEPROM correctly without the 16/32 bit sign extension mistake.

The EEPROM manager has other problems with "reading" 32 bit values.  An example is if the value &H001BF5A (114522 decimal) is stored in EEPROM, the EEPROM manager will display it as &H0000BFA5. The EEPROM manager has lost the most significant 16 bits of the integer.  This is another 16/32 bit boundary issue.

I have a question.  If I have a file in .CSV format, how does the EEPROM/FRAM manager "know" if I want it to load the integer data as 16 vs 32 bit?  There doesn't seem to be anything in the .CSV file that specifies the data size/addressing scheme.

Gary D
« Last Edit: April 20, 2015, 09:34:53 PM by garysdickinson »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:PLC Data EEPROM Manager 6.49 build 04
« Reply #1 on: April 21, 2015, 10:18:51 AM »
Thanks for the bug report. The sign extension is a bug that escaped us during the development and this has been quickly fixed. You can download the beta version of the new JAR files from the following link for your testing:  

http://www.tri-plc.com/trilogi5-upgrade/TL703b8.zip

The usual username/password for downloading i-TRiLOGI upgrade is required.

Unzip the zip file and copy to the respective folders in your TRiLOGI installation folder.

We will update the main setup file in a few days time after we have completed other tests.

Do feel free to report to us if they didn't work as expected or if you encounter new issues.

Regarding the CSV format for integer,  these are just text string taken from the display buffer so whether it is treated as 16-bit or 32-bit depends on the integer size of the format selector before you load the file. E.g if the file is meant to be 32-bit integer or float then you should select a 32-bit format before you load the data into the buffer.
« Last Edit: April 21, 2015, 03:47:35 PM by support »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

garysdickinson

  • Hero Member
  • Posts: 502
  • Old PLC Coder
    • View Profile
Re:PLC Data EEPROM Manager 6.49 build 04
« Reply #2 on: April 21, 2015, 01:18:03 PM »
I tested both versions of the EEPROM manager and the problems with 16/32 bit sign extension seem to have vanished.

You guys are really quick and fixing this stuf.

Thanks,

Gary D