Micro 820 structured text real/multiply/time

Join Date
Mar 2018
Location
Rapid city
Posts
9
Hello all,

I am wanting to convert a real value from a panel view to minutes,
I can get it to work in ladder logic but I am hoping to demonstrate function block to students.

hoping for a sample instruction.
Thanks in advance.
 
Welcome to the forum.

The first step is to describe what you are trying to do in such a way that we can understand it without guessing.
 
I am sending a "real" value from my panel view into the PLC to be able to adjust the the time a pump cycles.


I have achieved this function it ladder logic, with the exception of the time still being in milliseconds. I forgot structure text long ago(Don't use it you lose it).
I am hoping to get an example of the text to convert a "real" integer into seconds(* 1000) then to min(*60) then convert that to a global variable to assign to a timer set value.
Thanks for the reply!
 
"Real" to me means non-integer or floating point. Are you talking about engineering units? The timer preset will be in ms. What units are you using on the HMI?
The conversion you specified is backwards for minutes to ms. Wouldn't you just multiply by 60000? Convert to DINT with ANY_TO_DINT.
 
Last edited:
Geoff White is suggesting what I also think would be your best solution. Convert real to "Dint" then use the function block "Dint to Time" which can be downloaded from "Rockwell's" support site?

The "Dint to Time" has an example of how to use this function block by "Structured Text" if I remember correctly!
 
Ok guys, sorry for the wait.
I am going to screenshot a couple of things that I think will help you guys see what I am talking about!
The pump control screen is where I want to be able to adjust the time for how long the pump stays on, and how long between cycles.
The global variable screenshot is how I am sending the value from my HMI to the PLC.
The ladder conversion is how I was able to get what I am calling real (data type?) data to convert into a time value to assign to my timer.
I hope this clears it up a little.

I also feel like a dummy for not thinking about multiplying by 60000 instead of 1000 then by 60....

pump control screen.JPG global_v.jpg ladder conversion.jpg
 
Unless I misunderstand. Convert Screen Input to mS then convert to time!

5n52sl.png
 
Yes, it's a DINT.

You can scale the tag in the panelview, and just use that in the ANY_TO_TIME directly.

But IMO, it makes it more obvious what you are doing if it's right there in the code. I prefer all the maths in the PLC where it is in plain sight, but horses for courses.
 
Thanks so much for the help.
I have entered what I think to be the exact instruction and tried to download but got the attached error messages? please advise
I have attached screenshots of my tags for verification.

error list.jpg newtag_dint.JPG timersetpoint tag.JPG
 

Similar Topics

I’m running a micro 820 to measure a tank level, then turning on equipment at certain levels. I have an analog input (4-20) that I’m storing and...
Replies
10
Views
210
Hi All, I came up with this for ramping the PWM pin on the micro 820. I'm new to ladder logic so I am not sure if this will even work? Once...
Replies
6
Views
323
The micro 820 is visible in RS Who when I configure my Ethernet to capture the random IP. I am getting an error when following the steps below...
Replies
9
Views
910
Hi! I need help converting an old MicroLogix 1100 project to Micro 820. Project Details I have an old MicroLogix 1100 program that has been in...
Replies
0
Views
454
Back
Top Bottom