Help Converting DWORD to LREAL in TwinCat2

g.mccormick

Lifetime Supporting Member
Join Date
Jul 2012
Location
IN
Posts
960
I am needing to convert the low DWORD of a timestamp into a LREAL.
The DWORD is a 32bit unsigned number. In TwinCat2, I keep getting a negative value when the value goes high enough that the highest bit turns on. I've triied doing the DWORD_TO_LREAL and UDINT_TO_LREAL conversion functions to no avail. Do I need to be doing byte manipulations or something?
 
Thanks
I'm using TC2 and a CX8090 (ARM) for testing. I will give the DWORD_TO_LREALEX a shot. Thanks




Update: That works wonderfully. Thank you for the help. I'm struggling to learn TwinCat on my own. I wish so much that the editor and help (what help) was as good as the AutomationDirect Productivty Suite which, not nearly as power I know, has very good help with useful examples, etc.
 
Last edited:

Similar Topics

Hello nice to meet you, im new in here, I'm currently trying to convert code written in STL for a S7-400 to SCL for an S7-1500, because when i run...
Replies
5
Views
289
Hi! I am working on a project were we will be replacing an 300 CPU with a 1500 CPU and we are working on migrating / converting code. There is a...
Replies
9
Views
1,060
Hi! I need help converting an old MicroLogix 1100 project to Micro 820. Project Details I have an old MicroLogix 1100 program that has been in...
Replies
0
Views
464
Hope someone is really bored this late on Memorial day!!! I have spent the last 5 hours researching this and trying everything I could find on...
Replies
9
Views
3,259
Is there anyone here who could possibly help me convert an RSP file to PC5. I have inherited an old system that I would like to get upgraded to...
Replies
9
Views
2,585
Back
Top Bottom