get the ScalarArray_Int32 values from script
24 luglio 2019 alle 2:32 pm #34153
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  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?
26 luglio 2019 alle 12:49 pm #34219ThomasIsleraPartecipante
Have You already evaluated these information available on the Movicon Help?
- Questa risposta è stata modificata 2 mesi, 3 settimane fa da ThomasIslera.
26 luglio 2019 alle 1:51 pm #34221
yes I have tried to run this script:
Dim x = ScriptDocument.GetVariableValue(“valoriTasto”)(0)
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
31 luglio 2019 alle 3:02 pm #34244JosephPartecipante
What I can suggest, is to try before in a display with the simple syntax in the expression code for input  (for the first array element , then  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!
Devi essere loggato per rispondere a questa discussione.