Skip to main content

Kollmorgen Support Network

To better serve our Kollmorgen users with questions too complex to be addressed in this space, we made the painful decision to close this Community forum.

Please submit your question using the contact us form to reach our application engineering team.

For the immediate future, you can still access and read past posts.

Thank you for understanding and for participating in the community over the years.

Chart Object in KVB | 15 Feb 2018 | |

Chart Object in KVB

Hi All,

I'm trying to create a chart object in KVB as part of a KAS project. I created an array variable in KAS and marked it for KVB. In the tags section of KVB it shows up as a bunch of individual elements named BotPos_elem1,2,etc. When I try to add a series to the chart, nothing shows up in the window and I can't add anything. Anybody know the trick?

Thanks,

 John

Comments & Answers

jcoleman02 said ...

jcoleman02 |

John,
When you create an array in KAS and map it to KVB, it creates individual tags in KVB. These tags must be combined into an array within KVB. You have to create the array in KVB using a script. Then you can use the KVB array tag to define the series for a chart. I'm sorry, I don't know how to create the KVB array in the script. I have heard that another customer did this and it worked, but I don't have the script program.

jcoleman02 said ...

jcoleman02 |

John,
I found out how to do it.  I'll send you an email with screenshorts.
The array that is used in the chart is irrelevant of any array in KAS.  You can set up KAS to use an array or to have separate variables for each of your array items.
Once it gets into KVB (AKI panel) the data will be split up into separate tags.  You need to write a script to put the individual tag values into an array.  Then you can use that array for the chart.  The script needs to be in the Tag screen and use ChangeValue for each of the individual tags.

Use the following command format to put the values into the array:

Globals.Tags.PLSpos_array[0].Value = Globals.Tags.PLSpos_elem0.Value;

So the entire script will be something like:

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;
    
    
    public partial class Tags
    {            
        void PLSpos_elem0_ValueChange(System.Object sender, Neo.ApplicationFramework.Interfaces.Events.ValueChangedEventArgs e)
        {
            Globals.Tags.PLSpos_array[0].Value = Globals.Tags.PLSpos_elem0.Value;
        }            
        
        void PLSpos_elem1_ValueChange(System.Object sender, Neo.ApplicationFramework.Interfaces.Events.ValueChangedEventArgs e)
        {
            Globals.Tags.PLSpos_array[1].Value = Globals.Tags.PLSpos_elem1.Value;
        }            
        void PLSpos_elem2_ValueChange(System.Object sender, Neo.ApplicationFramework.Interfaces.Events.ValueChangedEventArgs e)
        {
            Globals.Tags.PLSpos_array[2].Value = Globals.Tags.PLSpos_elem2.Value;
        }
        
        void PLSpos_elem3_ValueChange(System.Object sender, Neo.ApplicationFramework.Interfaces.Events.ValueChangedEventArgs e)
        {
            Globals.Tags.PLSpos_array[3].Value = Globals.Tags.PLSpos_elem3.Value;
        }
        
        
    }
}
 

jcoleman02 | Fri, 02/16/2018 - 16:44

John,
I see the same results when trying to add a series to a chart in KVB. I'm looking into this and I'll let you know what I find out.

About this Question

John2025
Taxonomy: