Simple string question

tomezak1234

Member
Join Date
Jun 2009
Location
Illinois
Posts
1
Does anyone know how I can get a "." into a STRING like ST8:0 I am fairly new to PLC programming. I am working with RSLogix 500 software.
I need to put a FLOAT into a STRING and I understand the rest of the process, but I don't know how to actually get the decimal point into a STRING.:confused:

Thanks,
Tom
 
The ASCII code for a decimal point is 46 (decimal) = 2E (hex).

One way to "insert" a decimal point into your string is to move it into the position you require.

Because Strings in the SLC-500 controller have Data[x] words that contain two characters, you need to figure out which STx:y.DATA[z] word contains the position you want the decimal point, then use a Masked Move to place the decimal point in the character you wish.

This can be pretty tricky, so many users choose instead to concatenate three strings: the whole number string, a string with only the decimal point, and the fraction number string.
 

Similar Topics

i would like to think i am a fairly capable fellow, but when i load the 'NEW TAG' dialog box... click '..' to search for data type and go to...
Replies
9
Views
11,933
B
how can i get a light to go on with a momentary switch and then off with the same switch?
Replies
7
Views
1,727
Hello, I´m having a problem trying to program in Ladder. An output should be trigged by two possible contacts. Take a look on the printscreen...
Replies
5
Views
165
Hello again..trying something on an existing poorly written program and just wanted to double check something system is an A-B MicroLogix 1200 In...
Replies
5
Views
185
Hi all, Writng a FB in ST on Beckhoff TC for a pulser which turns on and off on a cycle, is paused by turning bControlInput to FALSE, but resumes...
Replies
6
Views
273
Back
Top Bottom