Welcome to the new Schneider Electric Community

It's your place to connect with experts and peers, get continuous support, and share knowledge.

  • Explore the new navigation for even easier access to your community.
  • Bookmark and use our new, easy-to-remember address (community.se.com).
  • Get ready for more content and an improved experience.

Contact SchneiderCommunity.Support@se.com if you have any questions.

Invite a Co-worker
Send a co-worker an invite to the Exchange portal.Just enter their email address and we’ll connect them to register. After joining, they will belong to the same company.
Send Invite Cancel

[Imported] How to use internal variables in script?

EcoStruxure Geo SCADA Expert Forum

Find out how SCADA systems and networks, like EcoStruxure Geo SCADA Expert, help industrial organizations maintaining efficiency, processing data for smarter decision making with IoT, RTU and PLC devices.

Janeway Janeway

[Imported] How to use internal variables in script?

>>Message imported from previous forum - Category:Scripts and Tips<<
User: mchartrand, originally posted: 2018-10-23 17:08:00 Id:174
This is a re-posting from the obsoleted (October 2018) "Schneider Electric Telemetry & SCADA" forum.


Say I have an internal long variable named "GenChoice", and I want to incorporate it in my script. Do I have to use a code to call it in my script? And if so, what code is it.
I want to use "GenChoice" to store a value:
GenChoice = InputBox("Enter number")
And once a number is entered, I would display the value of the variable in the mimic._**


I have done this using a Form to set a variable in the script and then set the Internal Variable to the script variable.

Server.SetOPCValue ".GenChoice.Value", ScriptVariable


Does this apply to all types of variables? I tried to use this in my code but it didn't work.
It says "the passed data type cannot be accepted for this item"._**


For variables yes it should other than a constant variable, because it is a constant.

You probably need to make it a String or an Integer to be right type.
CStr(value) CInt(Value)


What's the full use-case here?

You should keep in mind that ClearSCADA is a multi-user environment, so storing a value into the database (against an internal long) will be shared across all users, and not specific to a single user.

If you want this to be specific to a single user, and not shared across all users, then you might want to consider using the Registry script / animation methods.