Equivalent of visual Basic static variable in LabVIEW

Hi all!
I am doing a project where I am counting the values. After i Close/Stop the program I want the value to be intact and continue with the last value.
I know this in Visual Basic. By using the Static variable we can retain the value even we close the program.
Kindly help..
Srikanth Chilivery,
Solved!
Go to Solution.

I have trouble believing that a static variable retains its value after the program is terminated.  Once the program is released from memory, that static variable is gone.  If you want to retain a value between closing and opening an application, you have to save it to disk in some way.
Are you working exclusively in the LabVIEW IDE or are you running EXEs?  It sounds like you probably just want to use a Functional Global Variable/Action Engine.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines

Similar Messages

  • How to call visual basic exe file from LABVIEW 7.1

    Hi all,
    I would like to call a visual basic 6.0 application(executable file) from labview 7.1 kindly anyone is having code or papers send me.
    Thanks and Regards
    rajesh

    Hi all,
    i would like to run a visual basic programme from labview , i have attached my file , even though iam executing the programme iam not able execute the vb file , kindly suggest me ,
    Regards
    rajesh
    Attachments:
    active x.vi ‏18 KB

  • Using a Visual Basic ActiveX DLL in LabVIEW

    I' like to use some code written in Visual Basic into LabVIEW. I think the best way to do this is making a dll_activeX. I've seen an example on NI site: http://sine.ni.com/apps/we/niepd_web_display.DISPLAY_EPD4?p_guid=B123AE0CB992111EE034080020E74861&p_node=DZ52048&p_submitted=N&p_rank=&p_answer=&p_source=External.
    When I use the dll present in the "zipped" file it works (I've registered the dll as described in the article).
    If I compile in a DllActiveX the Visual Basic project (Visual Basic 6.0), present in the zipped file, and I try to use, after the unregistrtion of the old one and the registration of new one, it doesen't work.
    I received the following error:
    error 3005Occurred at automation open: Object specified is
    not creatable in a ActiveX Dll with LabVIEW.vi
    Some ideas?
    Thank you.

    Paolo,
    I am not sure why you are getting the error. I downloaded the zip file re-built the dll and then registered it. I originally had LabVIEW open, so I closed and re-opened it so that it would see the new object. I then pointed the ActiveX refnum to the Project1 class. I still had a few broken wires so I hit ctrl-shift-Run Arrow to force a recompile.
    After all that I ran the VI at it worked great. Once that was done I unregistered it and ran the VI. I got an error as expected. I then re-registered the dll and ran it again. No error.

  • What is the Java equivalent of Visual BAsic ASC() and MID() functions

    Hello all! I just would like to ask if you have any idea on how to convert the VB ASC() and MID() functions into java. Where:
    1. ASC( ) Function - Returns the ANSI value for the leftmost character in a character expression.
    2. MID() Function - The Mid method extracts a substring of length nCount characters from a CHString string, starting at position nFirst (zero-based). The method returns a copy of the extracted substring.
    I would really appreciate your help. Thanx!

    ah yeah! sorry typo error. see, I am converting a VB method that encrypts password:
    Function EncryptText(ByVal stDecryptedText As String)
    Dim stText As String, lngCounter As Long
    Dim iTemp As Integer, lngNumber As Long
    lngCounter = 1
    lngNumber = 8
    Do Until lngCounter = Len(stDecryptedText) + 1
    iTemp = Asc(Mid(stDecryptedText, lngCounter, 1))
    If lngCounter Mod 2 = 0 Then
    iTemp = iTemp - lngNumber
    Else
    iTemp = iTemp + lngNumber
    End If
    iTemp = iTemp Xor (10 - lngNumber)
    stText = stText & Chr$(iTemp)
    lngCounter = lngCounter + 1
    Loop
    EncryptText = stText
    End Function
    I converted this function into this:
    public static String encryptPass(String password) {
    String encpwd = "";
    int iTemp = 0;
    final int lngNumber = 8;
    String stText = "";
    for ( int i = 0; i < password.length() ; i++ ) {
         iTemp = Character.getNumericValue(password.charAt(i));
         if ( i % 2 == 0 ) {
         iTemp = iTemp - lngNumber;
         } else {
         iTemp = iTemp + lngNumber;
         iTemp = iTemp ^ (10 - lngNumber);
         char c = Character.forDigit(iTemp,Character.MAX_RADIX);
         encpwd = encpwd + String.valueOf(c);
         return encpwd;
    But I'm having trouble with the encryption because it returns a different set of characters. Did I convert it right? thanx.

  • ActiveX privileges different in Labview than Visual Basic

    Trying to make some ActiveX calls to a 3rd party app with LV 7.1.  I am able to access many methods and properties, but one of the methods I call gives me a "insufficient user privileges" error from the app.  Realizing y'all know nothing about what causes that error in the app, my question really is "If I write the exact same set of calls in Visual Basic, I don't get the error, why not?"  What does LV do differently at that level?  I have looked at the Dcom configuration manager and have set security to none on all apps, but again, since VB has no problem, it is unlikely that it would help, and sure enough, it did not.  You may say, "ask the developers ", but none of then know how LV implements it's ActiveX so they say it is Labview's fault and of course NI will say it's an incomplete implementation of ActiveX.  Any ideas?
    thanks

    Hi ET,
    The behavior of your LabVIEW application is quite interesting since any
    true copy of the ActiveX script from another programming language into
    LabVIEW has always given the same results as with the text based
    program. However, one thing that could be the difference it the
    conversion of data types, especially when the Variant data type is
    involved. To further troubleshoot what is going on, please submit a
    simple example that shows the issue. I would prefer if you could submit
    the Visual Basic code and the equivalent LabVIEW VI, thanks.
    - Philip Courtois, Thinkbot Solutions

  • DateAdd(interval,number,date) Visual Basic to LabVIEW Time Stamp add 18 months

    Hi all,
    I need to match Visual Basic Cmd  =  DateAdd("m", 18, Date()) which adds 18 months to today's date.  When I use LabVIEW Time Stamp VI's at first I tried adding 1.5 years in seconds. but this did not match the VB generated method?  What method do  I use in LV to obtain the VB DateAdd("m", 18, Date())
    Example 'Add one month to January 31, 2000
    document.write(DateAdd("m",1,"31-Jan-00"))
    Output:
    2/29/2000

    Well this is how you do it. However, it doesn't seem to work with the month. There was a thread about this problem not too long ago. If you overflow the month in the date/time rec cluster (so it is greater than 12), date/time to seconds returns 0. Every other element works fine. You can add 1000 to the day and it will figure it out just fine. When this bug is fixed, this will work. Also, it might only be a bug in recent versions. I'm on 8.5 and it doesn't work right.
    I realize this isn't a great answer to your question, but as far as I know, this is the easiest way to do what you want and have LabVIEW handle all the work.
    Message Edited by Marc A on 10-03-2007 03:56 PM
    Attachments:
    Example_BD.png ‏2 KB

  • Creating a DLL in Labview 8.6 and calling it from Visual Basic 6.0

    Dear friends,
    I need to create a DLL in Labview 8.6 and call it from Visual Basic 6.0. The system works as follows:
    I made an application using Labview 8.6 + Vision Assistant 8.6 where I can obtain the x,y coordinates of a template in an certain image being captured by an USB camera. The template coordinates change every time it moves and Visual Basic 6.0 must read these x,y values in real time. I found some information in the link http://zone.ni.com/devzone/cda/tut/p/id/3925, but it works for version 6.x of Labview and 8.6 version is different. Am I in the right path? If you have an updated tutorial like the one in the link above but for Labview 8.6 It would be very nice. Please help me.
    Kind regards.
    João Júnior

    Hello Osvaldo,
    I analysed the updated tutorial you sent me, but the thing is that it doen't show how to create the DLL in LV 8.6 but only show how to accessing the DLL from VB6. My problem is really HOW TO CREATE THE DLL IN LV8.6. In the link http://zone.ni.com/devzone/cda/tut/p/id/3063 there is detailed information about how to do this in LV6.x, the problem is that I don't find the path Tools»Build Application or Shared Library (DLL) in LV8.6, I think the procedure in LV8.6 is a little bit different. Don´t you have an updated tutorial on how to build a dll in LV8.6?How could you help me?
    Kind regards.
    João Júnior

  • LabView TEDS library into DLL or ActiveX Control so that I can use it in C or Visual Basic?

    We are developing software in LabWindows/CVI and Microsoft C. I heard that LabView can generate DLLs. Can I turn LabView TEDS library into DLL or ActiveX Control so that I can use it in C or Visual Basic development environment?

    Technically what you are proposing is possible with LabVIEW. With LabVIEW's application builder, VIs can be built into dlls. Also, LV has ActiveX hooks and so you could create a system for calling into it from CVI. However, this is not what I would recommend.
    The LabVIEW VIs have been written to a preliminary version of the IEEE specification (1451.4) that describes the TEDS data which is primarily why I'm advising you against using them. Once the IEEE spec is approved (the current timeline is currently late March), it will become public and you can write your own code according to the specification (or wait for someone else to write it). To help you get started, the spec includes flex and bison code that describes the syntax and structure of the template files
    Internally, we've written some C, C++ and Java code to the preliminary version of the spec and we've found that we can duplicate the functionality of the TEDS Library for LV in roughly 2 weeks in any other language.

  • ActiveMovie Control,Translating ActiveX calls from Visual Basic into Labview

    Hello,
    I want to use DirectX to display a movie. In the attached file is a Visual Basic example
    which I tried to translate into Labview.
    To play the movie IMediaControl from ActiveMovie control type library Version 1.0 C:\WINDOWS\system32\Quartz.dll) is used.
    To display the current Position I tried to wire the IMediaPostion. But I have no idea how to implement this in the Block Diagram.
    After opening it the following message is shown.
    Error 3005 occurred at Automation Open: Object specified is not creatable in Play Movie Current Possition.vi
    Attachments:
    Play_Movie_Current_Possition.vi ‏48 KB

    Hello Joe,
    the Windows Media Player has a lot of overhead. I also found it difficult to deal with the different Versions.
    I want to display data in a graph and show the connected video frame in a separate window.
    I used the QuartzTypeLib because it is on every Windows Computer and is easy to code in VB.
    With one call I can start the video in Labview., but I find no way to wire the current position. I do not really understand how ActiveX is implemented in Labview. I attached a LV 7.0 vi. I hope you can open it.
    Tiemo
    Attachments:
    Play_Movie_Current_Position.vi ‏63 KB

  • Environment Variables for Visual Basic Clients

    How does one set the environment variables when writing clients in Visual Basic.
    I would like the set the variables TUXDIR, WSNADDR etc at runtime, instead of
    setting them in the Control Panel
    Thanks

    Hello,
    I don't know too much about Visual Basic, but if you can bind to the Tuxedo C
    functions from VB I'd suggest you simply call the tuxputenv() function a couple
    of times to setup the environment for your process.
    Hope this helps,
    /Per
    "Gaurang" <[email protected]> wrote:
    >
    How does one set the environment variables when writing clients in Visual
    Basic.
    I would like the set the variables TUXDIR, WSNADDR etc at runtime, instead
    of
    setting them in the Control Panel
    Thanks

  • I want to access LabView and Field Point Library through Visual Basic. Where can I find adequate information considering that I am just an starter.

    My aim is to have a ActiveX Control on a web page that can control the field point hardware as a small step towards home automation through the internet.

    The place to start is here :
    http://sine.ni.com/apps/we/nioc.vp?cid=3769〈=US
    This is labview's measurement studio homepage. This contains component works which is a toolkit for visual basic. This should give you all the info you need to get started.
    Jared

  • Pass array to "Labview 7" DLL in Visual Basic

    Hi!
    I would like to pass arrays in Visual Basic to a LV DLL made in Labview 7.
    I've seen the examples of NI to create a dll in Labview for Visual Basic and for passing arrays, but all the examples were made with Labview 6.
    The problem is that in the tutorial they say to define the Pass By of the argument as Array Data Pointer, but in Labview 7 when I add an array as an argument I don't have that option.. It's always defined as TD1Hdl* inArray, and in Labview 6 it was defined as float64 inArray[].
    Can I use the TD1Hdl structure in Visual Basic? How do I use it?
    Thanks!

    Unfortunately, i'm not expert in Visual Basic, i need to investigate in your problem.
    See link below, that explain how you can use LabVIEW DLL in Visual Basic.
    http://venus.ni.com/stage/we/niepd_web_display.DISPLAY_EPD4?p_answer=&p_guid=B45EACE3D9E556A4E034080...
    http://forums.ni.com/ni/board/message?board.id=170&message.id=100151&requireLogin=False
    http://zone.ni.com/devzone/devzoneweb.nsf/Opendoc?openagent&4303F9807BFE234486256906007259EF
    Regards,
    Christophe S.
    FSE East of France І Certified LabVIEW Associate Developer І National Instruments France

  • How to get BW-BPS variable value into Visual Basic?

    Hello,
    Scenario:
    Time characteristic 0FISCYEAR has a variable ZVFYEAR. In layout this time characteristic is defined as DATA COLUMN. When user changes VFYEAR variable’s value i want to get the value of variable into Visual Basic and to format header for table in the layout.
    How to get BW-BPS variable value into Visual Basic?
    Could you help me?
    Thanks in advance.
    Best Regards,
    Arunas Stonys

    Hi,
    If i understand your requirments correctly ,you need to read the value of the Variable and Put it on the layout. Here is how  i would solve this,
    Read the value of the variable using an ABAP program.The logic for this would be to read the variable value and post it on the layout on a cell.You can do this by calling the ABAP program on opening the layout.this can be done using LB_EXIT_FM  T-code. Now using the  SAP delivered SAPAfterDataPut  macro, read the cell in which you have placed the variable values and assign it to the necessary values you want to on the layout.All this will be done before the layout opens.
    Hope this helps.
    regards
    Sai Vishnubhatla

  • Labview vs visual basic vs visual C

    Hi,
    I am hoping to get advice about LabVIEW vs Visual Basic/C for developing education software.  I have programmed in LabVIEW for test and measurement applications. 
    I have also programmed a couple of short programs in C, but have never programmed in Visual C or Visual basic.  I want to develop software for educational purposes for
    students with special needs such as spelling and reading comprehension programs.  These programs would involve a lot of displaying text, graphics and
    sounds to the students and measuring student inputs via text or clicks on buttons to determine whether they need additional help from the computer to learn the lessons. 
    I was was wondering if anyone has the knowledge to advise using LabVIEW vs Visual C vs Visual Basicfor such programming tasks?
    I am guessing that Visual C and Visual Basic may have more flexibility in displaying text, graphics, sounds etc. since this is mostly what they used for.  On the other hand,
    I am famliar with the ease of coding in LabVIEW for test/measurement applications but wondering if there might be limitations or difficulties in programming with LabVIEW
    for a more general purpose windows application such as the education software I am planning.   I would have to learn Visual C or Visual Basic, but if those environments
    would be easier or better in the long run, then I will be better starting off with one of them then getting down the road with labVIEW and changing directions.  Any advice will
    be welcomed.  Thanks!
    Dave Adams

    Hi Adam,
    I suspect I will get a lot of crap from the LabVIEW community here for saying this, but if you have the time to learn VB .NET, I think you will find that it makes things much easier in the long run for applications that involve a lot of user interface design.  In my experience, I have found that there is little that cannot be done in LabVIEW - it is more a matter of elegance.  Software like you are describing is best implemented using an event-driven approach.  VB .NET (as well as the older versions of VB, and C#) make this type of design pattern extremely easy to implement.  With the .NET framework libraries available to you, virtually any type of user interface control that you would need is available to use and the documentation provided on MSDN blows LabVIEW documentation out of the water.
    One caveat: if you expect to be running this software on other platforms other than Windows, .NET may not be the right choice.  (There are .NET runtimes available on some other platforms (like Mono for Linux), but you would wind up needing to modify a lot of the user-interface code and a lot of the framework features in general are in beta.)
    Also, the express version of Visual Studio is free and there are really no limitations to the express edition that would matter for writing a simple Windows application like you are describing.  Note that a fairly convincing argument can be made for why Visual Studio is THE best IDE on the market right now.
    On the other hand, using a tool you are familiar with has its benefits.  Nevertheless, I have never met a software engineer that could not learn VB .NET, who could somehow still write decent LabVIEW code.  LabVIEW is easier to use only for people without a software background - and those are the same people who really shouldn't be writing software (as evidenced by the hundreds of pitiful LabVIEW VIs that I'm exposed to on a daily basis).
    Anyway, I hope this helps,
    Rob

  • How do you call a Visual Basic App From Labview?

    I have a Visual Basic executable application that is collecting data from a USB port and displaying it in an MS grid control. I would like to read the same data in a LabVIEW application. The LabVIEW app would periodically poll the VB App to collect the current data. Does anyone have any insight or examples?

    Go to the Resource Libary at http://zone.ni.com/devzone/devzone.nsf/webcategories/9C6DF90777E5A78206256874000FA14E?opendocument (Resource Library>LabVIEW>Connectivity>ActiveX) for some examples. You'll need access to the VB source code.

Maybe you are looking for

  • Downloaded game and keeps saying it's loading

    I Downloaded a free game off the Apple Store and when I hit open itke saying it's loading.

  • PR , PO RELATION TABLES

    hi all, i had created a PR for a material, w.r to PR i had created a PO. but the ordered Quantity BSMNG is not getting updated in EBAN. when does this gets updated. thanks

  • Ipad 3rd generation LTE spain

    Hello! Right now I am living in USA, but I'm going to Spain in two months. My question is if I buy an iPad genetation 3rd in USA, wifi and cellular version it´ll work in Spain? Thanks

  • Can I get Cisco Jabber 10.6.0 to work on Windows XP Pro SP3?

    We are implementing the new Cisco Jabber 10.6.0, per a requirement, but we still have some Windows XP Pro SP3 users. The issue is that with this new client the app will not load due to error:  CiscoJabber.exe Entry Point Not Found: the procedure entr

  • Applet font not changed

    Hello, I have an application/applet that displays persian text. The font is bundled in the jar file and this works perfectly well when I run the application, however the applet seems to display a some default persion font (which does not join charact