Search found 16 matches

by Greg M
Thu Apr 12, 2018 12:52 am
Forum: Application Development
Topic: Sync SQLite data
Replies: 4
Views: 13211

Re: Sync SQLite data

Hi Russ, I was trying similar code to this yesterday on an X2 Pro 10 but although the code compiles and runs fine on my PC, when downloaded to the terminal I get the following error: Can't find PInvoke DLL 'dbnetlib.dll' Did you get this problem on the T7A? I have tried adding a reference to all the...
by Greg M
Tue Nov 10, 2015 8:44 am
Forum: Scripting
Topic: IX 2.20 - Get a Reference To All Tags (LightWeightTags)
Replies: 3
Views: 16101

Re: IX 2.20 - Get a Reference To All Tags (LightWeightTags)

I have a solution but it is messy. If you declare a public static reference to EVERY tag in any script module, it automatically makes them a GlobalDataItem instead of a LightweightTag. You have to rebuild the solution after declaring them. e.g. public static GlobalDataItem _tag1 = Globals.Tags.tag1;...
by Greg M
Thu Oct 29, 2015 2:41 am
Forum: Scripting
Topic: IX 2.20 - Get a Reference To All Tags (LightWeightTags)
Replies: 3
Views: 16101

Re: IX 2.20 - Get a Reference To All Tags (LightWeightTags)

Ok I now realise that Globals.Tags extends the GlobalController class but for some unkown reason the LightweightTags list is protected so I can't access it.

From what I can see, there is now no EASY way to get a list of all tags.
by Greg M
Thu Oct 29, 2015 1:36 am
Forum: Scripting
Topic: IX 2.20 - Get a Reference To All Tags (LightWeightTags)
Replies: 3
Views: 16101

IX 2.20 - Get a Reference To All Tags (LightWeightTags)

As version 2.20 has seriously changed how tags are stored, I can no longer get a reference to a list of all tags using Globals.Tags.GlobalDataItems. Controller Tags now appear to be LightWeightTags and the list is Protected and stored in the GlobalController class. Two main questions: How do I get a...
by Greg M
Wed Oct 28, 2015 8:13 am
Forum: Application Development
Topic: iX Developer 2.20 upgrade setup failed
Replies: 2
Views: 12721

Re: iX Developer 2.20 upgrade setup failed

This probablly won't solve your problem but if others have the same error as me, it was caused by the filename. I had to rename the file from "iXDeveloper2-Beijer_DT_Complete_2.20.2296.0 - Setup.exe" to "Setup.exe" and it's now installing.
by Greg M
Wed Oct 28, 2015 4:18 am
Forum: Application Development
Topic: iX Developer 2.20 upgrade setup failed
Replies: 2
Views: 12721

Re: iX Developer 2.20 upgrade setup failed

I have similar error code, tried uninstalling 2.1 and restarting still the same error. Also checked i have the latest (4.6) .net installed:

Setup Failed!
Failed to install one or several components.

Setup failed. Error code: -2147024894
by Greg M
Thu Oct 08, 2015 5:10 am
Forum: Application Development
Topic: Total Number of Tags For Q term A7
Replies: 2
Views: 8795

Re: Total Number of Tags For Q term A7

Just for clarification, it will allow you to add more than 4000 it may just slow down your terminal, depending on what you're doing with them.
by Greg M
Tue Oct 06, 2015 8:01 am
Forum: Scripting
Topic: copy a "Tag" array into a "C#" array
Replies: 6
Views: 19741

Re: copy a "Tag" array into a "C#" array

This seems to work:

Tools.Recipe.RecipeItems ris = Globals.Recipe1.RecipeItems;
VariantValue[] cArray = new VariantValue[ris.Count];
int index = 0;
foreach (Tools.Recipe.RecipeItem ri in ris)
{
CArray[index++] = ((GlobalDataItem)ri.DataItem).Value;
}
by Greg M
Mon Oct 05, 2015 6:34 am
Forum: Scripting
Topic: copy a "Tag" array into a "C#" array
Replies: 6
Views: 19741

Re: copy a "Tag" array into a "C#" array

If you're only doing it once, I can't see a better way to do it. If you are doing it multiple times you could create a function: private float[] getArray(GlobalDataItem tag) { float[] resultArray; try { resultArray = new float[tag.ArraySize]; for (int i = 0; i < tag.ArraySize; i++) { resultArray = t...
by Greg M
Wed Sep 30, 2015 6:31 am
Forum: Scripting
Topic: Get Alarm text with name of alarm
Replies: 1
Views: 7857

Re: Get Alarm text with name of alarm

I've not tested this, but the following function might work: private string getAlarmTextFromDisplayName(string alarmDisplayName) { foreach (IAlarmGroup ag in Globals.AlarmServer.AlarmGroups) { foreach (IAlarmItem ai in ag.AlarmItems) { if (ai.DisplayName.Equals(alarmDisplayName)) return ai.Text; } } }