DINT to String RSLogix 5000

IAA

Member
Join Date
Sep 2007
Location
Michigan
Posts
34
Hello,
I am trying to convert a Decimal DINT to a String. I recieve a DINT from a barcode reader and it diplays as 875574065. When I display the number as ASCII in the monitor window I get 4031. How can I get the 4301 to show up in a string?

I have tried using the DTOS, but I end up with 875574065 in the string.

I have read these.

http://www.plctalk.net/qanda/showthread.php?t=60004



Thanks for any help.
 
Use BTDs to move 4 blocks of eight bits to the first 4 elements of your STRING tag...

DINT bits 24-31 => STRING.Data[0]
DINT bits 16-23 => STRING.Data[1]
DINT bits 8-15 => STRING.Data[2]
DINT bits 0-7 => STRING.Data[3]
Set STRING.Len to 4

Better still, make a new STRING data-type e.g. STRING4, that only allows 4 characters (you'll still need to set STRING4.Len to 4).
 

Similar Topics

Dears, Is there any simple way to convert single DINT variable to STRING contains single sign based on source DINT (Decimal representative of...
Replies
2
Views
1,799
Hi guys, Im a complete PLC newbie, I am trying to complete a Uni assignment. I am struggling on my last step, I need to save a unique identifier...
Replies
9
Views
2,917
Hi I am using GSV to get localTime when a specific event happen, which is stored in DINT array (DINT[0] to DINT[7]). Now I want to log this date...
Replies
3
Views
2,696
(Using Studio5000) Hi all, little bit about what's going on: I'm doing this program for my dad, I've never worked on a PLC until I started doing...
Replies
0
Views
1,728
Basically, I want a message in Alarm Setup to be string text followed by a DINT. The string text is normal (just like any other text of a...
Replies
9
Views
10,352
Back
Top Bottom