RhinoCZ

NA5 - which object calls subroutine

2 posts in this topic

Hello,
sorry if this sounds stupid, I'm new to Sysmac...
Please imagine lets say 32 buttons on one HMI page named "Button_01" to "Button_32". I want to have one subroutine that should be called from each button. Please, is there any way to detect which button was just pressed and which is calling subroutine right now? Something like:

Sub SelectionMade
   MyVar = STR_TO_INT( RIGHT(SubCaller.Name, 2) )
End Sub

Edited by RhinoCZ

Share this post


Link to post
Share on other sites

Normally, you would use a function parameter that the caller provides for any necessary context.

Share this post


Link to post
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