Float file data from Micrologix

mjmorrow

Member
Join Date
Dec 2006
Location
TN
Posts
24
I am using a Micrologix 1500 LRP to dump ASCII data out the channel 1 port to a printer. I am using the AWA instruction to handle this, and storing the data in location F8:0. I am using a string to output this in this format: PITCH IS [F8:0]. F8:0 is equal to 125.33. Instead of the printer printing "PITCH IS 125.33", I get "PITCH IS [F8:0]". What am I doing wrong?

Thanks,
Mike
 
From what you are saying I understand that you are sending the string "PITCH IS [F8:0]". ML doesn't know your [F8:0] it is a float variable, he treat it as a string.

You have to convert [F8:0] to string, make a search in AB knowledgebase you will find one or two examples, after that concatenate new string with "PITCH IS" and then send it to port.

Good luck
 
Attached will be an example of converting float to string. The file is not really a zip, just rename it to FLOAT_ST.rss.
 
As stated above.
Save it to your computer. Then just change to ext. from .zip to .rss.
It is not a real zip file. It worked for me.
 
Last edited:
Have you tried to change the extension from zip to rss as rsdoran suggested?

If still not working just go to knowledgebase and download it from there.

A simple search with float string conversion will do.
 
Thanks Guys!!

That works!
Just don't understand why the manual doesn't tell you the truth about how complex an operation that is.
 
I found a bug with leading zeroes being lost e.g. 1.005 or 9.056 becoming 1.5 and 9.56.

To fix, add 1000 to the remainder of the subtract to give 1005 or 1056. Then string extract the remainder string from the second character back into itself. This removes the '1' but keeps the '0' or '00' s. šŸ™ƒ
 

Similar Topics

Can panelbuilder32 read and display numbers with decimal points? I was figuring out a relation between the maximum value of a float variable and...
Replies
1
Views
1,230
I have a Micrologix 1500. I need to copy a bits from a floating point file into a bit file. I have tried using the COP and the MOV command, but...
Replies
33
Views
21,513
Hi. I'm using a Modbus ProSoft where I basically map data to a big INT array. Example, where GX_I_63HPU is a REAL, MNETC.DATA.WriteData[200] an...
Replies
21
Views
341
Hi, I have a complex database in Crimson 3.0 and in one of the display pages I am trying to get a tag to show the sum of several other tags. The...
Replies
3
Views
134
Hi. This is pretty basic but I'm struggling to find an efficient solution. I have a float value of let say 666.555 that I want to move / split...
Replies
3
Views
146
Back
Top Bottom