pascal Posted January 15, 2021 Report Share Posted January 15, 2021 I want to store a specific string (read fixed) to a "string tag" according a value. If value = 1, then string should be "OK" - value = 2, string is "NOT OK", value = 3, string is "FAULT...",.... OK, I know I can do this with the compare instructions, but I want to do this with the switch case instruction....😎 suggestions anybody ? Link to comment Share on other sites More sharing options...
DanT Posted January 15, 2021 Report Share Posted January 15, 2021 Hi; For the HMI Under Text, List of texts Create an Indexed List and call them by the FaultCode ( int 32) ( your switch case index ) in the program ( FaultCode being what ever name you choose ) In the Ladder - Use the Compare = to Set the Fault Code to the Fault number or -- this one is neet -- Under Solution explorer use the Switch Case and set up the FaultCode to the List of Texts There is a lot of flexibility in this function - Fixed compares and ranges with Options for Actions Example : Case ID 1 , Name Case 1, Comparison Type - Value , From #1 ( a Constant), To (Blank) , Action (Store Tag) , Tag (FaultCode) Store into Tag ( #1 a Constant) DanT Link to comment Share on other sites More sharing options...
Rivka Posted February 9, 2021 Report Share Posted February 9, 2021 Hi, I approve what DanT advised: use the regular "store" option of the switch case in order to store a fault code into a tag, then link tat tag to a HMI "list of texts" element in order to link each value to the text you want to be displayed. Rivka Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now