casmitty

Redlion HMI page control from micrologix 1500 plc

7 posts in this topic

Have a red lion HMI G306A connected to a micrologix 1500 plc. Communication working. I want to be able to change screen through plc as well as have plc be able to read what acreen is active. Had an old panel view hooked up and can use an integer to do this one for active screen and one for screen change called for from plc. Thanks for the help on this.

Share this post


Link to post
Share on other sites

Are you familiar with "Complex Code" in Crimson 3?  If so, investigate the "GotoPage()" function.  You can use the Trigger tab of a data tag to run a program on "change in value" that would select which screen to open when the PLC changes the tag.  One each display, you can rt-click -> Properties -> actions, select "on select" and have code there to write a value to a PLC tag to tell the PLC which screen it's on.  I don't have a G3 powered up right now to test this, or I'd give you a better example.

Share this post


Link to post
Share on other sites

Not to familar with complex code. I am not a code writer but have done some 25 years ago. So basically I know nothing. I write ladder logic and have done alot of HMI work but used to Panel View and Cmore both offer a way to select page and know what page the HMI has in the PLC. In you Post where you mention "GotoPage()" should I place for example"n7_50" in the "()"? Where N7_50 is my tag to a Interger in my plc that represents the page. 

Well I am only guessing here. I had some other things I was taken care of here so Almost forgot to check in today.

Thank You

 

Share this post


Link to post
Share on other sites

I'm not quite 100% sure this is the right function to use, but it's worth a try.

If Red Lion tag N7_50 contains the desired screen number:

Inside Crimson 3.0:

1) Select N7_50 in the Data Tags, click on the "Triggers" tab

2) The combo box next to "Trigger Mode:" says "Disabled"; change it to "Change in Value"

3) Next to "Action:", select "Complex".  The "Edit Complex Action" window will open.

4) Inside that window, add this code:

if (N7_50 == 1) GotoPage(Page1);
if (N7_50 == 2) GotoPage(Page2);

In place of "Page1", you would type in the name of the display you want to open when the PLC sets N7_50 equal to 1, and so on.  You would add a similar line for each display in the HMI.

5) Click "OK at the bottom

 

Now, if you want N7_51 to contain the number of the screen:

1) Somewhere on each page, rt-click and select "Properties".

2) On the "Actions" tab next to "On Select:", click on "Edit...".  In the dialog box, type in:

N7_51 = 1

Then click "OK".  This will assign the value of 1 to the tag N7_51.  You would use a different number for each screen.

I wish I had an HMI I could test this on to make sure I'm steering you in the right direction, but we just moved offices and everything is in shambles.

Share this post


Link to post
Share on other sites

Also, in Crimson 3.0, click on "Help" -> "Reference" and "Help" -> "Contents" to open pdf documents that you will find useful as you proceed.  For example, if you go to page 148 of the reference manual, you'll find information on the "GotoPage()" function.

Share this post


Link to post
Share on other sites

Thank you so much. I have found time to try this out. It works great like this. I understand more about the complex code now. Like old basic commands. The examples you gave were dead on perfect for what I needed. Will have to read more that I understand more.

Thanks Again so much.

Share this post


Link to post
Share on other sites

You're welcome!  Their Complex Code is almost identical to C programming.  It's super powerful, but also a bit of a learning curve if you're used to other HMIs.

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