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-devel lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mat-devel
|