i know i can use dbx for bool in db,dbb for byte,and dbw dbd for word and double-word.but what if i want to read date_and_time,or string?what instruction should i use?
You can read complex types from a DB only by referring to them by their symbolic name. The catch in this is that you can only reach the variables by symbolic name if the DB also has a symbolic name.
Suppose you have a DATE_AND_TIME variable named Current_Time located in DB10. Give the DB a symbolic name eg. DB10 is called "DataBlock_10". Then you can access the DATE_AND_TIME variable by adressing it as "DataBlock_10".Current_Time
Beware: this only works with blocks or instructions who need this type of variable. You can never MOVE complex types with a simple MOVE command or a L and T combination.
Another way would be to look at the "seperate" Bytes with in the Date_And_Time Parameter.
The Date_And_Time Parameter has the following format......
Byte 0 Year 1990 to 2089
Byte 1 Month 01 to 12
Byte 2 Day 1 to 31
Byte 3 Hour 0 to 23
Byte 4 Minute 0 to 59
Byte 5 Second 0 to 59
Byte 6 2 MSD of ms 00 to 99
Byte 7 (4 MSB) LSD of ms 0 to 9
Byte 7 (4 LSB) Day of week 1 to 7 (1 = Sunday)
You can once again use (for example) db2.dbb0 etc.