Sign in to follow this  
Followers 0
beerock25

CX Designer Macro for Date/Time $SW14-16

2 posts in this topic

Hi guys, I'm new to all this Omron equipment. I'm having difficulty with something I thought was straight forward. The following PT word are used for date/time info. $SW14 (min, sec) $SW15 (day, hr) $SW16 (year, month) For example if I simply link $SW16 (where bits 0-7 are month, and bits 8-15 are year) to a numeric display & input, I get only the month (11 for Nov.) to display. How can I strip out just the month or year. I assumed since just using $SW16 raw gave me the month, that I could swap the upper and lower bits using W10=SWAP($SW16,1); which would then provide the year when just using $W10, but all I ever see in the word is 0 when the macro executes. Is there a much easier way? Why is the result always zero?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0