Data type TIME access via Indirect Addressing with SCL

MOeZ

Lifetime Supporting Member
Join Date
Nov 2009
Location
singapore
Posts
101
Hi,

I am facing invalid data type when i compile SCL and no luck in finding any old threads? could point me out to right direction?
Thanks.

TIME_OUT : TIME ;

WORD_TO_BLOCK_DB(INT_TO_WORD(DB_Num)).DD[4] := TIME_OUT ;
 
Using the AT keyword is one solution:

Code:
FUNCTION fc89:VOID
VAR_TEMP
    TIME_OUT : TIME ;
    dwTime AT TIME_OUT:DWORD;
    DB_Num:int;
END_VAR;    

WORD_TO_BLOCK_DB(INT_TO_WORD(DB_Num)).DD[4] := dwTime ; 

END_FUNCTION;
 
Solved!

Using the AT keyword is one solution:

Code:
FUNCTION fc89:VOID
VAR_TEMP
    TIME_OUT : TIME ;
    dwTime AT TIME_OUT:DWORD;
    DB_Num:int;
END_VAR;    

WORD_TO_BLOCK_DB(INT_TO_WORD(DB_Num)).DD[4] := dwTime ; 

END_FUNCTION;

Thanks LD and Garry. I have tried data type CHAR as well and it worked.

But can I ask how do know this as I have been reading Siemens manual and didn't find right answer.
 

Similar Topics

I cannot add SLC500 analog input tag (I: 8.3) to EZSeries Touch Panel Editor (V 5.3). I used all the listed tag datatype but it all says "Invalid...
Replies
10
Views
258
Hi guys, I have no experience when working with AllenBradley PLC, but I hope someone could clarify the result of multiplication shown in the...
Replies
14
Views
2,196
Trying to get data types (AS Structures) to update after a new tag import is made from PLC. WinCC can show red if an existing element was removed...
Replies
0
Views
273
Is there a way to use LREAL Data type on L71. I am getting 64 bit Double (IEEE754 Double precision 64-bit) data from a modbus device onto PLC via...
Replies
6
Views
959
Back
Top Bottom