Tag prefix Win CC - tags

I am busy with a C script in Siemens WinCC.
I would like to open a faceplate on in which I can open other faceplates.
Howerver, I would like to use the Tagprefix from the first faceplate in the second. Does anybody have an idea how I can give the tag prefix through?
Thanks in advance!
Tom

As You know, the tag prefix is a property of the screen window. You need to provide that data to the script running in the context of the picture inside the picture window from the parent screen window.
One solution is by using a text field "tagname" in the "faceplate" and use that as a source of the tag-prefix name. The tag-prefix can be transferred by a simple vbs script that runs "on open".
Use VBS "Item.parent.TagPrefix" and then give the result to the text field.
Or just from a button in the picture "Item.parent.parent.TagPrefix" is also ok.
The same in C would use the functions "GetParentPictureWindow", and return a string(lpsz) containing the name of the picture window. This name can be used to read the property of the object with this name using "GetPropChar" using "Tagprefix" as the property.
//PerD

Related

Save postgresql query in computer

I have this problem that I assume privilege-related. I want to save my query after I executed it, but here is the problem...
Wherever the location, the save button can not be enabled. Any help appreciated.
You need to type the file name in the input box on the top where you have "F:\", append file name there.
For example:
F:\my_file.sql
Once you type that it will make save button enable.

install4j: Configurable form change visibility from drop-down list

I have a Configurable Form and i want to change the visibility of another field based on the value of a Drop-down list.
For example I have a Drop-Down list with entries A,B and the variable name for it is testDD.
I have a Text field smtpMailServer that I want to display only if testDD's value is A.
I have tried the following approaches in smtpMailServer's visibility without success:
return ((String) context.getVariable("testDD")).equals("A");
return (context.getVariable("testDD")).equals("A");
and I've also tried to add a script to testDD Change Selection Script with The following code
context.setVariable("ThisFormConfiguration", selectedItem);
And use the code above with ThisFormConfiguration instead of testDD. But it's not working.
Could you please help me?
Thanks!
I have tried the following approaches in smtpMailServer's visibility without success
The visibility script of a form component is only evaluated when the form is shown. You should keep it, but it only handles the initial condition.
and I've also tried to add a script to testDD Change Selection Script with
The following code context.setVariable("ThisFormConfiguration", selectedItem); A
Using the "Selection change script" property is the right idea, but your script has no effect. There is no live binding from the variables to the form components, the variable is read when the form is shown and updated when the user clicks "Next".
You have to use the following selection script:
formEnvironment.getFormComponentById("123").setVisible(selectedItem.equals("A"));
where "123" has to be replaced by the ID of the text field.

What is the name space of conversion.val in C#?

I have one text box in C# window application.And i wants to set a initial value of this text box is zero.
so i use conversion.val(textbo1.text) method.
But it gives a error in name space.
I use Using Microsoft.visulbasic; name space but it is not working.
So which name space i use for conversion.val().
Please help me.
Thank you.
The namespace you are adding is correct.
Refer: http://msdn.microsoft.com/en-us/library/9da280t0.aspx
Only adding namespace might not work, you will have to manually add Reference to Microsoft.VisualBasic.dll.
You can add the reference as follows:
- Goto the Solution Explorer panel.
- Right click on References > Add Reference.
- Select the tab ".Net"
- Select Component "Microsoft.VisualBasic"
- Click OK.
Now you can use the Conversion class.
Note: You can find Solution Explorer in the View menu.
Good luck!

Dynamically add fields to input dialog

Is it possible to somehow add input fields to an input dialog (inputdlg()) in MATLAB when a specific event occurs, e.g. the user types in a certain value in one of the existing fields...?
Or is there any other 'hacky' way to achieve this so that the user doesn't have to click "OK" and I have to code to reopen another input dialog which contains more input fields..
Thanks!
inputdlg is not a built in function, so you might as well copy it, call it by another name and change its functionality.

How to match different text fields which are located in two different UnityScript files?

I am going to create two pages. In one page I create a textfield and a button. In text field I am going to write something. After click it on the button the next page will appear. I can move page from one page to another by using Application.Loadlevel(). In the second page, I have only one text field. I want to show the previous textfield value on the next text field, which is located in another page. But I can't do that thing. Please help.
This is one solution:
You can access fields (variables) in one script file which are present in another script file, this can be done my making that variable global, this way you can access it in another javascript file.
You need to make the text in the textfield global, so that you can access it in another script file (javascript in your case).
Global can be declared like this:
// The static variable in a script named 'TheScriptName.js'
static var someGlobal = 5;
// You can access it from inside the script like normal variables:
print(someGlobal);
someGlobal = 1;
And it can be accessed in another javascript like this:
TheScriptName.someGlobal = 10;
Link to Global in Unity Script Reference