Sign in to follow this  
Followers 0
PLCBen79

simple question AB Micro830 time conversion

3 posts in this topic

this will be a simple answer for someone who is used to allen bradley im using a Micro830 with a 2711-T6T panelview, and programming with CCW in ladder and FB the process is motor control. in automatic mode i have a timer that idles the motors for 10 to 20 mins incase the user wants to start the conveyor again (to stop motors stop starting) i want to make the timeout adjustable. i have built the screen no problem, my problem is in data types and conversion to milliseconds the user enters timeout in minutes, say 10 to convert this unsigned integer to time i use ANY_TO_TIME FB, however this only outputs milliseconds so I take the 10 and multiply by 600000 which my understanding the result (BLW_MS) will be a LINT long integer, i then pass this to ANY_TO_STRING and feed that in to ANY_TO_TIME. But when I compile i get the error BLW_MS: Expecting a DINT type variable, if i change the Var data type to DINT i get a whole load more errors what am i doing wrong i sure its simple

Share this post


Link to post
Share on other sites
The TIME datatype threw me for a loop the first time I used the Micro830. It's an IEC standard datatype, but I was more familiar with the adjustable-timebase Timers in the other A-B operating systems. I think you're off by a factor of 10 on the math; 10 minutes x 60 seconds x 1000 ms = 600,000. The maximum value of a DINT is 2^31 = 2,146,483,648. In milliseconds, that's 596.5 hours, so a DINT is well within the range you want. Multiply BLW times 60,000 to get BLW_MS, then run that through ANY_TO_TIME to get the Timer preset value.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0