Jump to content

store string in switch case


pascal

Recommended Posts

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

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

  • 4 weeks later...

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.