Script at Factorystudio

Hi experts.
Nice day to all of you.
I’m practicing Script in Factorystudio version 9.2
In my Project, I created a display. And at Display I drop some symbol such as button, grid window, trend window… I knew that I can change their properties by property window for each symbol. But I want to change their properties by script on 2 environments:

  • CodeBihind of Display
  • Code at Task or class environment
    I don’t know how can I point to these symbol by Script.
    Please help me.
    Many Thank

Hi Manh,

What FactoryStudio version are you using? 9.2.x

Can you send us a print screen of Property Watch showing the properties that you want to change?

Best Regards,
Tatsoft Team.

Dear sir.
Thank for your feedback.
Please see below picture

  1. My Vesion is 9.2.12
  2. I want to use properties of components such as grid window, alarm window by script.

Hi Manh,

CodeBehind vs. Script

The CodeBehind and Script do the same, the only diffence is that you will have to call the script in the code behind, for example we create a class called “classesNumber1”, and we want to call the function called “Main”, we write the following line in the codeBehind:

image

Now, talking about the properties:

Here is an example reading the property field “MaxLines” of AlarmWindow, you can do the same to other objects.

In our example we called the control as “test1” and the AlarmWindow we called “field1”, the Tag “TagReturn” will receive the number 3000 because we are reading the MaxLines property.

You can do the same to other objects

For DataGrid:

For Trend Chart:

For button you can create a function in CodeBehind and it will be called every time you press the button:

Let us know if you understand or need some addicional explanation, please.

Best Regards,
Tatsoft Team.

Dear Sir.
Many thank your support.
I’m testing feature follow your instructions.
Best.

Hi Manh,

If you find any problem doing that, please let us know.

Best Regards,
Tatsoft Team.