CNCtechS Posted March 2, 2022 Report Share Posted March 2, 2022 Hello all, I am first time user of Unitronics and I would like to ask You for help for one problem that I have. I am using data tables in visilogic to program some basic parameters, One of the coulmns is called NAME OF THE PROGRAM(Ime programa) defined as string 20 character using MI memory. So when i try to read ascii string for every column i cant get it. It shows me the Name of the program on first one and later like it is eating the letters on HMI screen like this: Program Number 0 Program Number Program Numb and so on... And I would like to show me tha names of each program. Could You please help me understand what I am doing wrong? Quote Link to comment Share on other sites More sharing options...
AlexUT Posted March 2, 2022 Report Share Posted March 2, 2022 You have to take care: 1. "String" variable in Data Table limited to 20 characters and should not be terminated by 0x00 symbol. 2. "String" variable in PLC MIs vector limited to 20 characters and should be terminated by 0x00 symbol. So you have to allocate (20+1)/2, rounded up. I.e. 11 MIs. 3. It is good practice to clean (fill by 0x00) used for string MIs vectors. . Quote Link to comment Share on other sites More sharing options...
CNCtechS Posted March 3, 2022 Author Report Share Posted March 3, 2022 I will now show You what I actualy get on the display of HMI And here should be shown five different programs, for example program 6 till program 10 Quote Link to comment Share on other sites More sharing options...
Gabriel Franco Posted March 3, 2022 Report Share Posted March 3, 2022 You need to reserve 5 MIs for each program name, e.g. name of program 6 use MI33 up to MI37, program name 7 use MI38 up to MI42 and so on. Also make sure set MB55 if you watn to update name to be updated on screen. I use to SET that MB continously in my ladder. Quote Link to comment Share on other sites More sharing options...
CNCtechS Posted March 5, 2022 Author Report Share Posted March 5, 2022 On 3/3/2022 at 2:23 PM, Gabriel Franco said: You need to reserve 5 MIs for each program name, e.g. name of program 6 use MI33 up to MI37, program name 7 use MI38 up to MI42 and so on. Also make sure set MB55 if you watn to update name to be updated on screen. I use to SET that MB continously in my ladder. I have done all like You said but still have the problem of not showing all the names. Quote Link to comment Share on other sites More sharing options...
MVP 2022 kratmel Posted March 5, 2022 MVP 2022 Report Share Posted March 5, 2022 Please find example V120_Display_worker_name_from_DT.vlp from Visilogic Help Quote Link to comment Share on other sites More sharing options...
CNCtechS Posted March 5, 2022 Author Report Share Posted March 5, 2022 I have looked at that example before and I menage to show just one program like that in example, but here i need list of programs to show at once and that makes me a problem. Quote Link to comment Share on other sites More sharing options...
MVP 2022 kratmel Posted March 5, 2022 MVP 2022 Report Share Posted March 5, 2022 I think example file V1210_display_DT_on_HMI.vlp is useful. This is in HMI folder of Example. Quote Link to comment Share on other sites More sharing options...
Fernando Castro Posted March 8, 2022 Report Share Posted March 8, 2022 I think I know your Issue, I just inadvertly did exactly the same while adding a bunch of texts Since each line is the previous one without 2 characters I'll bet you that you are displaying MI33, MI34,MI35,MI36... when you should be Increasing by 10 MIs per line So each String has a lenght of characters, deppending of the type of addres you are using (MI, ML, DW) you can store a different characters per addres, in my case: I start with DW40, and I want 56 characters, each DW is 32 bit so I can store up to 4 string characters as ASCII, so i need 14 registers per line. so in my example: Line 1 Start of Vector DW40 Number of characters 56 Line 2 Start of Vector DW54 Number of characters 56 Line 3 Start of Vector DW68 Number of characters 56 Line 4 Start of Vector DW82 Number of characters 56 Line 5 Start of Vector DW96 Number of characters 56 Line 6 Start of Vector DW110 Number of characters 56 Line 7 Start of Vector DW124 Number of characters 56 Line 8 Start of Vector DW138 Number of characters 56 Line 9 Start of Vector DW152 Number of characters 56 I dont know how you are reading the data dable string values, but you should use at least 10 MIs to store 20 charactes (according to my math), one MI can store up to 16 bits (2 ASCII characters, Each ASCII character is 1 byte or 8 bits ), so if you are storing starting on MI 33, next string should be stored starting on MI43, MI53, MI63 and so on. Hope it Helps, Fernando Quote Link to comment Share on other sites More sharing options...
MVP 2022 Ausman Posted March 8, 2022 MVP 2022 Report Share Posted March 8, 2022 4 hours ago, Fernando Castro said: you should be Increasing by 10 MIs per line As a side issue, if this is indeed the case, it could/might be a classic example of why I put labels into all areas of Vectors I use, so that those areas are not used inadvertently for something else......because when you open them for use nothing shows. I used to do it simply as a Vector No. label, but these days am a little more specific eg "4/Mbus53" means the 4th MI in a vector of things read from Mbus unit 53. cheers, Aus Quote Link to comment Share on other sites More sharing options...
Fernando Castro Posted March 10, 2022 Report Share Posted March 10, 2022 On 3/8/2022 at 4:08 PM, Ausman said: As a side issue, if this is indeed the case, it could/might be a classic example of why I put labels into all areas of Vectors I use, so that those areas are not used inadvertently for something else......because when you open them for use nothing shows. I used to do it simply as a Vector No. label, but these days am a little more specific eg "4/Mbus53" means the 4th MI in a vector of things read from Mbus unit 53. I try to do the same, it was somethink that i feelt tedious to manyally do, until I discover you can select multiple rows on the operands tab the description column and it can auto fill all the selected ones with the same text + the index you want . Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.