News:

  • June 26, 2026, 01:52:48 AM

Login with username, password and session length

Author Topic: Real number in DLV memory  (Read 7246 times)

Henryp

  • Hero Member
  • *****
  • Posts: 161
Real number in DLV memory
« on: August 21, 2014, 02:20:14 PM »
How do I show a real number using the DMD data view when the value is held in a DLV memory address? The drop down box doesn't support this as an option.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3827
    • Host Engineering
Re: Real number in DLV memory
« Reply #1 on: August 21, 2014, 03:06:33 PM »
Since Do-more is strongly typed, the element now dictates the "native" format.  As you know, DLV is unsigned 16 bit word.

To address issues like this, Do-more supports a concept of "casting" the element, to change the instruction or Data View's perception of the data type.

Use ":R" as a suffix on a data-block element to "cast" it to a REAL.  Note that for a REAL cast, the element MUST be DWORD-aligned, so DLV0, DLV2, DLV4 can be cast to a REAL by using DLV0:R, DLV2:R, DLV4:R.  Hence, you can not cast DLV1 as a REAL.

However, you can use PUBLISH and SUBSCRIB instructions to copy mis-aligned memory into other strongly typed memory and vice versa.

For more details on Casting, look at Do-more Designer Help Topic DMD0309.

Henryp

  • Hero Member
  • *****
  • Posts: 161
Re: Real number in DLV memory
« Reply #2 on: August 21, 2014, 06:39:05 PM »
Thanks