in
Creating Smarter Networks

xSelect predicates

Last post 07-07-2008 10:55 PM by lumatec. 16 replies.
Page 1 of 2 (17 items) 1 2 Next >
Sort Posts: Previous Next
  • 06-16-2008 12:02 AM

    • lumatec
    • Top 10 Contributor
    • Joined on 04-29-2008
    • Posts 63
    • Points 870

    xSelect predicates

    Hi,

    We have a DataLogger that contains entries of several DataPoints. We'd like to read all entries of one of these DataPoints. Therefore we use an xSelect statement with a 'predicate'. The name of the DataPoint we want to read is: 'SMART/Channel 1/iLON100- 1/Type Translator- 1/F_IN1'

    In order to exclude all other DataPoints (for ex. 'F_IN2', 'F_IN3' and so on...), we use a predicate '[contains(UCPTname, "F_IN1")]'. We don't get any datapoints at all.

    If we provide the whole name: [contains(UCPTname, "SMART/Channel 1/iLON100- 1/Type Translator- 1/F_IN1")], it doesn't work either.

    The only means to read any datapoints, is to use a predicate that contains only 'network/channel/device'. As soon as the predicate contains the functionalblock name, or parts of it, it doesn't work.

    Is that normal, or are we doing something wrong?

    Best regards,

    Daniel

     

     

     

    • Post Points: 35
  • 06-16-2008 12:41 PM In reply to

    • jster23
    • Top 10 Contributor
    • Joined on 04-03-2008
    • Posts 17
    • Points 235

    Re: xSelect predicates

    I believe the xSelect in the Read() is filtering on the Data Logger object (<Item xsi:type="UFPTdataLogger_Meta_Data">), not the actual entries in the log.  I think you are limited to the position and UCPTlastUpdate predicates.  

    -Jonathan

    Jonathan
    Technical Writer, Echelon
    • Post Points: 20
  • 06-16-2008 2:42 PM In reply to

    • mrusso
    • Top 10 Contributor
    • Joined on 05-22-2008
    • Posts 9
    • Points 90

    Re: xSelect predicates

    I've been trying to use the List() function with xSelect in an FPM application, and I haven't quite figured it out yet.  The SmartServer Programmer's Reference (document# 078-0347-01A) has some good examples on page 24.  You might want to try the following:

    //Item[@xsi:type="Dp_Cfg"][starts-with(UCPTname, "SMART/Channel 1/iLON100- 1/Type Translator- 1/F_IN1")]

     Hope this helps.

    • Post Points: 20
  • 06-16-2008 10:47 PM In reply to

    • lumatec
    • Top 10 Contributor
    • Joined on 04-29-2008
    • Posts 63
    • Points 870

    Re: xSelect predicates

    Jonathan,

    If I compare my predicates with the UCPTname in the Meta_Data, that seems to confirm your assumption. (Wondering what's the reason for filtering the Meta_Data)

    That means that we have allways to read ALL the entries of ALL DP in order to get ALL entries of ONE certain DP. Tens of data logger readings instead of one... and then filtering the data manually... Hope that will be improved in future...

    Thanks and best regards,

    Daniel

    • Post Points: 5
  • 06-16-2008 10:52 PM In reply to

    • lumatec
    • Top 10 Contributor
    • Joined on 04-29-2008
    • Posts 63
    • Points 870

    Re: xSelect predicates

    mrusso,

    as far as I understand, xsi:type for DataLogger entries is 'UFPTdataLogger_Data', not 'Dp_Data' which is for the DataServer. I actually did try the starts-with predicate, but that doesn't work either. I am affraid Jonathan was right (see post above), we can't filter DataLogger data.

    Thanks and best regards,

    Daniel

    • Post Points: 20
  • 06-17-2008 12:17 AM In reply to

    • dev26
    • Top 25 Contributor
    • Joined on 06-17-2008
    • Posts 6
    • Points 75

    Re: xSelect predicates

    Hi

    The 'UCPTname' belongs to the data logger itself. You can use UCPTpointName to select some DPs. E.g. to select one DP from all loggers:

     //Item[@xsi:type="UFPTdataLogger_Data"][UCPTpointName="Net/LON/iLON App/Digital Output 1/nviClaValue_2"]

     

    • Post Points: 35
  • 06-17-2008 12:59 AM In reply to

    • lumatec
    • Top 10 Contributor
    • Joined on 04-29-2008
    • Posts 63
    • Points 870

    Re: xSelect predicates

    Hello dev26,

    I'm just wondering whether that really works with your SmartServer. On my SmartServer, the 'UFPTdataLogger_Data' - class doesn't have a 'UCPTpointName' - member, but a 'UCPTname' - member in which the point name (not the data loggers name) is stored. Trying to filter for 'UCPTpointName' throws an exception 'Server returned an invalid SOAP Fault.'.

    Regards,

    Daniel

     

    • Post Points: 20
  • 06-17-2008 7:06 AM In reply to

    • dev26
    • Top 25 Contributor
    • Joined on 06-17-2008
    • Posts 6
    • Points 75

    Re: xSelect predicates

    Yes, it works. But you have to use the equal compare for it, not 'contains' or 'starts-with'. Just try exactly my example.

    • Post Points: 5
  • 06-17-2008 7:08 AM In reply to

    • dev26
    • Top 25 Contributor
    • Joined on 06-17-2008
    • Posts 6
    • Points 75

    Re: xSelect predicates

    P.S.: of course, you have to use a real DP name from your logger, otherwise it will return 'Data point not found' fault.

    • Post Points: 5
  • 06-17-2008 10:47 PM In reply to

    • lumatec
    • Top 10 Contributor
    • Joined on 04-29-2008
    • Posts 63
    • Points 870

    Re: xSelect predicates

    dev26

    IT WORKS! (Indeed, I didn't realize you used the equal comparison.)

    Thank you for your help.

    Could you tell me where you found that in the Programmer's Reference, or any other document? As I'm also struggling with other things (for example: messageProperties_system, UCPTenablePath in AlarmNotifier config) which I can't find in the Programmer's Reference, I'm wondering whether there is more information provided somewhere else.

    Best regards,

    Daniel 

     

    • Post Points: 20
  • 06-19-2008 5:54 AM In reply to

    • dev26
    • Top 25 Contributor
    • Joined on 06-17-2008
    • Posts 6
    • Points 75

    Re: xSelect predicates

    There is a lot of XSelect examples in the file iLON100.xsd itself. I don't know if they are always up-to-date, but at least it's a good start point.

    About messageProperties_system - it's defined in iLON100_System.wsdl file which looks like some internal stuff. I think it purposely not documented and should be not used.

    UCPTenablePath: all properties of type E_Path are XPath to select some special text from other configuration parts. I think I saw an example of it somewhere in the programmers guide, maybe for scheduler. In this case it should be <UCPTenablePath>../DataPoint[UCPTnickName="MyEnableDP"]</UCPTenablePath>; the DP itself must be of type UFPTalarmNotifier_Input_DpRef, with <UCPTnickName>MyEnableDP</UCPTnickName>.

    • Post Points: 20
  • 06-19-2008 10:43 AM In reply to

    • jster23
    • Top 10 Contributor
    • Joined on 04-03-2008
    • Posts 17
    • Points 235

    Re: xSelect predicates

    dev26,

     

    Great catch on the ucptpointName!  This is definitely in the iLON100.xsd (see below), and an xSelect example demonstrating how to use it needs to be added to section 5.3.4 of the Programmer’s Reference.  

     

    <complexType name="UFPTdataLogger_Data">........

     

    xSelect="//Item[@xsi:type="UFPTdataLogger_Data"][UCPTlastUpdate>="2007-01-15T15:30:21Z"][position()<50]"                                                                               xSelect="//Item[@xsi:type="UFPTdataLogger_Data"][UCPTpointName="Net/LON/BAS/Data Logger 1/nviInput"][UCPTlastUpdate>="2007-01-15T15:30:21Z"][position()<50]"                                            

     

    Daniel, 

    I will check on whether we can (or should) post an example on how to use the messageProperties_system method.

    However, under most circumstances you should be able to read the nvoTimeDate data point on the Real Time Clock FB. I will say that I did observe nvoTimeDate being set to 00-00-00 00:00:00 on one of my SmartServers. In this case, I had added the RTC FB in LonMaker and then synced the SmartServer to the LNS network database. I then deleted the RTC FB in the SmartServer tree (can't recall why), and then added  a new one in the SmartServer tree.  On my other SmartServer, I added (or unhid) the RTC FB in the SmartServer tree, and it currently has the correct value.

    Where did you add the RTC FB, and are you syncing to LNS or are you operating the SmartServer in Standalone mode. Please describe your scenario.

    Thanks,

    Jonathan 

     

     

     

    Jonathan
    Technical Writer, Echelon
    • Post Points: 20
  • 06-19-2008 11:47 PM In reply to

    • lumatec
    • Top 10 Contributor
    • Joined on 04-29-2008
    • Posts 63
    • Points 870

    Re: xSelect predicates

    Hi Jonathan,

    Thanks for your help.

    messageProperties_system:

    - As this is part of the methods described in chapter 19 of the Programmer's Reference, I guess it SHOULD be included.

    - If I'm right, for the methods described in chapter 19, the 'iLON100_system.WSDL' is needed. I couldn't find any mention of that file in the Programmer's Reference.

    - If I'm right, the 'SystemService_Read_Info' asks for a string (not an object from the WSDL) as input parameter. I guess that's still the old (iLON100e2-) XML style, where you had to provide a string as input.

    Time data:

    - I migrated an e3-network to a SMART and, after syncing to LNS, switched to standalone mode.

    - Some time later, when I tried to read the nvoRtTimeDate, I realized, that it's always the same value that is returned.

    - I then Deleted and (re-)Added the RealTimeClock in the tree, with no success.

    I can't tell exactly the time when the problem occurred. I'm sure it worked fine before migration (I have other iLON100e3 that work correctly). Maybe it's the migration process that doesn't work right. Maybe it's something that happened later. I'd really like to know in order to avoid that in future. It never happened on the e3.

    That's why I used the SystemService_Read_Info, reading the 'SI_TIME'. That DOES work. But writing the value with SystemService_Write_Info doesn't work because I have no idea what the 'messageProperties_System' is. So, whatever I try, I'm stuck.

    Best regards,

    Daniel

    P.S.: If you are looking at p11-3 in the Programmer's Reference, you will find under "nvoTimeSet" a UCPTname '..../nvoIpAddress#2'. IP-Address = Time ? Maybe there's more than that...

    • Post Points: 20
  • 06-26-2008 1:04 PM In reply to

    • jster23
    • Top 10 Contributor
    • Joined on 04-03-2008
    • Posts 17
    • Points 235

    Re: xSelect predicates

    Daniel,

    It's either the migration or the sync that caused the problem.  I will try to reproduce the error with a test migration.  In regards to the System Service methods, the following code demonstrates how to read and write to the SmartServer's system info:

    static void Main(string[ args)

      {

      iLON_SoapCalls.BindClientToSmartServer();  iLON_SmartServer_System.iLON100portTypeClient SmartServer = iLON_SoapCalls._iLON;

     

       //------------Checking System Time-------------------------------------------

      //This code checks the SmartServer's time and system info and then sets a new time

      Console.Out.WriteLine("Checking the SmartServer's System Time\r\n -------------------------------\r\n -------------------------------\r\n");

      iLON_SmartServer_System.messageProperties_system time = new iLON_SmartServer_System.messageProperties_system();

      string timeData = "<iLONSystemService><UCPTsystemInfoType>SI_TIME</UCPTsystemInfoType></iLONSystemService>";

      string timeResult = SmartServer.SystemService_Read_Info(ref time, timeData);

      Console.Out.WriteLine(timeResult);

     

       Console.Out.WriteLine("\r\nChecking the SmartServer's System Information\r\n -------------------------------\r\n -------------------------------\r\n");

       iLON_SmartServer_System.messageProperties_system systemInfo = new iLON_SmartServer_System.messageProperties_system();

       string staticData = "<iLONSystemService><UCPTsystemInfoType>SI_STATIC</UCPTsystemInfoType></iLONSystemService>";

       string staticResult = SmartServer.SystemService_Read_Info(ref systemInfo, staticData);

       Console.Out.WriteLine(staticResult);

       Console.Out.WriteLine("\r\n Changing the SmartServer's System Time\r\n -------------------------------\r\n -------------------------------\r\n");

       iLON_SmartServer_System.messageProperties_system revisedTime = new iLON_SmartServer_System.messageProperties_system();

       string revisedTimeData = "<iLONSystemService><TIME>SI_TIME<UCPTsystemTime>2008-07- 05T10:20:00</UCPTsystemTime></TIME></iLONSystemService>";

       string revisedTimeResult = SmartServer.SystemService_Write_Info(ref revisedTime, revisedTimeData);

       Console.Out.WriteLine(revisedTimeResult);

       Console.Out.WriteLine("\r\nTake a 10-second break to see if time updates properly \r\n");

       Thread.Sleep(10000);

       iLON_SmartServer_System.messageProperties_system newTime = new iLON_SmartServer_System.messageProperties_system();

       string newTimeData = "<iLONSystemService><UCPTsystemInfoType>SI_TIME</UCPTsystemInfoType></iLONSystemService>";

       string newTimeResult = SmartServer.SystemService_Read_Info(ref newTime, newTimeData);

       Console.Out.WriteLine(newTimeResult);

       Console.In.ReadLine();

       }

     

    - Jonathan

    Jonathan
    Technical Writer, Echelon
    • Post Points: 20
  • 06-26-2008 11:07 PM In reply to

    • lumatec
    • Top 10 Contributor
    • Joined on 04-29-2008
    • Posts 63
    • Points 870

    Re: xSelect predicates

    Hello Jonathan,

    Thanks for that good advice. It works now!

    Regards,

    Daniel

    (Migration: At least in our case there was not only the time settings that went wrong during migration... Wondering if Echelon is currently working on some known problems.)

    • Post Points: 20
Page 1 of 2 (17 items) 1 2 Next >
©2008 Echelon Corporation