FormatStringMode.DateTime, "mm: SS".

Hello. I changed the x axis to display the SS in time interval using the following;

grBurner.XAxes (0). MajorDivisions.LabelFormat () = New NationalInstruments.UI.FormatString (FormatStringMode.DateTime, "mm: SS")

It worked well with the frequency of update to 1 Hz.

Now the update is 4 Hz I show how the axis 1/4 seconds?  (mm: SS:?)

Thank you

Richard.

Hi Nick

No, it did not work. He put the label correct 01:30.00 = 1.5 min...

When data is added to the curve of the index of time is out by a factor of 4. That is to say. four samples is 4 seconds 1 second No.

Concerning

Richard.

Tags: NI Software

Similar Questions

  • DateTime on x-axis of the graph of the intensity

    How can the x-axis of a graph of intensity be configured to the DateTime data type, similar to the graphic waveform XAxis?  You can set the FormatString DateTime MajorDivisions, but has no way of installing the x-axis values.  Waveform curve has a foot (double [], DateTime, TimeSpan) function that will implement the XScale with the correct DateTime values, but the graphic intensity doesn't seem to have a similar capability.  I tried to configure the graphic intensity YAxis MajorDivisions DateTime Format string and pass then the plot function Tick values for the yScaleStart and YScaleIncrement, but it does not work probperly.  MS2012 release notes say that the curve of intensity has now an automatic formatting for displaying DateTime on axes X and Y.  I tried to use this feature to test the DateTime X and the ability to axis Y; However, the function of automatic formatting is not available for the chart of the intensity.  Any help is appreciated.

    Thank you!

    Jon

    Hello

    Try the following code piece.

                // Set the label format correctly            intensityYAxis1.MajorDivisions.LabelFormat = new NationalInstruments.UI.FormatString(NationalInstruments.UI.FormatStringMode.DateTime, "g");
                intensityYAxis1.Mode = NationalInstruments.UI.IntensityAxisMode.AutoScaleExact;
    
                double[,] data = new double[100, 100];
    
                for (int i = 0; i < 100; i++ )
                {
                    for (int j = 0; j < 100; j++ )
                    {
                        data[i, j] = (i + j) / (colorScale1.Range.Interval * 2);
                    }
                }
                // IntensityGraph only understands double values. But graph can interchange the data value from different types using the DataConverter provided by NI.
                intensityPlot1.Plot(data,
                    0,
                    1,
                    (double)DataConverter.Convert(DateTime.Now, typeof(double)),
                    (double)DataConverter.Convert(TimeSpan.FromDays(1), typeof(double)));
    

    It will be useful.

    Habim stone

    National Instruments

  • Insert the scale of relative time in Visual c# 08

    I am writing an application using Visual Studio 08 with measurement studio.

    I want to use the relative time scale on my X axis

    I tried to use

    Graph. XAxes [0]. MajorDivisions.LabelFormat = new NationalInstruments.UI.FormatString (NationalInstruments.UI.FormatStringMode.DateTime, ' % <%H:%M:%S> t "" ");

    Does not work.

    Can someone help me with this?

    Hello Al B,

    I figure out the solution to the question

    using hour: mm:s or H:mm:s, both work.

    Could you elaborate what difference should normally be the '%'?

  • Scattergraph crash when refreshing scale the y-axis beyond a certain range programmatically

    I have a subscription issue that I'm glued involving control scattergraph. I put my scattergraph to a fixed scale of 0-25 in the loading screen. When the graph is updated I check to see if the value of y is greater than the scale of the axis y. If and when it does update the scale fixed to range from 0 the previous litter, 25. So if it exceeded range 0-25, he was jumping at 0-50, if it exceeded 0-50, he was jumping to 0-75. The issue I'm having is well after the range 0-75 when he tries to change the scale of 0 to 100, the graph crashes and turns into a red x. I have no idea why it is doing at this point, so any help is appreciated. Here is my code to update the graph:

    yAxisMax = YAxis1.Range.Maximum
    If val1 > yAxisMax or val2 > yAxisMax then
    ScatterGraph1.YAxes (0). Range = New NationalInstruments.UI.Range(0, yAxisMax + 25)
    ScatterGraph1.YAxes (0). MajorDivisions.Interval += 5
    ScatterGraph1.Refresh)
    End If

    Don't know if it's important but I'm updating simultaneously two clouds of points.

    Hello

    I made a simple app with a scattergraph and a button on a form. It works very well. There must be something wrong with your values of Y.

    Public Class Form1

    As Double Dim yVal

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    Dim nowValue As Date
    Dim convertedValue As Double = 0

    Try
    nowValue = Now()

    convertedValue = CDbl (DataConverter.Convert (nowValue, GetType (Double)))
    yVal = yVal + 5

    ScatterPlot1.PlotXYAppend (convertedValue, Convert.ToDouble (yVal))

    Catch ex As Exception

    End Try

    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Try

    Me.XAxis1.MajorDivisions.LabelFormat = New NationalInstruments.UI.FormatString (NationalInstruments.UI.FormatStringMode.DateTime, "h:mm:ss tt")

    Catch ex As Exception

    End Try
    End Sub
    End Class

    Curt

  • Non-contiguous date ranges - user painted XAxis - values?

    I need to solve a problem similar to the described problem here.

    I use a WaveformGraph. I would like to paint the Xaxis values myself. My thought (sorry), is that it would be nice to be able to override the XAxis class to replace the values displayed, because they are that is painted.

    The data displayed are your standard double rooms more variety of time with each data point representing a sample on a regular interval (2ms). I want to view the data collected for several days, but I do not want to show the gaps that will follow when relying on the real sample time. Instead, I thought I could put my values of x to the offset (ms) from the beginning and instead of paint on the xaxis offset values, do a little calculation of date to paint the date value, according to the needs. This would allow me to set the gaps as needed. Alas, I'm not finding an overridable event in XAxis.

    Is there another way for me to explore?

    Hello jsytniak,

    While it may not really meet your needs, I came upwards with an example rather far-fetched that I think that shows what you are looking for, and I hope you can find a few pieces of it useful.  Here is a screenshot of the final result:

    You will notice that at the point of transition, ago 20 seconds missing, who might as well be days. The code behind this example is below, with important bits highlighted:

    namespace CustomXAxis
    {
    partial class Form1: Form
    {
    public Form1()
    {
    myFormatString customFormatString = new myFormatString();

    InitializeComponent();
    xAxis1.MajorDivisions.LabelFormat = customFormatString;
    transitionAnnotation.Visible = false;
    }

    public static startTime double;

    private void button1_Click (object sender, EventArgs e)
    {
    AnalogWaveform[] dataWaveforms = new AnalogWaveform[2];
    dataArray double [] = new double [5000];
    Calendar of WaveformTiming = WaveformTiming.CreateWithRegularInterval (TimeSpan.FromSeconds (.002), DateTime.Now);
    AnalogWaveformPlotOptions plotOptions = new AnalogWaveformPlotOptions (AnalogWaveformPlotDisplayMode.Time, AnalogWaveformPlotScaleMode.Raw);
               
    for (int i = 0; i)< 20000;="">
    {
    If (i<>
    dataArray [i] = Math.Sin (i*.01) * 10;
    if(i==5001)
    {
    dataWaveforms [0] = AnalogWaveform. FromArray1D (dataArray);
    dataWaveforms [0]. Timing = calendar;
    }
    If (I > 14999)
    [i - 15000] dataArray = Math.Sin (i*.01) * 8;
    }

    startTime = (double) DataConverter.Convert (dataWaveforms [0].) Timing.StartTime, typeof (double));

    dataWaveforms [1] = AnalogWaveform. FromArray1D (dataArray);
    Timing = WaveformTiming.CreateWithRegularInterval (TimeSpan.FromSeconds (.002), DateTime.Now, TimeSpan.FromSeconds (5000 *. 002));
    dataWaveforms [1]. Timing = calendar;
               
    waveformGraph1.PlotWaveforms(dataWaveforms, plotOptions);

    transitionAnnotation.XPosition = startTime + 5000 *. 002;
    transitionAnnotation.Visible = true;
    }
    }

    public class myFormatString: FormatString
    {
    public myFormatString()
    : base (FormatStringMode.DateTime, "SS tt")
    {
    }

    Public Overrides Function FormatDouble (double value)
    {
    If (value< form1.starttime="" +="" 5000="" *="">
    basic performance. FormatDouble (value);
    on the other
    basic performance. FormatDouble (value + 10000 *. 002);
    }
    }
    }

    If you have any questions about my code, or if it doesn't really match what you are looking for, let me know and I'll be happy to continue to watch it with you.

    NickB

    National Instruments

  • I want the complete addressing information to appear at the top of the original message I answer, not only the line ' on &lt; DateTime &gt;, &lt; sender &gt; wrote:

    I can't find the configuration option in Thunderbird to have the following information added on top emails to that I answer:

    From: sender original >

    Sent: < DateTime >

    Up to: < list of original recipients >

    Initially copied recipients CC: < list > (if applicable)

    Subject: < email-subject original >

    Priority: < priority of the original message > (if applicable)

    Sensitivity: < sensibility of the original message, i.e., private, confidential, etc. > (if applicable)

    This information appears on the email I forward, but on my answers that I always get is a line that reads:
    ' On < DateTime >, < sender > wrote:

    Can someone help me with this?

    Thank you!

    This module allows you to create custom response headers:

    https://freeshell.de//~kaosmos/changequote-en.html

    Tested and functional in 38 TB.

  • PDM: Add DateTime vs PrecisionDateTime property

    I'm back with another question about the API of PDM .NET.

    What do you expect when you add a property to a DateTime value to a PDM file, then add another property with the same value converted to a value of PrecisionDateTime? The two must be kept as i64 + u64 bits according to the Structure of the TDMS File Format.

    var someDate = new DateTime (635757120000000000L, DateTimeKind.Local);

    using (var file = new TdmsFile (@"C:\Temp\ts.tdms ', TdmsFileOptions() ')) new
    {
    file. AddProperty ("_ts0", TdmsPropertyDataType.DateTime, someDate);
    file. AddProperty ("_ts1", TdmsPropertyDataType.DateTime, PrecisionDateTime.FromDateTime (someDate));
    }

    In binary, the seconds total i64 are equal, but the part of fraction u64 to the first property is 0 x 0000800000000000.

    Then when I read the first property, I get a difference in DateTime 76 ticks which is equal to 7.6 µs.

    It's the 'precision' I get at the price of 128-bit?

    Beste regards,

    Jonas

    HI jonas,.

    Sorry it took awhile. We managed to do work and could reproduce the behavior. I forwarded your it.

    Thank you for the information system.

    Best,

    Anna

  • Incompatibility of DataCount double/DateTime PDM

    When writing data signal to a TDMS file I always find myself with a different values double number of (Y) compared to the timestamp of DateTime number (x).

    What is strange, is that DataCount for channel gives a correct result. However, when opening the file for reading, there is always a gap between the number of X and the values of Y, by channel.

    I already reported a bug about the AutoSave property and damage the data when you use TdmsWaveformLayout.PairedTimeAndSampleChannels and WaveformTiming.CreateWithIrregularInterval (). Workaround was to explicitly call Save() when editing the PDM file, for example creating groups/channels or write the sample data. It seemed to work pretty well, and I have not seen since corrupted data. However, I now feel a loss of data instead.

    Just to be safe, I connect the value reported by DataCount before and after each write operation. In this example 80 samples are written each time. It looks OK:

    2010-08-09 11:07:02.254 [9] DEBUG SE. Epiq.Acqis.Storage.TdmsStorage - P0 [mmHg] # before (double/date-time): 23920/23920
    2010-08-09 11:07:02.262 [9] DEBUG SE. Epiq.Acqis.Storage.TdmsStorage - P0 [mmHg] # after (double/date-time): 24000/24000
    2010-08-09 11:07:02.269 [9] DEBUG SE. Epiq.Acqis.Storage.TdmsStorage - P5 [mmHg] # before (double/date-time): 4400/4400
    2010-08-09 11:07:02.269 [9] DEBUG SE. Epiq.Acqis.Storage.TdmsStorage - P5 [mmHg] # after (double/date-time): 4480/4480

    But when I open the file and try to read the data I get an error saying "the number of stamps of time on synchronization channel... is not equal to the number of data samples.". DataCount confirms this, and there is always a multiple of the number of samples prepared at the same time lacking, for example 80/160/240 /... samples.

    If I use the TDMS Reader demo app and click a synchronization channel I sometimes (!) get a different error: "specified argument was out of range of valid values. Parameter name: wholeSeconds. ». I don't know if this error is related. The timestamps, I am writing to you are what returns DateTime.UtcNow. Not surprising at all.

    I have create/open the TDMS file like this:

    ... = new TdmsFile (filename, new TdmsFileOptions (TdmsFileFormat.Version20, TdmsFileAccess.ReadWrite, true, TdmsByteOrder.Native));

    When I finished to write data, I call Dispose() Save(), Close(), (in that order).
      
    Examples of data are written to the file using AppenAnalogWaveform().

    channel. Parent.AppendAnalogWaveform (channel, TdmsUtilities.CreateAnalogWaveform (e.Data, e.Signal));

    The CreateAnalogWaveform method returns aAnalogWaveform:

    Result AnalogWaveform = AnalogWaveform. FromArray1D(data.) Samples);
    result. Timing = WaveformTiming.CreateWithIrregularInterval (data. Timing);
    result. ChannelName = signal. Alias;
    result. UnitDescription = signal. UnitOfMeasurement;

    The PDM is saved after every call to AppenAnalogWaveform.

    What's really funny is that the docs for TdmsFile.Dispose () says:

    Call Dispose when you are finished using the TdmsFile. The Dispose method closes the PDM file and makes it unusable . This method does not save the file. Call Open to reopen the PDM file.

    So has really let the unusable file (sic!), it's great that you have documented it. ;-)

    Thanks for the code MiF-

    With your code, I was able to reproduce the bug you saw.  It seems to be closely internally with the previous bug you reported on autosave corrupt your data in special circumstances.  The fix for both problems is in the next version of Measurement Studio, but can also be obtained now by installing the runtime LabVIEW 2010.

    Again, please excuse me for the inconvenience that these bugs have caused you-

    NickB

    National Instruments

  • Possible bug in DateTime in the Toolbox of data base

    Hello!

    I do not have the database Toolbox, and it seems that you can not download a 64-bit evaluation...

    Bug?  I wrote to the DateTime fields to a database through the appropriate use of clusters and Inserts, but it seems that I never get from fractions of a second. Datetime controls show and the fields of database should help (at least it's montrer.000 at the end) so I wonder: does somehow use locale at the moment so this is my comma decimal point and landing so fractions?

    / Yamaeda


  • Create graphics using multi-channel for measures and another single channel for the datetime type.

    Hello world

    I'm using Labview and DIAdem to create graphical reports and I use screws of connectivity and not the Express VI.

    The data is stored in a data base MySQL Inno.

    I use the following command to get the data I want to show the graphic report!

    SQL_ExecDirect (' select 'TimeStamp', 'Value' by 'TableX' where and taste =' %s and channel =' %s; "" ")

    And then I use:

    SQL_BindChannel ("Datetime1C1", "TimeStamp", "t", "#yyyy - mm - dd hh") to bind the data to the X axis of the graph.

    And after that, I use:

    SQL_BindChannel("SampleN","Value","n") to bind the data to the axis of the graph Y.

    I want to create the chart with more than a sample, I use the commands above on a loop.

    Now here's a printscreen of my problem.

    In the first iteration (green line), DateTime1C1 has the timestamp for sample1 but in the second portion (yellow line) DateTime1C1 has the timestamp for sample2, the third iteration (blue line) DateTime1C1 timestamp for sample3. etc.

    The time stamp of origin for each sample are 'lost' he re-wrote datetime1C1. and in the end, it shows only the timestamp for the 5th iteraction.

    How can I create a single graph with several lines (samples) and datetime an axe?

    THX in advance

    Hi AlexandreHSCas,

    If I understand your situation, the only thing you need to change is to create a new group in the DataPortal before each request.

    FOR i = 1 TO iMax
    NewGroupName = "application" & I
    Call GroupCreate (NewGroupName)
    Call GroupDefaultSet (GroupCount)
    Call SQL_ExecDirect ("select 'TimeStamp', 'Value' from ' TableX" including Sample =' %s and channel =' %s;) ")
    Call SQL_BindChannel (NewGroupName & "/ Datetime1C1", "TimeStamp", "t", "#yyyy - mm - dd hh")
    Call SQL_BindChannel (NewGroupName & "/ SampleN", "Value", "n")
    NEXT

    Then you can simply drag each group from the data on the same graph XY-portal, because each group has its own time warp, data points will be displayed correctly placed on the common X axis of the graph.

    Brad Turpin

    Tiara Product Support Engineer
    National Instruments

  • string to datetime interesting problem

    Hello

    I am solve some problem with Labview and I find very interesting bug.

    It's just time conversation of string to the datetime format.

    In the image below, I did 24 times this conversation to show, the result for each hour of the day.

    Looks like labview have some problems with times of conversation in format 2:XX: XX (I mean, when the number 2 is the first).

    Someone has an idea how to fix this bug?

    The solution is:

    1 convert the variant to a string

    2 channel converted variant with format string %^<%d.%m.%Y % H: % m: %s > T, where ^ is important

    3. Use the Format Date/time String.vi with set to True UTC

  • 'System.DateTime' does not contain a definition for 'HasValue '.

    I develop a lightswitch application. But me make mistakes trying to build the application:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Microsoft.LightSwitch;
    namespace application
    {

    partial public class Section
    {
           
    SectionDisplay_Compute partial Sub (Ref DateTime result)
    {

    If ((this. Course! (= null) & (StartDate! = null) & (teacher! = null))
    {

    Assign the result to the value of the desired field

    result = String.Format ("{0} ({1}) [{2} - {3}]", Course.CourseName, Teacher.UserName, StartDate.ToShortDateString (), ((StopDate.HasValue)? ") StopDate.Value.ToShortDateString (): "'));

    }

    }
    }
    }
    This is the code. Get the following errors

    Error 1 'System.DateTime' does not contain a definition for 'HasValue' and no extension method 'HasValue' accepting a first argument of type 'System.DateTime' could be found (missing are you a using directive or an assembly reference?)
    Error 2 'System.DateTime' does not contain a definition of 'Value' and no extension method 'Value' accepting a first argument of type 'System.DateTime' could be found (missing are you a using directive or an assembly reference?)
    anyone help me please in this ASAP?

    Hello

    What operating system is installed on the computer?

    The question you posted would be better suited in the MSDN Forums. I would recommend posting your query in the MSDN Forums. You can follow the link to your question:

    http://social.msdn.Microsoft.com/forums/en-us/categories/

    Hope this information helps.

  • VI 'Variant to data' Converts the DateTime inaccurate.

    The extracted data is a timestamp column in a microsoft access 2007 database.

    As shown below, the said Variant ' 1: 46:45 '.

    But the timestamp converted from Variant 1 milliseconds before the Variant.

    It is now "1:46:44.999".

    He is shown below.

    How can I make the exact conversion?

    This is how I solved the problem of millisecond with microsoft access.

    Because the microsoft access database datetime type has an accuracy of up to one second.

    some records of datetime are converted accurately in LabVIEW timestamp, and other records of datetime are converted with 1 millisecond gap (it could be more or less) and LabVIEW timestamp.

    I didn't distinguish between those converted with precision and those wronged, because it could lead to errors.

    So I did as below.

    This is the first 6 columns of the Recordset.

    recorded_time is a column datetime of 'access '.

    Year (DateTime) returns the year as an integer of 4 digits, month (datetime) returns the month as a number between 01 ~ 12 and so forth.

    And I created a Subvi, which covers the first 6 columns of a recordset object and returns a timestamp.

    As you can see that the second fraction is equal to 0 signifie.000.

    Each datetime record has maintenant.000 at the end, and no trace of datetime is converted into LabVIEW timestamp incorrectly.

  • ROBOCOPY can move files created yesterday to the target files and keep the folder tree and datetime attributes

    I want to create a script to move the files created in the day before in a file archive (and subfolders) into a new target folder daily.  For example, whenever I run the below script 10/02/2015, I would move files created on 01/10/2015 and earlier source archives files to the destination folders, with the same folder structure and datetime preserved.  This is my 1st ROBOCOPY command in the script.

    % VarSourceArchives % varTargetArchivesFolder % Robocopy / MIR / COPYALL / DCOPY:T / MOV / MINING: 1

    However, it doesn't move the files of more than 24 hours from when I run the script, rather than all the files created yesterday. Technically, he did what has been said, but not exactly I want.  It seems if you use /COPYALL switch, the switch / MINING: N compare file date & time stamp as file age exclusion, rather than just the number of exclusion of age days.

    How can I achieve my goal to move files from a specified number of days while preserving the postmark date & time of folders and files?  Are there different ROBOCOPY switches to set, or if it is complex date and the calculation of leap year?

    Thank you

    Michael J.

    Robocopy is a bit lacking in this regard. You can use the hybrid batch file below to reach your goal. Sets the attribute archive every file that was modified yesterday and it resets any other file attribute so that robocopy will only move the files of yesterday.

    off @echo
    Set Source = folder Temp D:\My
    the target folder = target value M:\My

    Set Scr="%temp%\TempVBS.vbs".
    (echo sPath = 'Source %'
    echo Set OFSO = CreateObject("Scripting.Filesystemobject"^)
    echo sYesterday = FormatDateTime (DateAdd ("d", Now (^),-1 ^), 2 ^)
    echo process feldspar
    echo Process(sP^) Sub
    ECHO for each represented in oFSO.GetFolder(sp^). Files
    FormatDateTime(oFile.DateLastModified,2^) if echo = _ sYesterday
    the echo then oFile.Attributes = 32 _
    echo oFile.Attributes = 0 Else
    Following the echo
    ECHO for each older in oFSO.GetFolder(sP^). Subfolders
    echo process oFolder.Path
    Following the echo
    echo End Sub) > Scr %
    cscript //nologo % VCC
    del % VCC
    Robocopy /a /s /mov 'Source %' 'target percent '.

  • JAX - RPC, Webservice and the dateTime type elusive everything

    I need to interface with a web service. I have no control over it, so I can't change the WSDL, the server, or something similar.

    One of the types of data used is xsd: DateTime, a guy who according to it (table 1, JAX - RPC support for data types), is not supported on J2ME. Of my research (on this forum and on the Internet), person doesn't use any date/time/dateTime any form or is ordered to change their WSDL so it it does not use if they intend to use a client on J2ME.

    If anyone has a clue on how to use it, because I said, I have no control over the server or the WSDL. Would be his replacement formatted by a string in the work in an appropriate manner or the JAX - RPC system would say it's the wrong type?

    I used wscompile to get static stubs for the service, I can't compile without figure this (Type has only primitive types, 'UNKNOWN' what wscompile replaces the unsupported types is not cutting it for obvious reasons). Temporarily, I've replaced 'UNKNOWN' with Type.STRING but I don't know if it will work (that's why I asked).

    OK, the base64Binary Type I used was Type.STRING. Then I just ran through the Base64InputStream.decode that does the job. I realized that two types do not work (wscompile is good for a general idea of how a web service must be implemented but horrible to the actual implementation) so I need to rewrite much of the code and decided to rewrite it so that it works better and is more clean.

    Thanks for the help.

    EDIT:

    It was also the help function, I used to convert a string to a timetable so that it works with the web service:

    public static String toSOAPString(Calendar cal)
    {
        if(cal == null)
        {
            return null;
        }
        StringBuffer buf = new StringBuffer();
    
        //Get format
        new SimpleDateFormat("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'SSS").format(cal, buf, null);
        buf.append("0000");
    
        //Timezone
        String zoneID = cal.getTimeZone().getID();
        int index = zoneID.indexOf('-');
        if(index == -1)
        {
            index = zoneID.indexOf('+');
            /* If no timezone offset exists, it isn't needed
            if(index == -1)
            {
                buf.append("+00:00");
            }
            */
        }
        if(index != -1)
        {
            buf.append(zoneID.substring(index + 1));
        }
        return buf.toString();
    }
    

Maybe you are looking for