How to enter a variable using a slider bar, which macro should I use. Does anyone have an example.
A "Graphic Symbol" (GS) dynamic elemt is used for a slider. See menu "Animate" in the Grafics Editor. Select "Continuous" movement in the initial selection. In the General Tab of the GS choose "Action". In the actions dialog:
- Cchoose "Write variable" as an action
- Check "Input by sliding symbol"
- Specify the Variable which will hold the result of the slider action
- Press the "Operation" button and specify Min and Max in the "Action write variable" dialog
A bitmap or another object can be selected represent the object you slide.
The sliding positions can be configure in the "Position" tab.
Best have a look at the Engineering Manual for Operator Stations, Section 3 Graphic Displays, Chapter Grafik Symbol and follow the links from there to the explanations of the tabs.
If you don't feel comfortable using the GS, I propose to wait for the Macro that Sumit is preparing.
For a Horizontal Slider with Bargraph as used in the faceplates to indicate the output value of a PID controller for example there is a Macro calle "BarH". You will find it in the MACROS.BOL library in the Macros directory in the Freelance installation directory.
Here are the parameters used
It is quite easy to create a slidebar variable input in Freelance. What You need to do is assign variable value to position of graphic element in Graphic Display. To do this:
1) Start with creating element You will slide (a triangle or square or whatever You want).
2) From Animate menu choose "Graphic symbol".
3) In the "Movement of GS" window choose Continuous.
4) In Display tab select "Object name" and push "Display" button. It will send You to Your Graphic in which You should select the element created in first step of this instruction. Then push "Return to object" button . It will send You back to Graphic symbol parameters window, but with "Object name" field filled:
5) In Process value tab input Your variable name (in my case test1):
6) In Scale tab You can change the limits of change that can be applied by sliding.
7) In Position tab choose the relative position of movement. Just think of it this way: If one end of slider is in the current position of my element, where will be the other end of the slider? In my case I want it to be 1000 units higher then the starting position, so I set -1000 in "y" field and 0 in "x" (no horisontal sliding possible):
8) In General tab choose Action and in Actions window choose "Write variable" from the list. input variable name and check "input by sliding symbol". Set other options by clicking "Operation" button.
9) Setting variable value by sliding requires confirmation, so add some kind of OK button for this purpose.
10) You've done it - now You can add another element to represent the scale of your slider or whatever You need and load changes to OS.