Jump to content

how to make a user defined enum as an input for a ladder function


Recommended Posts

I am controlling a VFD via modbus where there is a forward bit and a reverse bit in a command word.  I need to implement logic to set/reset the bits based on the direction the VFD needs to move and I want this logic to be wrapped up in a single user defined function block using an enum as the input to protect against invalid arguments being passed.  I'm not sure if there is a way to do this but I've tried using the clunky LIST feature which did not work.  I know some of the UniLogic supplied blocks do this.  Does anyone have any thoughts on how to do this?  
 

 

Link to comment
Share on other sites

  • 2 weeks later...

Please note that although you cannot force the user to use the function correctly, you can guide him to do so, using comments on parameter In and Out, and run-time checking, as follows:

image.png

image.png

image.png

image.png

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.