News:

  • October 17, 2026, 05:34:15 PM

Login with username, password and session length

Author Topic: EIP Get to UDT  (Read 20193 times)

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3628
  • Darth Ladder
Re: EIP Get to UDT
« Reply #15 on: March 18, 2021, 06:36:32 PM »
Seems to work OK.   I just MEMCOPYed 4 consecutive V-registers to a UDT instance consisting of two signed DWORDS.

Only caveat being that the MEMCOPY insisted I specify the data size in destination elements (1 in this case).

Code: [Select]
STR C77
MEMCOPY V0 TestUDTInstance0 0x30000 1


#BEGIN UDT_CONFIG
TestUDT
// Field Name, Data Type, Memory Layout, Read/Write, Display Format, Data View Detail
dw0, SDWORD, 0:0, Read-Write, Native, Short
dw1, SDWORD, 1:0, Read-Write, Native, Short
#END

#BEGIN MEM_CONFIG
 TestUDTInstance TestUDT decimal 16
#END


I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

RBPLC

  • Hero Member
  • *****
  • Posts: 586
Re: EIP Get to UDT
« Reply #16 on: March 19, 2021, 12:31:32 AM »
You're right, it does seem to work. Like you said you have to specify the destination elements. I was taking the MEMCOPY validation warnings as it wouldn't work. You just have to ignore the warnings. Being able to use MEMCOPY does make it much easier to deal with transferring Words to UDT's for use in messaging instructions. 
« Last Edit: March 19, 2021, 07:19:49 AM by RBPLC »