Graphics

 View Only
  • 1.  SQL Queries on XML-Datalinq / DateTime Functions

    Posted 07-09-2019 17:26

    Hi all,

    I'm currently building a project for a client that wants the XPression to trigger scenes by itself using data coming through datalinq.

     

    I have got quite a bit working already and the rest is just a matter of time but I am hitting some bumps along the way that I need to work around.

     

    Now I know that this type of automation is not really what XPression is meant for, but it is kind of a special setup and project. I have looked at the specs initially and found that I could do pretty much everything they asked using the tools in Visual Logic.

    So after about a week I have quite a few bits working already but here are a few remarks:

    • When you use Excel, you can make use of SQL Queries to sort data in your Datalinq to be able to reduce the amount of data. In my case, I can't use Excel because the automation-system is using XML-files to export data. This means I have to filter the results in Visual Logic, which means linking a lot of nodes which is taking a lot of time. It's also not much fun when there's a bug in the Datalinq node in Visual Logic...

    What I'm trying to do is filter all the records that contain a specific ItemCode and then use the first two records that are found. I was thinking of maybe using the SORT-selector but I haven't managed to make it work yet.

    • Does anybody know how the OUTPUT SELECTOR works?

    • When you use the ClockTimer Widget in a scene, you are able to use offsets to account for timezone changes. However, the DateTime Clock-node in Visual Logic does not have this feature. Also it would be useful to have an option to be able to have the clock switch between Daylight Savings Time. This would make it a lot easier when we have to convert UTC-time to local time.

    • The same applies to calculating with time. There is no node that allows you to add or subtract for example 2 seconds to a DateTime and get a new DateTime. This means that you need to do a lot of effort and calculations to be able to generate a new DateTime.

    • The same applies to comparing two DateTimes. Yes you can use the DateTime-delta but it does not tell you if one DateTime is larger or smaller than the other DateTime.

    • I am under the impression that there is something wrong with the calculations inside Visual Logic. When I was trying to make calculations with a precision of 8 digits, my value could not go above 10 or I would get a fixed value. I was doing this because I needed to check if one DateTime was larger or smaller than another DateTime. So I had to convert them to numbers to be able to compare them, but the values were getting too big for XPression to calculate with, so I had to use some other calculations to reduce them to be able to calculate with.

    So in short, there are a few actions that could be added to Visual Logic, mainly regarding to calculating / comparing DateTime that could make it a lot easier for us.

    Best regards,

    Ken



  • 2.  RE: SQL Queries on XML-Datalinq / DateTime Functions

    Posted 07-10-2019 19:47

    Do you have an example project that demonstrate the VL calculation issue you believe is preset? 

    If you can provide that to us please also tell us your version and build. 


    #XPression


  • 3.  RE: SQL Queries on XML-Datalinq / DateTime Functions

    Posted 07-12-2019 19:12

    Hi Kenneth,

    For the sorting/filtering of the XML data, you should look into XSLT transforms.  You can specify an XSLT on the XML datalinq configuration and it can be used to filter and arrange the data as you describe.  I'm not an expert on XSLT though, so I am not able to provide you with a sample that would do it (and it's heavily dependent on how your incoming XML is structured).


    #XPression


  • 4.  RE: SQL Queries on XML-Datalinq / DateTime Functions

    Posted 07-12-2019 19:17

    Hi Brian, 

    Thank you for your suggestion. I will have a look at that because it would save me a LOT of issues ;-)

    Thanks for the input.


    #XPression


  • 5.  RE: SQL Queries on XML-Datalinq / DateTime Functions

    Posted 07-12-2019 19:23

    @Garner,

    Instead of uploading the entire project, I have isolated the issue in a separate project so it's not too cluttered and lighter.

    You can get it from this link: https://we.tl/t-E0T4D7aWX8

    I have noticed the issue originally on V8.5 64bit (don't remeber the buildnumber though, but it's a newly delivered machine from Ross, so it's probably the latest official release.

     

    However I have created this little testproject on my own XP which is still at v7.1 build 3929, so it's not version-related.

    Best regards,

    Kenneth


    #XPression


  • 6.  RE: SQL Queries on XML-Datalinq / DateTime Functions

    Posted 07-12-2019 19:31

    Kenneth,

    The latest 9.5 beta version also includes two new features.  There is a date/time offset block to adjust date/time values; and the TimeDelta block will output properties for Equal, Greater Than, Less than, etc.

     


    #XPression


  • 7.  RE: SQL Queries on XML-Datalinq / DateTime Functions

    Posted 07-12-2019 19:33

    I just saw the email of the Build-system:

    • [implemented] a new Time Offset visual logic block to add/subtract values from dates/times
    • [implemented] the Time Delta block in visual logic now has property outputs to indicate which date is larger, or if they are equal

    I just love how reactive you guys are :-)

    Thanks a lot! V9 will make my life a lot easier :-)


    #XPression