Micro820 Any_To_String

Freak

Member
Join Date
Oct 2006
Location
Barossa Valley
Posts
195
Hi - first time using the Micro820 and am getting stuck on a couple of things.
I have 3 instances in one LD that use the Any_To_String function, all are Real format inputs.
#1 - works correctly 7.984 Real = 7.984 String (Lth 4)
#2 - Divides my number, 999.0 Real = 9.99 String (Lth 4)
#3 - Multiplies my number, 0.0032 Real = 3.20 String (Lth 4)

Any suggestions, I can't upload it yet, but might be able to do later if needed.

Cheers
Peter
 
Hi - agree that I have added one extra to the length of the string.

All I want to do is take my real number and convert it to a string so that I can insert the appropriate designation. I then display this on the HMI.

What I don't understand is why the decimal place is moving? I am taking a Global Real and converting it to a Local String.

Any thoughts? Tags aren't used anywhere else in the program at this point.

Cheers

Capture.JPG
 
If I understand you just want to keep the decimal 2 places, if this is correct? I have a routine that will always place the decimal where you want it once the "Real" has been converted to "String".

This routine is done in CCW and is for the Micro800 series PLC.

I will have to upload it in the next couple of days as it is on my computer at home and I'm at work.
 
Ok I found the routine here at work! Here is a list of variables that I used for my application, but you could change for your needs.

Total_Barrels = Real
Barrels_Real = Real
Trun = Real
Total_Barrels_UDint = UDint
RealStr = String
DecNum = Dint
Decimal_Place = Dint
EndTotal = String (This is not show in picture it is the (Insert-Variable)

This will place the decimal anyplace you may want just by changing the "DecNum" position.

I hope this helps.

Real_To_String.jpg
 
Nice - thanks for that!

I am actually quite impressed with the system, first time using it after only using 500 and 5K. The Component touch screens are pretty slick too. If only it had online edits :)
Cheers
 

Similar Topics

Hello, I am using an A&B Micro820 togehter with ccw. Reading a device via Modbus RTU. This goes all OK. Now I am reading a Modbus register...
Replies
2
Views
1,277
I’m trying to read values from a device that can either send registers as 32 bit or a pair of 16 bit but if I understand right, the micro can only...
Replies
26
Views
813
Hello, I set up my Micro820 with a basic mapping. When I try to run a script to read the addresses I get errors for illegal addresses...
Replies
2
Views
169
Hi Guys, I am a new member and this is my first post! I have a little PLC experience but it is mostly with siemens logo and using ladder...
Replies
4
Views
901
Hello, I am using a AB Micro820 PLC, via the SD card I want to update the PLC program (not FW). First I created a text file on the SD card with...
Replies
2
Views
296
Back
Top Bottom