Autor Thema: Real_to_Bytes.....  (Gelesen 8756 mal)

0 Mitglieder und 1 Gast betrachten dieses Thema.

Offline Emilg

  • Newbie
  • *
  • Beiträge: 2
    • Profil anzeigen
Real_to_Bytes.....
« am: 18. Juni 2015, 21:02:14 »
Hello

I have a problem with a ILC191, i use as a Profinet Device. Master is a Siemens ET200s cpu.
I want to transfer some real values from/to the master.
I have a Array of 256byes In/Out over Profinet.

If i want to transfer a Word/Int, is no problem. Just:
Profinet_Out[0] := Word.B1
Profinet_Out[1] := Word.B0 (*** I made the byte swap here ***)

But when i have the real value, i can't find a function blok to do the trick?
I can only find DW_to_Byte, where i find the 4 bytes, but then i missing the ","?

Is some body there have a solution?

- Emil

Offline peewit

  • Moderator
  • *****
  • Beiträge: 2 378
    • Profil anzeigen
Re: Real_to_Bytes.....
« Antwort #1 am: 18. Juni 2015, 22:30:21 »
use the module "real_to_dword"

byte access:

byte0 = dword.b0
byte1 = dword.b1
byte2 = dword.b2
byte3 = dword.b3