Hi All,
One our customers want to delete variables with VARIABLE instruction in SCADA BASIC.
In the online help there are some informations regarding the deletion but it's not clear.
Does anywone have an idea ?
Thanks in advance
Ibrahima
There used to be a perfectly working method: Use the import verbs and modes such as VARIABLE(IMPORT).
In a SCADA Basic script, called when you need to delete the variables, create a text file (ideally somewhere in a user temp folder), fill it with a series of lines such as:
DELETE,MyVarX DELETE,MyVARY
(more on the syntax is somewhere in the doc or addenda)
Then save the file and call the SCADA Basic instruction VARIABLE(IMPORT,Filename).
There are many variations to this:
- The file is not always necessary because there is also a mode that can import a SCADA Basic buffer (you fill in a memory buffer instead of saving a file)
- The same technique allow you to create or modify variables, expressions, events, trends...
A bit of magic, and don't forget to care the error handling...
In fact, I suggested Ibrahima to post something about variables deletion because I did not succeed in finding neither the documentation, nor a sample project.
The syntax DELETE,MyVarX does not seem to work.
I decided to go further and got the answer in PcVue source code.
The expected keyword is DNVAR,MyVarX
Thanks Edouard for the fix 😉
And sorry for having written the syntax as if I had used it a couple of days ago (it's a recollection dated back in the early 2000's, I am getting old...).
In fact, there is a bit of information about the syntax in the online help, somewhere in the SCADA Basic section. the topic is named "Deleting a Variable, Trend or Expression", and is easily found if you search for "DNVAR".
I will update the SPR because, while useful, this topic is misleading in many ways:
- Such a syntax can off course be added to the varexp.dat, but it is obviously useless in this case. This syntax is useful in cases you import a file you have populated by other mean of configuration (a script, an external config tool...)
- The explanation seems to miss the point because it does not explain that this syntax can be used to add/remove/change configuration items by importing an Asciid file.
- Such a file can be imported by SCADA Basic, but it is probably not the best section to describe the syntax itself.
- And a warning shall be added, because this configuration import method is no longer the good choice for external configuration. The good choice is the XML generic import. It remains valid for some border lines use cases. I imagine Ibra is facing such a border line use case.
Regards
Thank you!


