Tick spacing on a gauge control

I am using a gauge control to make a tachometer indicator.  The tick spacing that I get on the gauge is quite a bit finer than I would like (too many ticks).  Does anyone know how to adjust the tick spacing on the control?  I want a scale that ranges from 0 to 6 with a total of 7 ticks (0, 1, 2, 3, 4, 5, 6).

Hi cbfsystems,
you can use the scale function of this control. With this function it is possible to set user defined points. right click the control and select axis arrangement, select user-defined. After that you can insert subdivisions.
Mike
Message Edited by MikeS81 on 03-31-2008 04:57 PM
Attachments:
Unbenannt 6_LV80.vi ‏6 KB

Similar Messages

  • How to add A Gauge Control in VC++ MFC Application

    How to add A Gauge Control in VC++ MFC Application.
    i want to add Gauge Control in my Application. like meter.
    ther meter should perform depends upon the value.
    for example , Assume the meter have 10 units 1-10 . if the value (ie, input ) is 4 the meter point out the 4 like that.

    How to implement CProgressCtrl to like this.
    https://social.msdn.microsoft.com/Forums/getfile/643828
    You need to implement this all by your own or if you are lucky you may something find @Codeproject, CodeGuru, ...
    Here you will find examples on creating custom controls (in general)
    http://www.codeproject.com/Articles/521/Creating-Custom-Controls
    https://msdn.microsoft.com/en-us/library/bk2h3c6w.aspx?f=255&MSPPError=-2147217396
    You will find a lot more stuff if you try your prefered search engine.
    Maybe this one fits the best to your requirements:
    http://www.codeproject.com/Articles/9375/CStatic-derivative-CSpeedoMeter-class
    Best regards
    Bordon
    Note: Posted code pieces may not have a good programming style and may not perfect. It is also possible that they do not work in all situations. Code pieces are only indended to explain something particualar.

  • Dynamic JSlider tick spacing

    I run several times into the situation where I needed to hardcode a JSlider tick spacing into my program. I always found it difficult to define the tick spacing because a good looking tick spacing depends on the current size of the JSlider on screen and its maximum value.
    For my purposes I created a short function that automatically sets a "good looking" tick spacing (labels do not cover more than half of the slider width and use familiar spacing values like 1,2,5,10,20,50,...).
    I wanted to share this little piece of code with you, maybe it helps someone...
    Here it is:
        private void setMajorTickSpacing(JSlider slider, int maxValue) {
            Graphics graphics = slider.getGraphics();
            FontMetrics fontMetrics = graphics.getFontMetrics();
            int width = slider.getWidth();
            // try with the following values:
            // 1,2,5,10,20,50,100,200,500,...
            int tickSpacing = 1;
            for (int i = 0, tmpWidthSum = width + 1; tmpWidthSum > (width / 2);
                    i++) {
                tickSpacing = (int) Math.pow(10, (i / 3));
                switch (i % 3) {
                    case 1:
                        tickSpacing *= 2;
                        break;
                    case 2:
                        tickSpacing *= 5;
                tmpWidthSum = 0;
                for (int j = 0; j < maxValue; j += tickSpacing) {
                    Rectangle2D stringBounds = fontMetrics.getStringBounds(
                            String.valueOf(j), graphics);
                    tmpWidthSum += (int) stringBounds.getWidth();
                    if (tmpWidthSum > (width / 2)) {
                        // the labels are longer than the slider
                        break;
            slider.setMajorTickSpacing(tickSpacing);
            slider.setLabelTable(createLabels(slider, tickSpacing));
        }To have your tick spacing dynamically adopted when the user resizes the window, you should use a code snippet similar to the following one:
            jSlider.addComponentListener(new java.awt.event.ComponentAdapter() {
                public void componentResized(java.awt.event.ComponentEvent evt) {
                    setMajorTickSpacing(jSlider, maxValue);
            });There is still room for improvement, like handling minimum values etc.
    Feel free to improve the code. And please share it with us! :-)

    OK, I added some dukes. They will be spend on code improvements. ;-)

  • LabVIEW Gauge Control Digital Display

    I have created a Gauge control to emulate a compass rose as suggested by other posts. I have populated the control with 0, 30, 60, etc to 330 and left a blank for the last entry, as setting 360 overwrites the 0 entry. I have selected "Allow Undefined Values" and everything works as required on the Development System, click on the 30, the text entry box shows "30", use the text entry box to select <Other> and a separate digital text box opens up to allow something like 15 to be entered, which then appears in the digital display within chevrons <15> as described in LabVIEW Help, and the extra digital text box then disappears.
    When I build the system and install it on the target computer, this latter action does not happen. The extra digital text box remains in view on the panel, so that I have two values displayed. This extra box remains on display even when a value is selected via the mouse. What is going wrong?
    Solved!
    Go to Solution.

    Thanks for the prompt response, here are two pictures "Gauge" from the target machine, and "Gauge Dev" from the development machine.
    Attachments:
    Gauge.JPG ‏16 KB
    Gauge Dev.JPG ‏17 KB

  • Free circular gauge control

    Download: http://www.beaugauge.com/download/en/free/BeauGaugeActiveXControls.zip
    Use circular gauge ActiveX control in your LavView project
    http://www.beaugauge.com/en/edu036.htm
    For additional resources, please visit the website.
    http://www.beaugauge.com

    In case of std price yr stock will get updated with this price whatever may be the case..
    MAP--in this case whatever the current price of posting stock will be added to previous price with this current price..
    This is the concept of MAP & STD price..

  • Help needed with dramatical bad performanc​e of gauge controls

    This VI causes the problems
    With kind regards
    Martin Kunze
    With kind regards
    Martin Kunze
    KDI Digital Instrumentation.com
    e-mail: [email protected]
    Tel: +49 (0)441 9490852
    Attachments:
    Page 1_3D_1.vi ‏235 KB

    Martin, listen to CC, the main problem really is overlapping objects (text and digital displays)! The LabVIEW application without overlapping object is 500x faster than yours (See attached, LabVIEW 7.1). I get loop times of below 1ms (>1KHz!) versus your original version with 400-500ms, so LabVIEW can beat your C application by 10x IF you avoid overlapping objects.
    (I am using an ancient 1GHz PIII laptop, so the loop times on a modern computer will be much faster)
    I agree with Aaron that your property nodes contribute to the problem. After deleting all unecessary property node terminals (they never change!), the only bad one is the constantly variable color scale of the oil pressure. Is this even meaningful to the user? This property write alone costs a few tens of ms(!) so it might be reasonale to either get rid of it completely or update it at a lower rate (In the attached example it happens every 100 iterations, modify as needed (LAbVIEW 7.1)).
    If you go back to 200ms loop times, my version will only use a few % of cpu.
    Note also that you can do your entire color ramp with 4 elements, six is overkill and just complicates things. I would also get rid of the blinking, it's just too ugly. Use a Red LED to indicate the special condition.
    Yes, the performance hit with overlapping objects is surprising, but I am sure there is a good reason and we win elsewhere. It has been my experience that most aspects of LabVIEW are highly optimized under typical conditions (IF properly used!).Message Edited by altenbach on 05-09-2005 01:53 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Page03faster.vi ‏194 KB

  • Knob problems

    Here are list of steps which result in my  problem, which occurs programatically as well as in the vc++ resource editor.
    1) Create a top gauge  meter with a range of 0 to 10.
    2) Add a pointer that is invisible, set the fill colour to blue and fill value to less than 3
    3) Add a pointer that is invisible, set the fill colour to green  and fill value to less than 6
    4) Add a pointer that is invisible, set the fill colour to red and fill value to less than 10
    note the orig pointrer should be set to visible with no fill style
    Now siwtch style to 'dial' all the fill info is lost and needles become visible, -is this a known bug?
    Also when Iam using a knob control how do Programatically turn off the numeric labels on the scale but keep the ticks, it cna be done easily with vc++ resource editor.
    I thought there would be a setvisible method in CNiLabels, but that is not the case
    Also having a problem with the NINumedit component when comes to redrawing its 3D border, seems to loose it after it gets focus. The component  then becomes flat style component.
    If i force a redraw by resizing  the formview it sits on it regains its style.
    My version of mstudio is 7.1.0.306.
    Cheers,
    Paul

    Hi,
      With regards to the pointers on the CWKnob control, this was reported to R&D (# CAR 44A4POW3) for further investigation.
    R&D is currently investigating this issue.
    As far as making the labels dissappear, you can do this using ValuePairs (for every major tick, you need to put in a value pair) :
    // Specify the axis range and tick spacing for the CWSlide control.
    m_knob_control.Axis.Maximum = 10;
    m_knob_control.Axis.Minimum = 0;
    // Set divisions to zero to display control without ticks and labels.
    m_knob_control.Axis.Ticks.MajorDivisions = 0;
    m_knob_control.Axis.Ticks.MinorDivisions = 0;
    // Add a value pair to indicate the low end of the axis value range on the CWSlide control.
    CNiValuePair vpair = m_knob_control.Axis.ValuePairs.Add();
    // Specify the value pair text.
    vpair.Name = "0";
    // Specify the axis value with which to associate the value pair.
    vpair.Value = 0;
    // Add a value pair to indicate a point along the axis value range on the CWSlide control.
    CNiValuePair vpair2 = m_knob_control.Axis.ValuePairs.Add();
    // Specify the value pair text.
    vpair2.Name = "5";
    // Specify the axis value with which to associate the value pair.
    vpair2.Value = 5;
    // Add a value pair to indicate the high end of the axis value range on the CWSlide control.
    CNiValuePair vpair3 = m_knob_control.Axis.ValuePairs.Add();
    // Specify the value pair text.
    vpair3.Name = "10";
    // Specify the axis value with which to associate the value pair.
    vpair3.Value = 10;
    // Specify that the value pairs are associated with the axis values and that the labels are visible.
    m_knob_control.Axis.ValuePairs.Location = CNiValuePairs::LocationValue;
    // decide if we're showing the labels or not (so Value here is just a boolean flag I was using - obviously you don't need this if you're setting it permanently off)
    if (Value)
       m_knob_control.Axis.ValuePairs.LabelType = CNiValuePairs::LabelNone;
    else
       m_knob_control.Axis.ValuePairs.LabelType = CNiValuePairs::LabelName;
    The third issue of the NiNumEdit dropping it's 3D style border when re-drawing - do you have a small project to demonstrate this?
    Thanks
    Sacha Emery
    National Instruments (UK)
    // it takes almost no time to rate an answer

  • How can I create a gauge type control that has settable color ranges?

    I need a custom gauge style (360deg) control the has a definable color range
    (like the meter control)... but, I can't seem to customize the curvature of
    the meter type control. Anybody have any ideas?
    Bill

    The gauge control has a definable color range if you right click on the control and choose Visible Items>Ramp. The colors and marker locations for each color can be set with the property Scale.MarkerValues. To change the curvature, postion the mouse pointer over either the first or last value until the pointer changes to a semicircle and click and drag to the curvature you want. To rotate the whole range, do the same thing to any of the other numbers on the scale. To change the min or max value, just use the text tool to highlight the value you want to change and type a new value.

  • Waveform graph - Number of major ticks on x scale

    Hello all!
    I'm trying to display meteorological measurements throughout a day in a minute resolution. For that purpose I'm using a Waveform Chart with fixed length on x-axis (0-1440). However, major ticks are distributed by 100, i.e. 0, 100, 200, 300, ..., 1400, 1440. How can I distribute these points by 60, so that I can put hour labels 00:00, 01:00, 02:00 etc.
    Thanks!
    Regards,
    Marko.

    There is a Marker Spacing property to which you can write a custom array. This sets the scale Marker spacing to arbitrary.  See attached vi as an example.  Work still needed to make it look acceptable regarding labels.
    You could make the marker every 1 hour, the minor tick (not labled) cannot be controlled,  A long chart will have 10 minute minor tick
    - half the size of the chart and it will be 20 minute
    If you want continuous output I think you need to use a Waveforn Chart rather than a Waveform Graph with chart history length set to 86400 (number of seconds in 24 hours
     

  • Pages 5: Spacing between bullets (not line spacing)

    How can I control the spacing between bullets?
    1. I clearly see how to control the spacing around a bullet relevant to its text. That's not what I'm referring to.
    2. I clearly see how to set line spacing. That's not what I'm referring to.
    What I'd like to do is keep a line spacing of 1.0 on the text, but add padding between list items (between bulleted content). The method in Pages '09 was to add buffer space "after the paragraph" (or before). However, in Pages 5.0 this option does not exist. Some of my bullets have enough content that wraps, which is why line spacing is not an acceptable solution.
    How can I control spacing between bulleted list items, such that each chunk of content is better separated?
    Thank you!

    Silly me. I have located it, by expanding the Spacing menu. The control I'm looking for is right there.
    I've included a screencap, in case anyone else misses the obvious like I have. Thanks for looking!

  • How do you modify the appearance of a control

    I want to add a red arc on the outer edge of a meter control.  The arc should only cover about 120 degrees.  Is there a way to modify the graphics of a control?
    Thanks in advance.

    Yes. It's discussed in the manual.
    You can also peruse this example: Customizing the Gauge Control in LabVIEW.
    If you search you'll find lots more information.

  • Expression for a gauge in VC

    Hi,
    I'm new to VC. Trying to create a gauge on a query. In my iview, I have a query which displays data in a table (Force Element and Material Readiness).
    I added a form view connecting it with the table. In the form, i added a gauge "NUM1". now I'm trying to enter an expression for this field but have no idea how to do this.
    Please help.

    Hi Frank,
    Try the below steps to create a gauge control.
    1. Open the 'Properties' of Gauge control(num1) using right click option.
    2. In the 'General' tab set 'Expression' as @name(data field which you want to show using gauge and the data field should be  numeric).
    3. In Range' tab set the maximum and minimum range as you like.
    4. Now deploy the model.
    Regards
    Basheer

  • Admin password not accepted in Parental Controls 10.8.2

    When logged in to my kids accounts I am trying to make changes to System Prefs and open allowed apps. (those I have ticked as allowed in Parental Control prefs) and the admin name and password is rejected and I get the 'wobble box'! Arghhh!!!!!!!
    The same admin. name and master password are accepted when logging in to my main account and everywhere else...just not in parental controls. None of the ticked allowed items can be opened by parental controlled accounts.
    Makes the parental controls totally unusable.
    Bug! Bug! Bug!

    This is an should be an easy fix. Go to System Preferances and choose users and groups. Click on the lock and type in the admin details. Then click on your account and change the password. Sorry if this doesn't work.

  • Displaying labels for Minor Ticks?

    Hi!
    I am using MSVC++ 6 with MeasurementStudio6. I want to have the minor ticks have labels in logarithmic scaling when no major tick values are shown. Is this possible with version6 or only in the .NET version.
    Thanks,
    Miklos

    Miklos,
    There is no built in way to add labels to the minor ticks in VC++ or .NET controls. However there are "Value Pairs" in VC++ and "Custom Divisions" in .NET. This basically allows you to add a label to axis at a specified value. You can have a collection of these to form a more detailed scaling for each zoom situation. You could for example check the range that is being viewed, calculate the values where it would make the most sense to have the labels and add the value pairs programmatically.
    I suggest that you file a suggestion at http://www.ni.com/contact (go to product feedback) that way our engineering department will be notified.
    I hope this helps you get started.
    Regards,
    Juan Carlos
    N.I.

  • Currency in 'Cost Centers: Actual/Plan/Variance' report for specific user

    Hi there CO people, I'd like to ask about currency settings in CO S_ALR_87013611 report (Cost Centers: Actual/Plan/Variance)
    The question is ... where can I define the currency in which report output should be displayed?
    I've got such situation, that amounts for USER_X are displayed in CURR_X currency, whilst for USER_Y amounts in report are displayed in CURR_Y currency.
    Could You tell me some tip? Or give some literature-track to follw? I'd be thankful for help. Greetings. P.

    USER_X -> TCode: RPC0 -> Tab: Report currency -> Tick 'Objeck currency' (Before was: 'Controlling area currency')
    now USER_X has got the same currency as USER_Y
    That solved my problem
    Greetings

Maybe you are looking for