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 ? Quote 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 Quote 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.