Jump to content

Recommended Posts

Hey All,

I have a project I did a while back with a V570, revamping an older relay logic machine with PLC/HMI controls, and as I've done with some other retrofits I am saving runtime data in a data table which then gets retrieved using DataXport, then some Quality Control type person uses that data to document performance.

On this machine, I have been asked to implement "downtime" reporting.
If the machine has been off for "X" amount of time, the operator must enter the reason for the machine being down before he can start it back up.

The logic of this was not too difficult, after "X" amount of time the "Start" button becomes a "Go to downtime screen" button", where the operator selects one of sixteen predefined downtime codes, then it returns to the main screen where the Start button is now the Start button.

image.png.7d8c53b7da29cf92bf416faaceb3b865.png

So far, so good.....

Now in my logic for selecting the downtime code, I have a screen with sixteen buttons that will be labeled with their predefined codes, these buttons are assigned to a block of sixteen MB's, and I am using a Bit-to-Number function to decode which button was pressed, then storing that number fur use in my report.

But, the Bit-to-Number gives me the decimal value of the binary sequence of the block of MB's;
1
2
4
8
16
32
64
128
256 and so on up to 32768

Which I can deal with, but I'd rather just give them the numbers 1-16 on their report....

Now I know I can whip up 16 lines of equal-to/store to accomplish this, but I was hoping to find cleaner/neater way of doing this.

Anybody got a better way of doing this?

JohnR

Link to comment
Share on other sites

Hey, Thanks Flex.......

I knew there had to be a more elegant way, I actually looked at the vector find earlier, but wasn't sure what to do with the trigger (A), I always forget about using things like SB1......

nets may be free,  but it's always nice to do things in a cleaner, less cluttered way.....

 

Regards,

JohnR

 

Link to comment
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
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.