Jump to content

Help with Memory Integer / List of Texts by pointer


Recommended Posts

Hello, 

Noob at programming here, especially HMI's.   I've done some amount of Ladder logic but this is my first ever building an application with an HMI; and also my first Unitronics experience.   

I'm trying to have a field on the HMI screen be a status box with variable text messages displayed.  I was able to do this successfully using the Binary Text / Switch function, but I need more than two states or messages,  probably 3 or 4, and the program will select the correct message depending on what step in the program the system is in and the status of some of the inputs.   I'm guessing what i need to use is the 
"List of texts by Pointer" box, and have looked at the help menu for that, and it more or less makes sense,  I will need to write the text in the boxes with the line numbers and have a Memory Integer bit (MI) that will call up the various messages based on the value of the MI.  

So how do I cause the MI to have these values?   I searched on MI and not finding much there, other than a brief description of what the Memory Integer is.    Was hoping to find some sample programs that I could look at the code and figure it out from there but haven't fount as yet, maybe I'm not looking in the right place.  

 

thanks much, 

 

Jeff

Link to comment
Share on other sites

Thanks,  I found the Store Direct function under the Store drop down menu, this seems to be whatever comes in gets written to the output.  

Is there a way to make this a selector?   I was looking at the Logic operands, an OR could be used, but I still need some boolean logic to bring the signal logic in.  Also dont see how to have more than one input on an OR. 

I can make an boolean OR using MB contacts easy enough....not sure if I'm barking up the wrong tree on that one.   

I've got some reading to do.  Spending my lunch in the help files :) 

Link to comment
Share on other sites

  • MVP 2023

Define "Selector".

If you're talking about something like an HOA switch, I've put a graphic by pointer object on the screen and placed small invisible boxes with touch properties right at the corners of the graphic.  Then get a picture out of the Unitronics library of the selector in each of the positions.  When you touch one of the corners or the center of the graphic, the PLC logic writes a number to an MI corresponding to "Hand", "OFF", or "AUTO".  You can then use equal blocks looking at the MI to set coils in your program.

No, I'm not going to post an example, yet.  If this is something you want to do I want you to try to make it.  Then post your code (.vlp file).

Also dig into the example projects under the Help menu.  There's a lot of good stuff in there.

Joe T.

Link to comment
Share on other sites

Not an HOA switch.   My use of selector was a poor choice of words.  

A synopsis:  my routine is a sampling application:  first it does a "pre-check" to see if the sample line is good.  If the sample line is good, then it prompts the operator to open the line to the vessel being analyzed and advance the routine to check the product sample.   If the sample line test fails, then it prompts the operator to check their connections and re-run the line check.

I've got a display set up that uses the binary text boxes for 'pass' or 'fail' indicators, but I'm looking to have more options than just a two state display.    

I set up a list of texts by pointer, but I'm trying to sort out how to make the system "select the correct MI .   I suppose I can do this with MB contacts and the status of the analytical module,  but each screen is going to have multiple windows, was looking for a clean / neat solution,  IE trying to not over-complicate this.  

I've built this application successfully already last year using a Click PLC and pilot lights, but we wanted to explore the Unitronics as its at a lower price point than a Click and and its  accompanying AD HMI.   

I did find some examples of the store function on the help menu...I was looking for these on the Unitronics website, not in the program itself.  

I should add that I was not looking for you or others to solve it for me, but looking at similar sets of code to see how something is accomplished is helpful.

 

 

Edited by Jeff164
clarification
Link to comment
Share on other sites

  • MVP 2023

Set up a list of texts by range.  If you look at my State Machine example you can directly tie the step pointer to the text display.

Joe T.

@Jeff164

I (and the other codgers) are always happy to look over and help with code you've written.  I was anticipating a "Please send me an example step-by-step" response, and that was not fair to you.  I apologize for my un-earned gruffness.

Link to comment
Share on other sites

  • 4 weeks later...

Hello Gentlemen,  thank you for your pointers thus far.   I've been sidelined with other work and now I'm needing to return to this project.   I reviewed the state machine example, Thank you @Flex727  for the Link, I could never have found it without that.   I can more or less follow the logic of the comparison blocks but I'm trying to wrap my head around how I apply that to what I'm trying to do.   

One particular question:  In many of the Comparison "Equals" blocks it is a Comparison between "A" and "B".    The A parameter will be some MI value, and the B parameter will be a  (D# x)  where the x is some numeric value.   I saw some at 10 and some at 20.   What is meant by the D# ?    

Joe -  you mentioned tying the step pointer to the text display, I guess I need to see how to set up this Step Pointer.   (Walk before you run, Jeff)

I took the code I have written thus far and stripped it of company information.   Posting it here for you to review if you are so inclined.   As I mentioned before, this is loosely based on an application written for a different PLC package but we were not using an HMI, and also not using an analog input,  I had a sensor with a relay out.   That application was functional & successful, but I need to condense it into this package.   

This project involves allot of firsts for me,  IE first time setting up an Analog Input of my own and first HMI job from scratch.  And a new software package to make things interesting.   The full system will have an A and a B side.  I've only written the A side as I wanted to get it functional first and then duplicate it for the B side.  

 

thank you both

 

Link to comment
Share on other sites

  • MVP 2023

D# is just a constant value, such as 10 or 20. You can compare a memory integer to another memory integer, or just a constant value. Joe numbers by 10 because he's an old school guy who is smart enough to realize it's much easier to insert steps if you have some available numbers between the current steps. Personally, I prefer to number them sequentially by 1 instead of 10 so that makes it easier to do the List of Texts thing on the HMI. Of course, if you do that, make sure you don't leave anything out or you'll be renumbering everything and that can be a major pain. You could also number by ten then divide by ten later, but you'll be screwed up on the list of texts thing if you did end up inserting a step (e.g. 15 between 10 & 20).

Edit: I see Joe was talking about List of Texts by Range. I normally do List of Texts by Pointer, as it's easier to wrap my simple mind around.

Link to comment
Share on other sites

Thanks for your speedy reply.   Tommorow I'll have to delve into this and play around with the comparison functions and perhaps some conditional math to make it work.   Cant do anything now, all my computers at home are Mac...I only use windows for work.  

Link to comment
Share on other sites

Working on that today.   Part of my problem is I've got too many things going on and I wear many hats here.   I get sidelined with field repairs on a constant basis and then it takes me time to get my head back into the groove of this.   I don't do programming full time.   Let me play with what I've got in my head and I'll post an update at the end of the day.   

Again I do appreciate your help. 

Link to comment
Share on other sites

  • 3 weeks later...

Hi Guys, 

Just wanted to follow up with a note of thanks for pointing me down the road of the "State Machine".   It took me a little while to get this resolved as it was a fundamental change in how the program works and not just a set of pointers to drive the HMI.   

Once I got it, its great.  My program is functional.   Its a bit big to load the file here but a snapshot of my implemented code using the function blocks to drive the decision making logic.  

1355990167_statecontrolimage.thumb.JPG.963459eb11951cbb6d87074e81ecb8d9.JPG

 

Thanks again,

 

Jeff

 

 

state control image.JPG

Link to comment
Share on other sites

  • MVP 2023
1 hour ago, Isakovic said:

VisiLogic lets you put coils in series and get the same result as putting them one atop of another, like your step 20

From a logic standpoint, coils in series or parallel is identical. I personally prefer to place them in parallel, as @Jeff164 has done because it helps avoid the problem of mistaking coils for contacts, as someone of my advanced age with poor eyesight is prone to do.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...