get the ScalarArray_Int32 values from script

get the ScalarArray_Int32 values from script

  • 24 luglio 2019 alle 2:32 pm #34153
    ceremelg
    Partecipante

    hello everyone,

    I have a OPCUA server which exposes a tag of type ScalarArray_Int32 and I would like to access its elements.

    I have made a screen with a button and an EditDisplay
    I have followed the Tutorial (refering to Man_Eng_Next3.0_Tutorial.pdf) at the section 4.8 and I have configured the options for the editDisplay.
    So I wrote [0] into the “expression Code for Input” textbox tryig to access the firts element but when I run the HMI what I get is a red triangle and the text “null” into the EditDisplay.

    then I have tried to do it from script.
    So I have created a script and I call it by pressing the button.
    Inside the script editor, pressing ALT+BACKSPACE i can see all the variables and there is my variable: “Station0_ExpMethods_valoriTasto_valoriTasto_ScalarArray_Int32”
    But if I try to show it through MsgBox Station0_ExpMethods_valoriTasto_valoriTasto_ScalarArray_Int32(0) it does not work and i got the error:
    An error occured in the script “script1” the method or operation is not implemented

    can anyone help me?

    cheers Giacomo

  • 26 luglio 2019 alle 12:10 pm #34212
    ceremelg
    Partecipante

    up

  • 26 luglio 2019 alle 12:49 pm #34219
    ThomasIslera
    Partecipante

    Hi Giacomo,

    Have You already evaluated these information available on the Movicon Help?

    http://www.movicon.info/HelpNExT3.4/en-US/PlatformNext.htm#t=mergedProjects%2FScripting%20VB_DOCNET%2FLanguages%2FScriptResources%2FProjectBasicScript%2FBasic_Script_Variables.htm&rhsearch=array&rhhlterm=array&rhsyns=%20

    BR
    Tom

    • Questa risposta è stata modificata 2 mesi, 3 settimane fa da ThomasIslera.
  • 26 luglio 2019 alle 1:51 pm #34221
    ceremelg
    Partecipante

    hi,

    yes I have tried to run this script:

    Dim x = ScriptDocument.GetVariableValue(“valoriTasto”)(0)
    MsgBox x

    but i got the error: The method or operation is not implemented.

    this is the physical tag address:
    OpcClientDriver.Station=Station0|LinkType=1|AN=Quickstart Reference Server|IP=\ExpMethods\&\valoriTasto\&\valoriTasto&\valoriTasto\&\valoriTasto&\valoriTasto&\ScalarArray_Int32|EU=opc.tcp://localhost:62541/Quickstarts/ReferenceServer|RP=/2:ExpMethods/2:&/valoriTasto/2:&/valoriTasto&/valoriTasto/2:&/valoriTasto&/valoriTasto&/ScalarArray_Int32|RN=ns=2;s=/valoriTasto/valoriTasto/ScalarArray_Int32

    cheers

  • 31 luglio 2019 alle 3:02 pm #34244
    Joseph
    Partecipante

    Hi Giacomo,
    What I can suggest, is to try before in a display with the simple syntax in the expression code for input [0] (for the first array element , then [1] for the second and so on)
    If it works, you can move within the code if needed. I thinlk it is necessary to proceed in this way to make sure that you have good communication before.
    I don’t know your script context so it is not easy to help…contact the Progea support sharing your example project.
    I always get “real time” answers! (few days) They are very good guys!
    BR
    Joseph

  • 1 agosto 2019 alle 11:01 am #34255
    ceremelg
    Partecipante

    hi, i have solved it.
    Actually was just a matter of configuration.

    Thank you for the answerby the way.

  • 6 agosto 2019 alle 12:08 pm #34284
    Joseph
    Partecipante

    Hi,
    good! I’m glad that you solved the issue!
    Bye
    Jos

Devi essere loggato per rispondere a questa discussione.