10/6/2009 6:06 PM | |
Posts: 691 Rating:
|
you may access the bits of a word by getting the status of individual bits For Example L 16#209 T MW20 A m20.0 A M21.6 |
10/7/2009 6:39 PM | |
Posts: 691 Rating:
|
Whats your application i can't understand properly Do you want Indirect Addressing |
10/9/2009 1:36 PM | |
Joined: 10/7/2005 Last visit: 6/9/2023 Posts: 2969 Rating:
|
Hello Palestine AttachmentFC7.zip (951 Downloads) |
Cheers |
|
This contribution was helpful to
4 thankful Users |
10/10/2009 2:03 PM | |
Joined: 10/7/2005 Last visit: 6/9/2023 Posts: 2969 Rating:
|
Hello again Palestine not too sure why it won't work in your case. I did admittedly quickly "hack" FC7 together, but did test it before posting it (and just testedit again and it works fine). Your error relates to FC99(I presume though that this is the block I posted, correct?) and more importantly to a write problem with the TEMP variablesof FC99. I wonder if you used the source file that I posted OR copied the code "printout" in my post and - if so - possibly forgot to create the 16 TEMP bits (which would explain the error that you are getting). Anyway, to besure to be sure, please find attached FC7 as a "ready to go" block inside a Step7library, give it a try and please let me knowthe outcome. Last but not least, the logic in your screendump really does nothing else than copyingPIB516 onto MB3 and PIB517 onto MB2 (I thought you want toextract bits froma Word an copy them onto "scattered" memory (or DB) bit addresses). Perhaps your screendump only shows a test logic, butjust in case this is all you want to achieve, you will be far better off with this logic: [code]L PIW 516 CAW // swap high and low byte T MW 2[/code] All that's left to do is todeclare symbol names for MW 2 as well as M 2.0 -> M3.7 and then use the individual bits as needed. I hope this helps AttachmentFc7.zip (607 Downloads) |
Cheers |
|
This contribution was helpful to
1 thankful Users |
10/11/2009 12:08 PM | |
Joined: 10/7/2005 Last visit: 6/9/2023 Posts: 2969 Rating:
|
Hey Palestine "L" nominates"Local" memory which is bettwr known as the TEMP variable area of the block. "LW 0" is the first WORD of the TEMP area. You'd "normally" useTEMP's symbolically in your Block (and if done, you'll note thatthey still have a symbolic name even if you untick "Symbol" view). TEMP's do however have an "address" which can also be used (and is used in thiscase as the first 16 TEMP bits are declared as individual bits insteadof typeWORD). The downside of doing this is that if you were to add (or remove) TEMP variables which would lead to a shift of the "directly addressed" one you will have to remember that direct addressing is done and make the required changes in your logic. Anyway, none of the above expains why the AR1 based logic doesn't work (which has to work), have you had a change to test the FC7 from the library yet? |
Cheers |
|
This contribution was helpful to
1 thankful Users |
Follow us on