2 Replies Latest reply on Sep 16, 2016 2:00 AM by knishimatsu RSS
    knishimatsu Newbie

    EMS5.3.2(wsems.exe and Lua) thingworx.server.setProperties/setPropery functions used but had errors

    Hello all.

     

    now we are developping new remoteThings with EMS5.3.2(using wsems.exe and Luascriptresource.exe).

     

    Then we have two serious problems.

     

    No.1)

    we sent one property value,and we verified this value received server.

    However the wsems.exe is displayed message as below.

     

    [ERROR] 2016-08-27 17:45:32,168 SDK: twInfoTable_ToJson: NULL of bad infotable

     

    we sent property using by thingworx.server.setpropery function.

    we read the LuaDoc that included with the EMS5.3.2_archives.

     

    Why the wsems.exedisplayed ERROR message ?

     

    We used testing template.lua as follows.

    -------------template.lua----------------------------------

    module ("templates.example", thingworx.template.extend)

     

    local params = {}

    params = {

        ThingName = me.name,

        ThingTemplate = "TEST_TEMPLATE",

        Tag = "Sentinel",

        Tag_Term = "Sentinel_Service",

        Description = "EMS specifications check"

    }

     

    thingworx.server.invoke("CreateThing", params, "create_RemoteThings")

     

    local rtncode

    local rtnresp

    local prpsend = {}

    prpsend["member1"] = "Su-Metal"

    prpsend["time"] = os.time() * 1000

    prpsend["quality"] = "GOOD"

    rtncode,rtnresp =  thingworx.server.setProperty("member1", prpsend, p_data.name)

     

    -------------template.lua end----------------------------

     

    No.2)

    we sent some properties values using thingworx.server.setPropeties function.

    But Server is not received all values.

    And Server Application log has errors as below.

    ----------- server Application logs ---------------------

    2016-08-27 18:08:15.937 ERROR An Invalid Property Value Was Sent To [EXAMPLE_TEST Property: [null] Administrator c.t.t.c.RemoteThing WSExecutionProcessor-10

    2016-08-27 18:08:15.937 ERROR An Invalid Property Value Was Sent To [EXAMPLE_TEST Property: [null] Administrator c.t.t.c.RemoteThing WSExecutionProcessor-10

    2016-08-27 18:08:15.937 ERROR An Invalid Property Value Was Sent To [EXAMPLE_TEST Property: [null] Administrator c.t.t.c.RemoteThing WSExecutionProcessor-10

    ----------------------------------------------------------------

    In the case,wsems.exe & luaScriptResurce.exe does not output an Error

    We used testing template.lua as follows.

    -------------template2.lua----------------------------------

    module ("templates.example", thingworx.template.extend)

     

    local params = {}

    params = {

        ThingName = me.name,

        ThingTemplate = "TEST_TEMPLATE",

        Tag = "Sentinel",

        Tag_Term = "Sentinel_Service",

        Description = "EMS specifications check"

    }

     

    thingworx.server.invoke("CreateThing", params, "create_RemoteThings")

     

    local rtncode

    local rtnresp

    local prpsend = {

                      { name = "member1",value="name1",time=os.time()*1000,quality="GOOD" },

                      { name = "member2",value="name2",time=os.time()*1000,quality="GOOD" },

                      { name = "member3",value="name3",time=os.time()*1000,quality="GOOD" }

                    }

    rtncode,rtnresp = thingworx.server.setProperties(prpsend, p_data.name)

    -------------template2.lua end----------------------------

     

    We are for the first time to build the EMS with wsems and Lua.

    So, we still lack understanding.

     

    Please let us know if you have some advise and question.

     

    Sincerely