What is the difference between acting according to duty and acting from duty? Give examples of each.

What is the difference between acting according to duty and acting from duty? Give examples of each.