List Info

Thread: Re: About data type 'TIME'




Re: About data type 'TIME'
country flaguser name
Portugal
2007-05-09 12:05:08
On Wednesday 09 May 2007 13:15, takeshi ikeya wrote:
> Could someone help me ?
> The Mat manual says in IEC ST/IL
> "Namely, the following elementary data types are
not yet supported: TIME,
> DATE, TIME_OF_DAY, DATE_AND_TIME, STRING,
WSTRING"
> But I coded as below
> LD t#0.2s
> ST timer_0.PT
> ...
> ofcource, it worked well.


 Yep. I added this some time ago, and it seems I never did
get to update the 
manual.


> Now, I want to write codes as below
> LD var1
> ST timer_0.PT
> ...
> The var1 is integer which is passed from other module
through plc point.
> I think var1 must be type converted into TIME.

 correct.

> What Ishould do?
>

 I haven't coded any time conversion functions, and honestly
I don't know if 
they belog in the default library. I would have to check
with the IEC 61131-3 
standard.

  However, it is possible to multiply a TIME data type value
with a numerical 
value. Currently I have implemented with LREAL.

 So, if var1 contains the time in seconds, multiply T#1s
with var1 to obtain a 
TIME value.



   Hope this helps,

		Mario.
 

------------------------------------------------------------
-------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and
take
control of your XML. No limits. Just data. Click to get it
now.
http://sourcefor
ge.net/powerbar/db2/
_______________________________________________
MAT-devel mailing list
MAT-devellists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mat-devel


Re: About data type 'TIME'
user name
2007-05-09 17:10:48
Thank you Mario! I always appreciate your kindness

So, if var1 contains the time in seconds, multiply T#1s with var1 to obtain a
TIME value.
 
Multiplying  T#0.1s with var1 makes it possible to control TON in 0.1 second unit ?
 ;
   ; Ikeya
 

 
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )