1/8/2010 1:19 PM | |
Joined: 10/7/2005 Last visit: 7/14/2024 Posts: 3009 Rating:
|
Hello BerraB IBN Service is of course correct,the instruction L DW#16#82000045 simply loads avalue into accu1. Having said that, gut feeling tells me that this instruction will be followed by some indirect addressing related code. Should this be the case,the particular value of 82000045hex is actually a pointer value foraddress Q 8.5. Attached is a pic that explainsthis better and you can find out more about pointers and indirect addressing in the Step7 help as well as via searches in the forum and theSiemens service&support web. Last but not least, the instruction LP#Q 8.5 would do exactly the same as L DW#16#82000045 and be a far more meaningful/readable way ofdoing so (if in fact your code relates to indirect addressing). I hope this helps Edit: It obviously took me to long to post my reply, while the abobe still holds true,here's my additional two cents worth on your logic which Isuggest you change it to this: L S5T#500MS (timer) SD T 512 A T 512 = M 256.0 JCN pas ANQ 8.5 = Q 8.5 pas: NOP 0 All this code does is to toggle Q8.5 every scan as long as the 0.5 sec T 512 On delay timer is true (and whoever programmed the original logic with L DW#16#82000045and usage of AR1 either didn't quite know what he was doing or wanted to deliberatly confuse other people). |
Last edited by: fritz at: 1/8/2010 1:32 PMAdded logic explanation Cheers |
|
This contribution was helpful to
3 thankful Users |
1/8/2010 1:37 PM | |
Posts: 35 Rating:
|
Thank you, the Attachment file was very helpful, but still i have a question, how can LD dw#16820000045 point to 8.5
BerraB |
1/8/2010 2:34 PM | |
Joined: 10/7/2005 Last visit: 7/14/2024 Posts: 3009 Rating:
|
Hello again BerraB it does becasue of the pointer format which means that the lowest three bits (bit 0-2) of the (19 bit long) Byte.Bit address containthe bit address and bit 3-19 contains the Byte address In your case: 45hex = 1000101binary. The part in bold is the bit address (101 binary = 5 decimal) and the part in italic to the left of it is the Byte address (1000binary = 8 decimal). I hope this helps |
Cheers |
|
This contribution was helpful to
3 thankful Users |
1/8/2010 4:05 PM | |
Posts: 35 Rating:
|
Yes, Now i understand. Thank you so much |
Follow us on