ControlLogix 5000: Integer to ASCII Conversion

Colt Hero

Member
Join Date
Apr 2015
Location
USA - Southeast (but from Northeast)
Posts
109
I know there's the DTOS Function, but I have a value of "35" that is really "0035", and that's how I want it converted. Looks like the function might only be returning "35" in ASCII? Is there any function where you can specify digit count/right-justify/fill zero ... or something like that ... or do I just have to plug the zeros in myself with peripheral logic?
 
I don't know if this will help you or not but i got myself into a pickle one time trying to convert runtime and linetime values like 01:27:37 back into seconds so i could build a uptime percentage from a PLC.



I thought no problem, I'll convert the line time and runtime hh:mm:ss back into seconds and just divide one by the other and figure out the uptime percentage. Nope, it turned into a huge Chinese finger trap of a conversion screenshot attached.



I'm pretty sure you are going to have to use the middle string blocks to pull out what you need and Insert blocks to put it back together.

String conversions.png StringInsert.png
 
Last edited:
PLC programming is like C programmning: all the power of assembler with all the convenience of assembler.


Here it is for MicroLogix 1100; ControlLogix has DTOS and INSERT instead of AIC and ACN, but I would think it would be similar.


A bit of a problem with negative numbers though ;).

xxx.png
 

Similar Topics

I'm attempting to read tags from a 1756L81E(FactoryTalk Logix Echo) controller using the PLC4J api. I have one read and one write bool setup in...
Replies
10
Views
2,291
Hey All, I'm currently building a control system for a large building in a industrial setting. Doing lighting, vent, roof control, door access...
Replies
12
Views
3,502
I am an Electric Engineer working as a maintenance engineer and manage some technician on the production hall now but in the past, I mostly focus...
Replies
12
Views
3,553
I'm not a PLC programmer, so bear with me here ... I was making an AOI with a bunch of BOOL inputs and realized some of them were actually...
Replies
6
Views
1,808
I am trying to add three AB 1426-M6E Power Monitor 5000s to the Device Tree of my Control logix application. Processor is L62 v. 20.12 Logix5000...
Replies
3
Views
1,733
Back
Top Bottom