John_R Posted July 3, 2018 Report Share Posted July 3, 2018 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. 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 Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.