ISO8601 date standard in LabWINDOWS CVI 2012

My problem:
function FormatDateTimeString returns different calendar week than ISO8601 standard (one week less for 2013)
Questions:
1. what standard do CVI's time related functions from User Interface Library follow?
2. can this standard be changed to ISO8601 through a function call/setting?
3. is there another solution instead of writing a ISO8601 week number conversion function?
Example:
#define DATETIME_FORMATSTRING "%m-%d-%Y cw%W %H:%M"
//get current date-time-day dateTimeBuffer example "10-19-2010 cw42 19:56"
GetCurrentDateTime (&currDateTime);
bufferLen = FormatDateTimeString (currDateTime, DATETIME_FORMATSTRING, NULL, 0);
dateTimeBuffer = malloc (bufferLen + 1);
FormatDateTimeString (currDateTime, DATETIME_FORMATSTRING, dateTimeBuffer, bufferLen + 1 );
//will return calendar week 04 in dateTimeBuffer for 29.01.2013, but actually it's calendar week 05 in Europe

Hello Ioachim,
I don't know which standard are using CVI date functions, but having already noted that difference I have published here a function to calculate week according to that standard. Feel free to examine it and reuse in your programs.
Proud to use LW/CVI from 3.1 on.
My contributions to the Developer Zone Community
If I have helped you, why not giving me a kudos?

Similar Messages

  • Recherche et connexion à un périphérique Bluetooth via LabWindows CVI?

    Bonjour
    Je cherche à savoir si il est possible d'effectuer une recherche de périphérique sous Labwindows CVI et de m'y connecter.
    Le périphérique en question est un appareil de mesure dont je connais le protocol de communication.
    Ce périphérique est considéré comme étant un port COM RS232 virtuel. Je communiquerait donc avec mon produit en utilisant les driver VISA.
    Une telle solution est elle possible sous LabWindows CVI?
    Si oui auriez vous des exemple?
    Je possède LabWindows CVI 2012
    Merci d'avance...

    Sorry I thought I was on the french forum. 
    Is there an other solution than the NI-VISA drivers to execute a Bluetooth communication on LabWindows?

  • Retour paramètre string par Labwindows/CVI pour Teststand

    Bonjour à tous,
    j'utilise Teststand 2012 Development System et Labwindows/CVI 2012 Development System sous Windows 7 professionnel.
    Le contexte : grâce à une DLL crée avec Labwindows/CVI j'appel la fonction "Traitement" par TS.
    Le prototype de la fonction est le suivant void __declspec(dllexport) Traitement (char message[256], car reponse[256]);
    Je passe en paramètre deux strings à cette fonction. Cette fonction reçoit un "message", effectue un traitement sur celui-ci et le renvois sous le tableau "reponse" à TS. Cette fonction a été testée et fonctionne sous CVI.
    Mon problème : J'ai vérifié ma fonction reçoit bien le message mais me retourne quelque chose d'erroné( cf. image) et n'est censé me retourner, dans"reponse", que les chiffres au début mais me rajoute des instructions en temps que string. Je ne comprend pas comment cette suite d'instruction ce rajoute et pourquoi?
    J'ai consulté tous les messages disponibles sur le forum et je n'ai pas réussi à trouver un problème équivalent et donc une solution.
    J'espère que vous aurez une idée, voir pourquoi pas une solution
    Dans l'attente d'une réponse,
    Cordialement,
    Erwan.
    Résolu !
    Accéder à la solution.
    Pièces jointes :
    message.png ‏74 KB

    Bonjour Akagi,
    Dans une chaîne de caractère, "Null" ou "\0", correspond effectivement à une fin de chaîne.
    Pour éviter ce comportement, vous pouvez changer le type de passage de paramètre dans TS en tableau de Numérique.
    Ce faisant, aucun traitement ne sera fait sur le caractère "NULL". pour rappel un char = 1 Octet, on peut donc utiliser un tableau de numérique U8 pour représenter une chaîne de caractère.
    En résumé, si votre chaîne de caractère = 3"Null"01, vous obtiendrez ainsi: tab[0] = 3, tab[1] = 0, tab[2]=1.
    Je suis désolé, mais j'ai du mal à saisir où est intégré le caractère "NULL" dans CVI, est-ce une entrée clavier saisie par l'utilisateur, autre?
    Est-il possible d'utiliser un autre caractère ou série de caractère(non spécial) permettant d'identifier cette transition/caractère spécial "Null"?
    EX: (\) = "Null", soit la chaîne 3(\)01 équivalent à 3"Null"01. Il suffit ensuite d'établir un algorithme permettant de changer (\) en "NULL".
    Cordialement,
    Rémi D.
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    >> Les rencontres techniques de NI - Mesures et acquisition de données : de la théorie à la mise en ...

  • Q: Must one use special LabVIEW types (e.g. float64) for DLLs in LabWINDOWS/CVI?

    Hello,
    I have recently started compiling C code using LabWindows/CVI, and have successfully called a simple DLL function from within LabVIEW.
    I have a question about the types defined in LabVIEW's extcode.h file:
    These are defined to explicitly quantify the number of bits used for each data type (e.g. float64 instead of float) in order to eliminate ambiguity across compilers.
    When I am using LabWindows/CVI to compile, do I need to use the LabView numeric types defined in LabView's extcode.h, or can I use the standard C types (int, float, etc.)?
    Is there a distinction between having to use these special types for CIN versus shared library calls in LabVIEW?
    Thanks
    in advance,
    Frenk

    You do not have to use the defines in extcode.h, but you certainly can if you want to.
    The float64 is equivalent to CVI's "double", and the float32 is equivalent to CVI's "float".
    These correspond to the double- and single-precision types in the IEEE Standard for Floating Point Arithmetic, IEEE-754.
    I hope this helps.
    Brian

  • Using Labwindows CVI Version 10.0.1 USB communication with FTDI FT2232D to unit under test.

    Communication with unit under test works fine in hypterminal after I downloaded virtual driver from FTDI site.
    Never done any USB communication before in LabWindows CVI. What functions can I use in labwindows CVI?

    Since the device presents itself as a COM port (pretty standard with the FTDI chips) you should be able to use the RS-232 library in CVI.  OpenComConfig() will open a connection to the device, ComWrt() will write data to it, and the various ComRd() functions can be used to read the responses back.

  • How to use CAN256 and CAN257 in Labwindows CVI?

    I am trying to learn about CAN programming in LabWindows CVI. None of the samples do anything other than generate cryptic error messages. I do not have a card or interface device yet, but reading in the help files I found this:
    "NI-CAN provides a virtual CAN card with two interfaces, CAN256 and CAN257. The two virtual interfaces are connected by a virtual bus. When you write CAN frames to one virtual interface, those frames are received by the other virtual interface, and can be read as channels. This feature allows you to read and write CAN data in the same manner as two real CAN interfaces connected by a real CAN cable. The conversion does not require real NI CAN hardware, and your application is not required to check for specific CAN IDs."
    I modified the Waveform ouput project and add CAN256 to the dropdown in the uir file. However when I run it, I get the same error message as always, error -1074388725.
    Is there an example CVI code someplace to demonstrate the use of these virtual channels?

    Thanks Drew.
    Ultimately, my customer provided me with a WriteCAN256.vi and ReadCAN257.vi that were perfect for my needs. The WriteCAN256.vi along with my NI USB 8473s allowed me to provide data collection on multiple CAN devices and to verify that my Software can handle all data types from CAN devices.
    Note: My customer allowed me to share his .vi's. They are enclosed ...
    Best Regards,
    Don W
    Attachments:
    CanBus Read (Frames)_85.vi ‏55 KB
    CanBus Write (Frames)_85.vi ‏48 KB

  • How to set a DMA transfer type for PXIe-6536 in LabWindows/CVI?

    I have a PXI chassis PXIe-1078 with a controller PXIe-8115 running under Windows 7. The digital output board is PXIe-6536.
    I use a function DAQmxSetChanAttribute to set a property DAQmx_DO_DataXferMech to a value DAQmx_Val_DMA, since I want to use a direct memory access data transfer. This wokred well with a PCI-6534 board using the same LabWindows/CVI code before migrating it to the PXIe system.
    Unfortunately, running this code on the PXIe system reports a DAQmx error -200452: "Specified property is not supported by the device or is not applicable to the task".
    The task is created in the following simple way (the board name in MAX is 'Dev1'):
       DAQmxCreateTask ("digTask", &digitalTask);
       DAQmxCreateDOChan (digitalTask, "Dev1/port0:3", "DIG_CHANNELS", DAQmx_Val_ChanForAllLines);
       DAQmxSetChanAttribute (digitalTask, "", DAQmx_DO_DataXferMech, DAQmx_Val_DMA, 15);
    How can I solve this problem? How is it possible to choose between different transfer types?
    Thank you in advance for any hint!

    Hi CavityQED,
    The PCI-6534 is a "Digital I/O" board while the PXIe-6536 is a "High Speed Digital I/O" board, that's why they don't have the same properties.
    By the way you can use DMA transfer with this method :
    http://zone.ni.com/reference/en-XX/help/370520J-01/hsdio/direct_dma/
    Let me know if it helps you.
    Regards.
    Mathieu_T
    Certified LabVIEW Developer
    Certified TestStand Developer
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    LabVIEW Tour
    Journées Techniques dans 10 villes en France, du 4 au 20 novembre 2014

  • How to get bar graph in word in labwindow/CVI ?

    how to get bar graph in word in labwindow/CVI ?

    ashwinic9,
    spawning your question over more and more threads (the present one, this one and this other one) won't give you a faster answer; instead, it will irritate forum users! 
    Especially if you have at your disposal a fast way to perform a test. I pointed you some days ago to word report example, that writes a table to a word document: did you tried changing the graph into a bar graph and generating the report? I have done it for you and the result is OK, as you can see in the attached document.
    Now, since the example works well, there must be something in your particular situation that prevents the graph to be shown; that is: you must add some more data on your actual problem and maybe a small example that exposes the problem.
    But please: keep active only this discussion and let the other threads die! 
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?
    Attachments:
    wordreport.doc ‏38 KB

  • Using the SVDEx function in LabWindows​CVI

    Hello,
    I am writing an application in LabWindows CVI to display and analize data that we obtain in an optical experiment.  The data is a matrix where the subsequent rows represent spectra collected a different times. There are about 200 columns and 100 rows in each matrix. I want to use singular value decomposition using the  SVDEx function. I get an error every time i try to execute the code in debugguing mode:
    FATAL RUN-TIME ERROR:    The program has caused a 'General Protection' fault at 0x0342BC16.
    I believe that I am passing the incorrect arrays to SVDEx. I  was wondering if there is any example code available, so I can learn how tro do do this.
    Here is a fragment of the code where I call the function SVDEx:
    //declare the arrays to hold S U V
    double *U,*S,*V;
    int isizeS=Y_DATA_POINTS;
    int i;
    int AnalisisError=0;
    if (X_DATA_POINTS<Y_DATA_POINTS) {isizeS=X_DATA_POINTS;}
    //Allocate arrays
    U=malloc(Y_DATA_POINTS*X_DATA_POINTS*sizeof(double​));
    S=malloc(2*isizeS*sizeof(double));
    V=malloc(Y_DATA_POINTS*X_DATA_POINTS*sizeof(double​));
    AnalisisError = SVDEx (adAbsMap, Y_DATA_POINTS, X_DATA_POINTS, FULL_SIZE, U, S+isizeS, V);
    FATAL RUN-TIME ERROR:   "Visualize_12.c", line 2451, col 17, thread id 0x00000E18:   The program has caused a 'General Protection' fault at 0x0342BC16.
    Any help will be very much appreciated.
    J. Hodak

    Hi,
    Thanks for trying to find an answer. I just realized now where the probem was. My mistake was when i allocated the arrays for holding the matrices. Because i was assking SVDEx to carry out FUL SIZE decomposition I must declare the arrays U and V to be , Y_DATA_POINTS*, Y_DATA_POINTS doubles and X_DATA_POINTS*, X_DATA_POINTS doubles respectively. My code was wrong, I was declaring the sizes to be smaller than necessary and  "Visualize_12.c", line 2451, was the call to SVDEx, and col 17 was pointing t that mistake. It took me a while to realize this because the error message did not exlicitly specify that the size or the array passed was too small. Now it is working well. But I believe that it will help to have an example to get started with this.
    Thanks again,
    Fundadero.

  • Using Matlab in Labwindows/CVI

    I have a matlab .m file that runs a function. In my Labwindows software, I want to be able to run this function. Is this possible? Thanks.

    Hi Kamkon,
    Have you had a chance to look into the example posted by Anna? I've come across discussion forums regarding how to use MATLAB dlls in LabWindows CVI. They are listed below. I hope this is of some help to you.
    http://forums.ni.com/t5/LabWindows-CVI/How-to-use-a-Matlab-DLL-in-CVI/m-p/548105?requireLogin=False
    http://forums.ni.com/t5/LabWindows-CVI/Linking-Matlab-generated-lib-files/m-p/283814?requireLogin=Fa...
    Creating a MATLAB dll is somewhat outside the scope of our suppot. However, I have found a third party link on this topic. Hopefully, it will point you in the right direction.
    http://www.mathworks.com/support/solutions/en/data/1-18CBI/index.html?solution=1-18CBI
    Regards.
    Josh L.
    Applications Engineer
    National Instruments

  • Example LabWindows/CVI code for NI4351

    Hi,
    I'm using an NI4351 PCI DAQ card with the Ni435x
    driver and LabWindows/CVI v5.5 (on Windows 98) to measure temperature
    and voltage levels. Are there any simple tested code examples that I
    could download, which use the NI435x driver function
    NI435X_Check_and_Read(), called from an asynchronous timer for
    continous scan? There are no problems when I use MAX (so hardware
    problem is ruled out), but my code yields
    occasional random temperature reading errors (looks like data
    corruption to me). The NI435x_ functions return no errors. Can I use
    lower level C driver functions instead of NI435X_Check(), NI435X_Read(), or NI435X_Check_and_Read()?
    What does MAX use behind the scene? Of course, the MAX setup only scans
    the one channel, so maybe this is why it works correctly. I have to
    scan one temperature channel and six voltage channels though.
    Many thanks,
    John.

    Humphreyy,
    thanks for the tip. I tried it but it did not work, the same errors were present. Are there any other suggestions. I have racked my brain to figure out why this is happening and have come up with nothing. I am also getting a "Warning" message concerning the "KsMedia.h" file that says "Warning: Excess characters in multibyte character literal ignored." The warnings trace back to the "typedef enum" section of that file. Could that be causing a ripple effect that produces the error I am seeing in the other header files I mentioned??
    I could really use your help and any more help that is available. I really don't want to use Visual C++, because this software is going to get more sophisticated and is to be used in NASA Langley's VISTAS simulator, an environment taylor made for National Instruments software.

  • SCPI Instrument driver for LabWindows​/CVI ?

    Is there somthing like a plain SCPI instrument driver for LabWindows/CVI
    that works with all SCPI-DMMs ?
    Thanks,
    Manfred

    Manfred Schininger wrote:
    > "Kevin B. Kent" schrieb im Newsbeitrag
    > news:[email protected]..
    > > Manfred Schininger wrote:
    > >
    > > > Is there somthing like a plain SCPI instrument driver for LabWindows/CVI
    > > > that works with all SCPI-DMMs ?
    > > >
    > > > Thanks,
    > > > Manfred
    > >
    > > SCPI like any other standard is typically non-standard.
    > > You can try to get a DMM driver and it will probably work
    > > for the most part with any DMM. There may be some
    > > slight differences and some features may not work on all DMMs.
    > >
    > > I might suggest you look into IVI drivers. These follow SCPI for the most
    > > part. You get the drivers for each DMM you want and then you have a
    > > configuration
    file that tells the program which DMM you are using.
    > > It then loads the appropriate driver.
    > >
    > > Kevin Kent
    >
    > Hello Kevin,
    >
    > thank you for your answer.
    > Unfortunately there is no specific instrument-driver for the DMM I'd like to
    > use (Keithley 2700). As I understand this would be the precondition for the
    > IVI base classes to work. My hope was to find a simple SCPI instrument
    > driver to get into the advantage of instrument independence. But you are
    > right, I also once made the experiance that the "SCPI standard" isn't
    > completely perfect.
    >
    > Manfred
    Manfred,
    You could look for a driver for another Keithly model or try one for a
    different brand. They may be similar enough to modify easily. I realize this
    goes against the idea of SCPI and standards but it is the best we have now.
    Good Luck
    Kevin

  • Are there any exams for LabWindows​/CVI for my assessment​?

    Hi
    I'm new in CVI
    I'm still studying its features
    Can anyone give me a link where I can learn more about CVI, a tutorial perhaps.
    I'm really interested about data manipulation and databases.
    What database can I use with CVI?
    And
    Are there any exams I can take for the assessment of my knowledge about CVI?

    Hi Kylie may,
    On our website there are many helps for you to learn LabWindows/CVI.
    1) Here is a link to the Getting Started manual
    2) Additional Resources
    3) Top 10 LabWindows/CVI Technical Resources
    4) If you are interested in Database connectivity please take a look at the following link to the SQL Tool kit
    5) As far as Exams that you can take here is a link to the information: NI Certified LabWindows™/CVI Developer (CCVID)
    I hope that this helps.
    Regards,
    Perry S.
    Applications Engineer
    National Instruments

  • Dynamic memory is corrupt (Labwindows/cvi 2010)

    I have a multi threaded application....where I have a buffers allocated ineternally in the threads,,...A user interface is present to abort the therad execution.
    Here is the code in one of the threads (NOTE: status is set by a user button to EXIT the program):
    int EthernetDataStructureThread (void *functionData)
        CmtSetCurrentThreadPriority (2);
        EthernetData GetData={0}, *data=NULL;
        data = &GetData;
        /* Use a buffer to read the data from the queue which is coming from TCP read with fresh data */
        const void *BufferEth;
        int BytesRead=0;
        int BytesWritten=0;
        char ReadErrorMessage[256];
        BOOL bitset = FALSE;
        if ( (BufferEth = (EthernetData*)malloc(EthernetDataSize)) != NULL)
            while ( !status )
                BytesRead = CmtReadTSQData (Queue_TCPRead_EthernetData, BufferEth, EthernetDataSize, TSQ_INFINITE_TIMEOUT, 0);
                memcpy (data, BufferEth, EthernetDataSize);
                /* Empty the queue so that we don't have data in next time. */
                CmtFlushTSQ (Queue_TCPRead_EthernetData, TSQ_FLUSH_ALL, NULL);
                //Pass on the data to the Main thread
                BytesWritten = CmtWriteTSQData (Queue_EthernetData_Main, BufferEth , EthernetDataSize, 1, NULL);
                if ( BytesWritten != EthernetDataSize)
                     free(BufferEth);
                    BufferEth = NULL;
                    exit(0);
                Delay(0.02);
            if (status && !bitset)
                free(BufferEth);
                BufferEth = NULL;
                bitset = TRUE;
        return 0;
    My problem is: free(BuffEth) always says Dynamic Memory is corrupt......When I put a breakpoint and keep seeing the resource tracking window, I can see it getting executed fine as the resource tracking window greys out the memory block....but then suddenly free wants to exceute again...and causes the "dynamic memory is corrupt" error.
    I am using LABWINDOWS /CVI 2010 SP1 in WinXP.
    Please help me ASAP....very much appreciated.
    Regards
    NITIN
    -Nharish

    Thank you for your reply Jackie.
    I am calling Free only once...there is an If condition there.
    See the attched video for my problem...Free frees the memory block (see the greyed out portion in resource tracking window but still the statement controls remains there and free executes again, throwing error).
    Do you  think it is some sort of bug in LABWINDOWS.
    See the attached video.
    -Nharish
    Attachments:
    FreeproblemLabwindows.avi ‏4781 KB

  • Permission Denied Error when calling Matlab script from LabWindows​/CVI

    Hello,
    I am reading in data from a DAQ and am writing it to a .csv file in LabWindows/CVI.  I am then sending this data to Matlab to be filtered.  I would like the filtered data to be accessed by LabWindows/CVI so that I can display it as a strip chart.  I have gotten everything to work except the writing to a file in a Matlab script that is called from LabWindows/CVI.  I am basically using the shipped example in found in the activex demo. (http://zone.ni.com/devzone/cda/epd/p/id/2994). I select the script that I want to run and each time it tries to open a file with write permissions I get a "Permission Denied" error.  This occurs when using fopen() in Matlab.  I have also tried using csvwrite() as well as dlmwrite().  Each one gives me a similar error.  The script currently does not try to do any data processing.  It just opens the file, if it is successful it then prints "hello" and then closes it.  The script works well when it is run in Matlab, just not when it is called in LabWindows/CVI.  Below is the script.  Any thoughts, comments or suggestions are greatly appreciated.  I am also open to using other approaches for sending data between Matlab and LabWindows/CVI.  Thanks in advance!!
    fclose('all');
    [file, errmsg] = fopen('out.txt', 'w');
    if(file<0)
        disp(errmsg)
    else
        fprintf(file, 'hello');
        fclose('all');
    end;
    [file, errmsg] = fopen('out.txt', 'w');
    if(file<0)    
    disp(errmsg)
    else  
     fprintf(file, 'hello');    
    fclose('all');
    end;

    I am using Windows 7.  I am running CVI as an administrator and was able to get rid of the "Permission Denied" error by going into the User Account Controls in windows and changing it to "Never Notify".  However, this did not fix the problem of Matlab not being able to write to a file when the script is run from CVI.  In the Matlab code below, It now gets in to the "else", suggesting that fopen() returns a good file handle.  After getting in to the else statement, it will not actually write to the file, nor does it create it.  However, I can make changes to the plot settings and those appear.  Everything is functional when run from Matlab but when run from CVI, things get screwy with opening the file for writing.  It handles the read well.  It seems like there would have to be some file permission errors but, in the CVI program, I open and write to the file "in.csv".  Any help is greatly appreciated.
    clear;
    fclose('all');
    t = zeros(1000);
    t = csvread('in.csv');
    for i=1:1000
        t(i) = t(i)*4;
    end;
    [file, errmsg] = fopen('out.txt', 'w');
    if(file<0)
        disp(errmsg)
    else
        fprintf(file, 'goodbye');
        for i=1:1000
            %t(i) = t(i)*3;
            fprintf(file, '%f,', t(i));
        end;
        fclose(file);
        plot(t/3, t);
        ylabel('t');
        xlabel('Time (s)');
        title('Is this really working?!?');
    end;
    Thanks,
    Chris

Maybe you are looking for

  • I've got a 7 year old 30gb video ipod and the headphone port no longer works! Please help :)

    I've got a 7 year old 30gb video ipod and the headphone port no longer works. I went to the Apple shop and they said it is now vintage and they can't fix my baby they offered me 10% to trade her in for a new model... what else can I try to save her? 

  • Linked to Oracle Server.

    I am working on a project that requires me to link SQL Server 2008 R2 to Oracle 11g. I have installed the Oracle client on the SQL Server and made several test connections. I am able to list data from Oracle in the SQL Server Manger. I want to make s

  • Merging pdf and livecycle form pdfs

    I would like to merge a regular pdf created from word with a livecycle create form.  Acrobat will not permit this.  The livecycle form is a static pdf form with not complex functions.  Can this be done? Thanks Jacque

  • Weblogic server not initiating the process after getting an error in reports

    hi guys, i am sai sandeep, i am using weblogic server for running oracle forms and reports in oracle11g, actually my problem with running reports , if any report is failed, then complete reports are going to fail ,not only in the current user but als

  • Doubt in Configuring the Integration Engine

    Hi, We maintained the Integration server URL in SLD in the Business System part which points to ABAP stack... But in SXMB_ADM we didnt configured the IS, we just have the parameter of IE as HUB. thats it. Do we need to Configure the IS also in the SX