Jump to content

Constant Alpha numeric storage in MI


Recommended Posts

I am multiple button in an hmi. When an button is pressed I want to overwrite the value of an MI to hold alphanumeric datatype .Eg if button mb1 is pressed "123ABC" is stored in MI, but when button mb2 is selected I want "111zzz" to be stored in same MI.

I want to know how to store constant predefined value i.e "123ab" and "111zzz" in the MI. Note all this values are constant.

image.png.3ac888067094e2e1963ca31af211dbed.png

Link to comment
Share on other sites

Hi,

1. Alfa-numeric value is a string.

String occupy number of "characters"+1 Bytes. Last Byte is 0x00 - "zero" Byte which marks a string end.

As a Unitronics PLCs store strings in vectors of MIs.

MI store 2 Bytes.

2. In your case stings include max. 6 characters.

Required number of MIs in vector is (6+1)/2+1=7/2+1=3.5+1=4.5.

Round it to lower number 4.

So you need 4 MIs in vector.

3. Use "String to ASCII" to store required string to MIs vector.

image.png

4.Use one of strings as text.

image.png

5. Click on "Vector Start Address" and select 1st MI of 4 secuential MIs.  For example MI 0.

image.png

6. Click on marked sign:

image.png

7. Enter comment with final space:

image.png

8. Add /4 to stringand press OK:

image.png

9.Click on OK again:

image.png

10. Use "Vector Start Offset" =0 and click OK.

image.png

11. Click OK again to finish.

image.png

12. Now you have vector of MIs, allocated for your string.

image.png

B.R.

 

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Hi

 

I am trying to do something similar.  I am using DW instead of MI

 

I am counting pulses from the HSC and calculating them to MM's.  I have a numeric box on the screen where the user can enter the required MMs via a keyboard and this is stored in a DW. it then uses a comparator to either slow down the machine or stop it once it has counted to the required value.

What I am trying to do is to get create a button that writes a fix value into the DW for the required distance in MM (1000, 5000, 10000, etc) for frequently used sizes, to save the user having to use the keyboard.

What would I need for this?

Thanks Graham

Link to comment
Share on other sites

  • MVP 2023

I use the following methods:

1) direct input through the virtual keyboard;

2) variable step change of the parameter with two buttons + - (Step In Range function can be used);

3) several buttons with fixed sizes, pressing which directly downloads the number written on the button as a task (Store Direct functions controlled by buttons on screen);

4) several programmable buttons whose values can be changed in the settings menu (On screen Variable Numeric with touch bit programmed and Store Direct function controlled by this touch bit).

The use of the first and second method is probably the most flexible solution.

If the programmed value needs to be changed very often, I use the second method, but control it on external convenient large buttons. For a limited number of choices, it is also convenient to have external buttons. But I use backlit buttons. The operator sees what he has chosen from afar.

Link to comment
Share on other sites

  • MVP 2023
7 hours ago, Graham Witkowski said:

What I am trying to do is to get create a button that writes a fix value into the DW for the required distance in MM (1000, 5000, 10000, etc) for frequently used sizes, to save the user having to use the keyboard.

I frequently use "List of Texts: By Pointer" with associated ladder code to index through the list. It might look like this:

image.png.d815e698534d2117f3dcfef2b8af2c8e.png

image.png.91f8348b0aaab198a9ba34e4e282cb74.png

  • Thanks 1
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.