ASCII long unproductive day

JeffKiper

Lifetime Supporting Member + Moderator
Join Date
Jun 2006
Location
Indiana
Posts
2,447
OK I just found a Inline Indirection in the RS500 instruction set. This allows you to insert integer and floating point values into ASCII strings.

I have been trying to write code to convert a Float to a String AND handle any errors that I get because of math overflows. So after a full day of nothing but junk code I found this.
If you are doing ASCII this might help

Flow rate is currently [N7:0] GPH and contains [F8:0] PPM contaminants.

Keywords to search for later when I can't find this
float to string
F to ST
 
That is what it looks like. I have to send a float out a string. So this may just be my answer to eliminate the error handling. I was going to convert from float to integer then concantinate whole number decimal then fractional. Asking as the word was under 32767 I was OK. You all know how much fun this gets to be without loosing accuracy.
 
Okay, guys, help me understand this "inline indirection" thingy you discovered. I found a mention in RSLogix500 help, but I still don't know what they're talking about.
 
Paul imbed a variable in a string.
This way you don't have all the headache of conversion.
I have inserted variables in pb32 text but didn't know I could use them in a string 500
 
In a string you wish to transmit using AWA or AWT you can bury within that string references to values in the data table. The string: (assuming the contents of N7:0 is 25)

"The value of N7:0 is [N7:0]"

When transmitted will be:

"The value of N7:0 is 25"

So you won't see the string IN THE PLC as expanded with the value, only in the string which is actually transmitted. It won't help if you are trying to create a string version of a float where the string version will exist in the PLC.

You can use any data table item in the string as long as it exists and is within the brackets. Even a float type. But I think you have been referring to trying to do a Float -> String type instruction where the final string exists in the PLC.
 
Last edited:
ST9:0 "just add in the brackets [N7:0]"
That would be sent out the port in a AWA. just add in the brackets 32767
Try it out. I may have new alarm setup.
 
Thanks, Bernie, Jeff. So all you need is the "[" and "]" symbols and a valid address...very cool. I rarely write out of a serial port, but I will remember this next time I need it.
 
OK guys the MLX 1100 does NOT support Floating points in the inline indirections. SO back to old school ways but at least it does support Longs. SO I should be able to take the float find the decimal position and convert it into 2 longs. Then imbed the Longs in the String and send them. I hope
 
OK I am back where I started. I am looking for a way to handle Floating points what can vary. I looked at Paul's example but what happens if the number varies from -1.0 to -0.00009 I need some logix that can handle those swings in numbers.
 

Similar Topics

Hi to everybody. I need to read the first 12 characters of the message that a barcode reader sends to the ascii card (1734-rs232 ascii) and I...
Replies
8
Views
685
Hello All Here is my challenge. I have a leak tester that sends ASCII data out continually during it's test. At the end, it sends the test name...
Replies
1
Views
1,715
I have an L24ER-QB1B with a 1769-ASCII card in slot number 4. I'm looking to send data to this zebra printer after every completed sequence. I'm a...
Replies
2
Views
403
I am trying to import addresses and symbols from a PanelBuilder32 application into the RSLogix 5 Address/Symbol database - however each time I...
Replies
5
Views
503
Good day! I am working on a project at our campus to integrate fleet vehicle chargers with load management so we don't overwhelm our service. The...
Replies
37
Views
3,694
Back
Top Bottom