Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: Bolt on April 19, 2021, 07:58:18 PM

Title: Adding Fields to a UDT
Post by: Bolt on April 19, 2021, 07:58:18 PM
Is there an "easy" way to add fields to a UDT (at the "end") without loosing the data in the current memory block's fields?
I'm looking to avoid having to create a "backup" UDT with same field layout, MEMCOPY the old block to the new block, then edit the old UDT to add new fields, then use a LOOP to copy the relevant fields from the backup to the newly edited UDT.  That also requires quite a bit of downtime to do a few PROGRAM mode PLC writes.
Title: Re: Adding Fields to a UDT
Post by: Controls Guy on April 19, 2021, 11:06:55 PM
I wonder how MIM would treat that scenario.  If you made an image, expanded the UDT, then copied the image back in, if the old data would end up in the right locations.

Also, always leave spare space in your UDT to hopefully avoid reinitializing.
Title: Re: Adding Fields to a UDT
Post by: franji1 on April 20, 2021, 09:02:41 PM
No easy way to do this.  From a Memory View, you can export the data to a .csv file, but there is no import mechanism for structures/structure fields.
Title: Re: Adding Fields to a UDT
Post by: Bolt on April 21, 2021, 12:30:45 PM
From a Memory View, you can export the data to a .csv file

Umm, you just answered my question from 3 weeks ago!
https://forum.hosteng.com/index.php?topic=3354.0
Title: Re: Adding Fields to a UDT
Post by: franji1 on April 21, 2021, 01:32:17 PM
Umm, you just answered my question from 3 weeks ago!
https://forum.hosteng.com/index.php?topic=3354.0

Sorry - I make assumptions that people expect the PLC to do everything, but Designer running on a PC/Laptop is just another tool in the toolbox that can accomplish many things that a standalone PLC can't do natively.