Hello all,
I am working on a library for pcvue, which needs some SCADA Basic. The problem of course is, that the minimum to run a program is to have a global program declared. The loading (init) of the program itself is made by a macro.
The interesting part now is, that even without a global program, the lib-program is loaded through the macro-animation and it seems to work.
in fact I am only using the SCADA Basic to filter two logviewer. No global variables or cross-references. Maybe it works as long as it is like that.
So the questions are now:
1. Is that a bug or a feature in 11.2? Or is it also possible in other version?
2. What are the limitations when not using a global program?
3. Which referent or developer should be able to give me a cleary answer?
Thank you.
Hi Johannes,
Please find attached the new documentation for working variables in 11.2. Perhaps that will help you.
Sylvie
Hello,
Not sure it can help but you can look at this very old mimic whuich include some VB script in order to create or update Global and INIT scada basic program.
Restart was necessary of course.
Hello, thank you,
yes if there are limitations, this will be my solution. I anymay will have a config-mimic to import an archive unit, there I make a button to set up the global program, if no exist.
Thank you.
But besides of that, netherless it would be interessting, where the limitations are, when not declaring a global prog.
By the way, I tried also with 11.1R and it also works.
For me there is noly 1 limit:
If the Global is not loaded then you should not be able running any Scada Basic instructions in a Scada Basic program.
Example:
This program (i.e. TEST.SCB) should work
Sub Main() Dim toto as single; toto = 5; @B1.B2.VALUE = toto; End Sub
This program (i.e. TEST.SCB) should NOT work (because of the Print)
Sub Main() Dim toto as single; toto = 5; PRINT(toto); End Sub
Hi Nico,
this is my code, so in fact I have a lot of SCADA Basic instructions inside and it works ;-):
sub filter()
dim l_id as str;
dim f as str;
dim lb_set as integer;
dim lb_get as integer;
dim lb_ala as integer;
'<<<<<<<<<<<<>>>>>>>>>>>>>
if(CmpString(GetArg("ARG1"),"small")==0)then
l_id = "log_small";
f = AddString("=((#t BEG ",Left(GetArg("WBRANCH"),Len(GetArg("WBRANCH"))-3),") && (#A16 == GEZE_alarm)) || (#t BEG ",GetArg("WBRANCH"),")");
end if
'<<<<<<<<<<<<>>>>>>>>>>>>>
if(CmpString(GetArg("ARG1"),"big")==0)then
l_id = "log_big";
lb_set = popup.nav_logbig_SET;
lb_get = popup.nav_logbig_GET;
lb_ala = popup.nav_logbig_ALA;
f = AddString(f,"=");
if(lb_ala == 1) then
f = AddString(f,"((#t BEG ",Left(GetArg("WBRANCH"),Len(GetArg("WBRANCH"))-3),") && (#A16 == GEZE_alarm))");
end if
if((lb_set == 1)||(lb_get == 1)) then
if(lb_ala == 1) then
f = AddString(f," || ");
end if
f = AddString(f,"((#t BEG ",GetArg("WBRANCH"),") && (");
end if
if(lb_set == 1) then
f = AddString(f,"(#A16 == GEZE_cmd)");
end if
if(lb_get == 1) then
if(lb_set == 1) then
f = AddString(f," || ");
end if
f = AddString(f,"(#A16 == GEZE_cmd_fdb)");
end if
if((lb_set == 1)||(lb_get == 1)) then
f = AddString(f,"))");
end if
end if
LogDisplay("FILTER", GetArg("WINDOW"), GetArg("WBRANCH"), l_id, f );
end sub
Therefore either it is a bug or I am wrong.
Please ask Jacques and let us know.
Nico
Hello all,
I think I can give you the answer:
The first 'file' you load, I use especially 'file' instead of 'program' is ALWAYS considered as GLOBAL (Global data and functions)
As for demonstration, on a blank project, create a file in the right pane 'Programs' containing the following:
Const GL_VAR = 123;
Sub Main()
Print("Hello");
End Sub
Just load it.
1/ You get a line with Ok s1xx (instead of s2)
2/ Select the line and clicking on Execute button will not print the message "Hello"
3/ Coding another program to print GL_VAR will work fine
So loading the (first) program using a macro would be the same.
BR
Edouard
The first 'file' you load [...] is ALWAYS considered as GLOBAL (Global data and functions)
Puh, that is mabye the answer that I would have expected least! I always thought that "global" program and "other" programs are fundamentally different entities and not mutually interchangeable.
Is this documented somewhere?
Edouard, I think you should have a short talk with Dominique/Jacques about this.
If this what you described is the normal behaviour then, YES, we must document it (doc SPR) and also update the training module.
Nico
Hello all,
yes Eduard, maybe you can also speak with Jacques. I already asked Jacques for a clearification via code-checkup. He promised me to clear it.
I have declared the SPR 61883. About documentation improvement.
I guess it is no use to discuss about what is a fact in SCADA Basic.
Let's turn it the other way round. If the R&D realize that what is written here is wrong, they can contact me.


