Sign in to follow this  
Followers 0
henriks

Beijer IX T7B

15 posts in this topic

I have connected a Beijer IX T7B to the PLC. in order to use it as a drawing screen. (see picture). I have devided the screen into pixels. I have tryed to tag each pixel wit a memory thets part of an array in the PLC program. Dynamicly moving the values from the screen to the PLC, make the whole system lagg. Is there an easyer way to do this. I want to try to set all the pixels in an array in the Beijer screen, and then move the whole array to the PLC. annyone know howe to do this, or maby another way that may work? Sincerely Henrik Sorhaug

Share this post


Link to post
Share on other sites
How many "pixels" have you created? And you've used M's for it (in other words only black and white)?

Share this post


Link to post
Share on other sites
I have 55x30 pixel, dynamic circles black and white. The point of all this is to manipulate the valves in a waterfall fountain so that the drawn picture is visualized in the waterfall.

Share this post


Link to post
Share on other sites
Well, I must say that I do not belive that the T7B is able to process and transfer all the data to the PLC without lagging. The T7B does not have much processor power, and each "pixel" will be transferred directly to the PLC every time there is a change in one of them. Each telegram will also have it's cycle time, so if you change several "pixels" in sequence, there will be possibly one telegram to the PLC for each change. I would say that I think the only possible solution is: Only use internal tags in the T7B for the "pixel" handling. Create internal tags for each "pixel". After the user has finished the shape drawing, you will need a save button. When the user presses the save button, you have to run a C# script that copies all the internal tags into the PLC tags. This will take a little time, so a "please wait" dialogue will be needed (scripted). I would start with this. The first thing to check is if the panel itself works with internal tags only (just create all the internal tags e.g. Tag1, Tag2, Tag3 etc.) and assign them to all the "pixels". Then try and run the application. If that works, we can look into the C# script. If that doesn't work you will need a PC based panel which has a faster processor. The C# script will need System.Reflection using statement, and then use Get-type/property/value and so on to address the internal tags as strings in the FOR loop you need.

Share this post


Link to post
Share on other sites
Thanks for the reply. The internal tags are working. But I have wery litle experience with C#script, but i will try to figure it out.

Share this post


Link to post
Share on other sites
Did you already use internal tags for the "pixel" handling??? The C# script is only for copying the data from internal tags to the PLC M's, so this won't help on the lagging. What's important is to remove the lagging, and the only way that I see is to give it a try with internal tags only for the "pixel" handling. If you are already using internal tags for "pixel" handling and it lags, then you should consider a more powerful HMI like the Beijer PC based panels, it's easy to convert the HMI application in iX from panel to PC. If you are ready to script in C#, we can help you with that. I believe that's a pretty small code block (essentially only a FOR loop)...

Share this post


Link to post
Share on other sites
Havent used internal tags. All the tags where set to M's . The M`s are now removed and only tag name remains. If you could help with the script, I would realy aprecciate it.

Share this post


Link to post
Share on other sites
OK, how does the HMI respond with internal tags only? Does it lag or does it work? I need to investigate how to do the C# script because of the Neo framework, and the "Globals", since it differs a bit from normal classes. I will get back with a script later. However, the first thing to check is if the system lags or not.

Share this post


Link to post
Share on other sites
It lags much less than by use of M's at least... Sure do, been investigating for that myself, but gets a bit hard when my C# skill is not "top notch".

Share this post


Link to post
Share on other sites
OK, will get an example tonight.

Share this post


Link to post
Share on other sites
Puh, took a little time due to investigation of the Neo framework.. Wasn't the "usual" coding... Well, here it is. This is based on that the internal tags are consistent, and starts with "Tag" followed by a number (e.g. Tag1, Tag2, Tag3, Tag4 and so on). The Mistubishi controller must also have a similar system, in the example it is TagM1, TagM2, TagM3, TagM4 and so on. To explain: In the C# code I use the prefix "Tag" and "TagM" liek static strings, followed by the number of the iteration (1, 2, 3, 4 and so on). Then I concat the two strings ("Tag" and the iteration number) to form the actual tag name. The example will not fail if there are missing tags, or if the Tag names are not matching, but I haven't included any other error handling (you will not get a notice or anything). I have included comments on the code. Feel free to ask if anything is unclear. Below is the code for copy/paste. I have also attached a picture so that you can see the code with the correct spacing and colors. namespace Neo.ApplicationFramework.Generated{ using System.Windows.Forms; using System; using System.Drawing; using Neo.ApplicationFramework.Tools; using Neo.ApplicationFramework.Common.Graphics.Logic; using Neo.ApplicationFramework.Controls; using Neo.ApplicationFramework.Interfaces; //Add this using statement to your screen Script (this is to access the Tags class directly) using Neo.ApplicationFramework.Tools.OpcClient; public partial class Screen1 { //OnClick event void Button_Click(System.Object sender, System.EventArgs e) { //Starts the loop, starting with index=1, and runs 1650times for(int i = 1; i < 1650; i++) { //Defines the internal variable name like "Tag1" in first loop, "Tag2" in second loop.... string internalVarName = "Tag" + i; //Defines the controller variable name like "TagM1" in first loop, "TagM2" in second loop.... string controllerVarName = "TagM" + i; //Gets the properties for each controller (inItem = internal, outItem = controller) var inItem = typeof(Tags).GetProperty(internalVarName); var outItem = typeof(Tags).GetProperty(controllerVarName); //Checks for null values (like missing correct variable name in previous statements) if (inItem != null && outItem != null) { //Gets the current internal value var valIn = (GlobalDataItem) inItem.GetValue(Globals.Tags, null); //Sets the controller value based on the internal value outItem.SetValue(Globals.Tags, valIn, null); } } } }}

Share this post


Link to post
Share on other sites
Thnx a million. Might have some questions later on, but I will try to make this work. This has been great help. Thanks again

Share this post


Link to post
Share on other sites
No problem. Let us know if you run into any problems...

Share this post


Link to post
Share on other sites
Greetings again! I never got to test this out with the PLC after you helped me with this scripting beacause I had to step in another part of the project for a couple of weeks. But Im now back working with the drawing page and tested it out- seems like nothing is happening... I have of course rewritten the code for my page name("Drawing_page") and button number("5") and also changed the drawing page down to 15x55 means 825 tags.. The PLC communicate now thorugh the MELSEC FX3U-ENET driver. Do you have any suggestions of what stopping this to work? I have attached my rewritten code. Thanks in advance! //--------------------------------------------------------------// Press F1 to get help about using script.// To access an object that is not located in the current class, start the call with Globals.// When using events and timers be cautious not to generate memoryleaks,// please see the help for more information.//---------------------------------------------------------------namespace Neo.ApplicationFramework.Generated{ using System.Windows.Forms; using System; using System.Drawing; using Neo.ApplicationFramework.Tools; using Neo.ApplicationFramework.Common.Graphics.Logic; using Neo.ApplicationFramework.Controls; using Neo.ApplicationFramework.Interfaces; using Neo.ApplicationFramework.Tools.OpcClient; public partial class Drawing_page { void Button5_Click(System.Object sender, System.EventArgs e) { //Starts the loop, starting with index=1, and runs 825 times for(int i = 1; i < 825; i++) { //Defines the internal variable name like "Tag1" in first loop, "Tag2" in second loop.... string internalVarName = "Tag" + i; //Defines the controller variable name like "TagM1" in first loop, "TagM2" in second loop.... string controllerVarName = "TagM" + i; //Gets the properties for each controller (inItem = internal, outItem = controller) var inItem = typeof(Tags).GetProperty(internalVarName); var outItem = typeof(Tags).GetProperty(controllerVarName); //Checks for null values (like missing correct variable name in previous statements) if (inItem != null && outItem != null) { //Gets the current internal value var valIn = (GlobalDataItem) inItem.GetValue(Globals.Tags, null); //Sets the controller value based on the internal value outItem.SetValue(Globals.Tags, valIn, null); } } } }}Best regards Henrik

Share this post


Link to post
Share on other sites
What exactly is not working? The communication or the code?

Share this post


Link to post
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
Sign in to follow this  
Followers 0