__sub__g Posted July 8, 2022 Report Share Posted July 8, 2022 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. Link to comment Share on other sites More sharing options...
AlexUT Posted July 10, 2022 Report Share Posted July 10, 2022 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. 4.Use one of strings as text. 5. Click on "Vector Start Address" and select 1st MI of 4 secuential MIs. For example MI 0. 6. Click on marked sign: 7. Enter comment with final space: 8. Add /4 to stringand press OK: 9.Click on OK again: 10. Use "Vector Start Offset" =0 and click OK. 11. Click OK again to finish. 12. Now you have vector of MIs, allocated for your string. B.R. 1 Link to comment Share on other sites More sharing options...
__sub__g Posted July 11, 2022 Author Report Share Posted July 11, 2022 Thank you so much. I was able to implement this in my program Link to comment Share on other sites More sharing options...
Graham Witkowski Posted July 26, 2022 Report Share Posted July 26, 2022 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 More sharing options...
MVP 2023 kratmel Posted July 26, 2022 MVP 2023 Report Share Posted July 26, 2022 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 More sharing options...
MVP 2023 Flex727 Posted July 26, 2022 MVP 2023 Report Share Posted July 26, 2022 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: 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now