12/25/2010 7:02 AM | |
Joined: 3/21/2006 Last visit: 11/1/2024 Posts: 10229 Rating: (1181) |
Hello, In cases of communication between CPUs based on different platforms or communication between CPU and HMI for the same reason, you need to use CAW instruction. More info about CAW instruction you could find at Statement List (STL) for S7-300 and S7-400 Programming
In hdhosseini' example, I think in line 3 should be CAW instead of AW. At the moment I don't have Step7 to test it. But I am sure it will work and you can test it alone. Best regards, Hristo Mihalev |
12/25/2010 10:15 AM | |
Joined: 10/7/2005 Last visit: 11/11/2024 Posts: 3026 Rating: (1057)
|
Hello Gengus my take on your question is slightly different to the already supplied answers and I believe you want to mirror ALL bits in the word (i.e. swap Bit 0 with 15, swap Bit 1 with 14, swap Bit 2 with 13 etc.). If so I'm afraid to say that there is no ready made block for this in Step 7. You will however find a (SCL programmed) Block called "Reverse" in the OSCAT library (www.oscat.de) which does this for a Byteand could be used asa starting block for your word "bit mirror" block (alternativelywrite your own block). I hope this helps |
Cheers |
|
12/25/2010 7:50 PM | |
Joined: 9/27/2006 Last visit: 1/17/2022 Posts: 62 Rating: (0) |
Hi Thank you all for your replies. Merry Christmas Sean |
12/26/2010 3:22 AM | |
Joined: 10/7/2005 Last visit: 11/11/2024 Posts: 3026 Rating: (1057)
|
Hello Gengus leavea space between the "SLW" and the number and the"unexpected input end" error will be gone. @Aret: Nice work, I did a minor correction to the STL code and ran it through PLCSIM, the logicbelow should do the job: [code]L #input PUSH SRW 1 AW W#16#5555 TAK SLW 1 AW W#16#AAAA OW PUSH SRW 2 AW W#16#3333 TAK SLW 2 AW W#16#CCCC OW PUSH SRW 4 AW W#16#F0F TAK SLW 4 AW W#16#F0F0 OW CAW T #output[/code] I hope this helps |
Last edited by: fritz at: 12/26/2010 1:20 PMCheers |
|
Follow us on