News:

  • June 10, 2026, 09:04:28 AM

Login with username, password and session length

Author Topic: Strange numbers  (Read 7675 times)

PLCGuy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 677
Strange numbers
« on: September 28, 2017, 06:29:28 AM »
When I went into the memory config to change the data type from dword to real i got these weird numbers. I had to go in and clear all the registers.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3827
    • Host Engineering
Re: Strange numbers
« Reply #1 on: September 28, 2017, 08:51:34 AM »
Looks like you are doing some type of casting to get raw DWORD data into REAL memory block (R).

You said you changed the data type in the memory configuration, but R memory block's data type cannot be changed.  What block did you change?

What are you using to get this data into R memory?  Are you using MEMCOPY?

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3827
    • Host Engineering
Re: Strange numbers
« Reply #2 on: September 28, 2017, 08:53:53 AM »
OR

Are they "weird" because of the exponential notation format?  They are just very small numbers 1.2345 x 10 ** -39, i.e.
0.0000000000000000000000000000000000000012345

PLCGuy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 677
Re: Strange numbers
« Reply #3 on: September 28, 2017, 09:57:21 AM »
This all started when I used the new COPY command instead of doing all the math boxes.
I created my own memory blocks ie, StartCurlA and StartCurlB. Selected UnSigned word. I was entering numbers with decimal places from the HMI using real numbers.
Then I went to the new COPY command and noticed I missing the decimal places. I would enter 12.45 from the HMI but getting 12.00 in the program. So I figured I needed to Change the memory blocks I created to REAL. After loading the program changes I went into data view and noticed the strange numbers. I sent up a couple rungs to write "0" into all the memory blocks to get rid of the strange numbers I was seeing. All is good now.