Jump to content
Eschubertsson

Loading different program files

Recommended Posts

Hi!

I have a project where I need to connect a PLS to a Universal Robot via MODBUS and have it run different programs based on user input.

The idea is basically this

  • Display a screen asking for a part ID 
  • Operator enters part ID based on the part he wants the machine to make
  • Based on the partID the PLS will send a signal via modbus telling it to setup for that program, and the PLS will load a certain ladder logic path for that specific program.

I tried to do this on a Samba 4.3 but I got stuck on in two places which seem to be hardware limited

1.It didn't allow me to have more than 5 digits in a numeric input, I'd prefer it to have 7 since that's how long the part ID's of the customer is

2.I didn't find a way to mix letter and number in a input box

Is this a a hardware limitation of the Samba, if so is there a PLS/HMI you offer which could support the requirements I have?

If the other PLS system supported a keyboard that would also be a bonus, typing on a keyboard is a lot better than a touchpad.

Share this post


Link to post
Share on other sites
5 hours ago, Eschubertsson said:

1.It didn't allow me to have more than 5 digits in a numeric input, I'd prefer it to have 7 since that's how long the part ID's of the customer is

Link the numeric input to an ML instead of an MI.

 

5 hours ago, Eschubertsson said:

2.I didn't find a way to mix letter and number in a input box

Use a string input instead of a numeric input.

Share this post


Link to post
Share on other sites

Thanks! That seems to have solved both issues. 

A question about the ASCII String tool, it converts the strings to decimal then saves it to ML. Is there a way to stop it from converting the string to a decimal and just saving the string to ML as plain text?  Figuring out what each of my 60 strings is in decimal is a bit of a hassle if it's not necessary to do. 

Share this post


Link to post
Share on other sites

Strings are stored in a vector of MIs, two characters per MI.

1 hour ago, Eschubertsson said:

Figuring out what each of my 60 strings is in decimal is a bit of a hassle if it's not necessary to do. 

Not sure what you're trying to do here. Are you entering a string via HMI or are you storing already known string for use in the program?

Share this post


Link to post
Share on other sites

I am trying to build a machine that is going to make 60ish different parts.  And I want it to be as simple as this:

  1. Operator enters program ID into a text box on the HMI.
  2. The PLS takes the String/Program ID and loads it into an ML.
  3. Then it takes that ML value and compares it to the database of 60ish programID's, and finds the program associated with that program ID and loads it. 
  4. Then finally when the operator presses cycle start it starts the cycle and loops the loaded program until the operator presses cycle stop.

Share this post


Link to post
Share on other sites

Just to shortcut this a bit. I would enter the 60 Program IDs into a Data Table then use the "Find Row" function to compare the HMI entry to the Data Table column with the Program IDs. This function will return the row number which you can then use to key the 60 different cycles.

Share this post


Link to post
Share on other sites

Understand that all data (including strings) is stored as an integer.  Each character requires 8 bits (one byte), and two characters are stored as hex in a regular 16 bit MI.  

That doesn't mean you have to decipher MI values into hexadecimal string values.  The data table search and string HMI elements will do that for you.

Read the Help on how Data Tables work.  They are a little daunting but very powerful.  You can enter data into the table on your PC, but don't forget to download it.  It doesn't go down when you download the program.  You may or may not want additional screens to enter data on the PLC. 

Experiment with your code on a live unit until you understand them.  If you have questions, post your code.  Troubleshooting ladder logic with words is hard.

I've attached an example.

Joe T.

 

Data table lookup example.vlp

  • Like 1

Share this post


Link to post
Share on other sites
16 hours ago, Flex727 said:

What would be an example of a "Program ID" that would be entered into the text box?

An example would be RV12345

15 hours ago, Flex727 said:

Just to shortcut this a bit. I would enter the 60 Program IDs into a Data Table then use the "Find Row" function to compare the HMI entry to the Data Table column with the Program IDs. This function will return the row number which you can then use to key the 60 different cycles.

I'll try getting datatables working with the example Joe gave me and see if I can make better progress that way,

 

1 hour ago, Joe Tauser said:

Understand that all data (including strings) is stored as an integer.  Each character requires 8 bits (one byte), and two characters are stored as hex in a regular 16 bit MI.  

That doesn't mean you have to decipher MI values into hexadecimal string values.  The data table search and string HMI elements will do that for you.

Read the Help on how Data Tables work.  They are a little daunting but very powerful.  You can enter data into the table on your PC, but don't forget to download it.  It doesn't go down when you download the program.  You may or may not want additional screens to enter data on the PLC. 

Experiment with your code on a live unit until you understand them.  If you have questions, post your code.  Troubleshooting ladder logic with words is hard.

I've attached an example.

Joe T.

 

Data table lookup example.vlp

Thanks! I'll try this and see if I can get this working! It'll probably be a whole lot easier to upgrade with more programs if the customer would like in the future!

Share this post


Link to post
Share on other sites

Another option for you that's a bit more straightforward, if a bit more cumbersome: If you can group your 60 Program IDs into some logical grouping, say 6 groups (each on a separate HMI screen) of 10 program IDs, you could just have pushbuttons for each program ID. Label each pushbutton with the program ID instead of having the operator enter it each time on the HMI (which can be a pain). Pressing the button turns on a bit that activates the cycle associated with that program ID.

Share this post


Link to post
Share on other sites
15 hours ago, Flex727 said:

Another option for you that's a bit more straightforward, if a bit more cumbersome: If you can group your 60 Program IDs into some logical grouping, say 6 groups (each on a separate HMI screen) of 10 program IDs, you could just have pushbuttons for each program ID. Label each pushbutton with the program ID instead of having the operator enter it each time on the HMI (which can be a pain). Pressing the button turns on a bit that activates the cycle associated with that program ID.

Sure, that could be a solution if I really really couldn't get my head around data tables. But I feel like the customer would be more happy with a single screen (plus one or two for alarm, different status of the different main components of the machine). Sleek was a word he often said during the "consultation", so to speak. 

 

Share this post


Link to post
Share on other sites
7 hours ago, Eschubertsson said:

Sleek was a word he often said during the "consultation"

Can't argue with this. "Slick and professional" is what I try to achieve with every project.

Share this post


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