Historical value of shared variable

I need the shared variable still keep its latest value after pc restart.
I tried on 2 pc, one is successful, the other not.
Any suggestion? Thanks.

I would imagine the content of shared variables are not stored anyway on the harddrive, so upon reboot of a PC their contents will be lost. You will only see default values at launch.
If you want them to remember their latest value, you will need to save their contents to a file at exit, and read the contents back at launch.
Thoric (CLA, CLED, CTD and LabVIEW Champion)

Similar Messages

  • Value of shared variable incorrect in calculations.

    Hi All,
    Hope someone can help as this has me beat!
    I am doing a simple sales projection report, the only complication is that, being a global report, it needs to be run in a user selected currency.
    I have a parameter in the main report to allow currency selection, and then a subreport in the header that calls the exchange rate file and stores this in a shared variable.
    The detail sections then show potential sales in base currency and the report currency, i.e. potential value * rate shared variable.
    The problem is that the formula in the main report does not see the rate correctly. To test it I created two formulae - the first multiplies potential by rate, the other multiplies potential by another formula which is just a hard coded '1.47'.
    Selecting $ as the currency, I have the rate shared variable showing correctly in the detail as '1.47', but the formula that uses this sees it as 1.0018 for some reason, so instead of a correct value of $220,500.00 I get $220107.17.
    Have spent nearly a day trying to track down the issue, so any suggestions at all welcome !

    Thanks for the suggestions.
    'WhilePrintingRecords' was already in my formulae so it is not that.
    I have tried your suggestion of doing the calculation in the subreport and that does not work either.
    To give a bit more detail,  I have 5 formulae -
    @Potential = the value from the database,
    @Rate = the exchange rate from the database (=1.47)
    @x Rate = @Potential x @Rate
    @1.47 = hard coded value of 1.47
    @x 1.47 = @Potential x @1.47
    These then print out in the order above, and as an example I see ...
    @Potential;   @Rate;   @x Rate;      @1.47;     @x 1.47
    219,818.79;   1.47;       322,561.00;   1.47;        323,133.74
    which I get whether I calculate in the main report or the subreport
    A calculator confirms 219,818.79 x 1.47 = 323,133.621 so there is a small error even in the direct calculation. (Another formula with simply '219818.79 * 1.47' gave the same error)
    Obviously even though an error may be small it immediately raises concerns with users as to how reliable calculated results are in any Crystal report.

  • Why shared variable generates events when I write constant value?

    Hello all,
    I'm using LV 8.5 with DSC packet.
    I modified "DSC Events Demo".vi and made a test. I noticed that only variable which work okay is double typed. Why this code generate events all the time when I write constant values to shared variables? Double is okay, but string and boolean types not work okay. Is there any other people how have noticed same symption?
    Attachments:
    modified_dsc_event_demo1.zip ‏391 KB

    You may get an initial event on startup which is normal.  Also make sure that you have not enabled timestamp change events.

  • CFP-1808 shared variables timestamp

    Hi,
    I need to control and acquire data from a cFP Ethernet module (cFP-1808) to a PXI RT system. I have tested two ways of doing it:
    1. Bind shared variables to the Fieldpoint channels. Works great except for the fact that I have to record the timestamp of every single channel in all Fieldpoint modules. I have to avoid this. The reason I have to record all timestamps is that sometimes two consecutive reads are the same in value and in timestamp; so even if I make sure I get a value every 100ms in my real time application I cannot trust  that  the shared variable engine will give a real new value every 100ms, because sometimes one read is the same as the previous one. My
    understanding of the technology is that the cFP network interface checks for an
    updated value of the channels of each module at the Advise Rate. If there’s a
    new value the cFP transmits it to the Shared Variable Engine running in the PXI
    controller, but if the value has not changed it doesn’t transmit anything, so
    more efficiency is achieved in the network communication. This would explain the
    timestamp behavior of the shared variables bound directly to Fieldpoint
    channels; since there is no new value the shared variable is not updated so the
    timestamp of two consecutive reads is the same.
    2.  Create a Modbus server and then create shared variables bound to the Modbus server channels. With this method any time my RT application asks for a new value the shared variable engine provides a real new value with an updated timestamp, and all timestamps in the same module are equivalent (in 1usec range).  Therefore, it looks like using the Modbus solution I  only have to record one timestamp per module.
    So option 2 probably fixes my problem, but I'd like to understand why. Both methods use the shared variable engine, shouldn't they behave the same way? There's one downside in option 2, which is having to deal with Modbus addresses and not having the ease of use of option 1 that just browses to find the Fieldpoint channel.
    Any comments?
    A final note, it'd be great to be able to use the Fieldpoint VIs in LV Real-Time! Can this be achieved?
    Raimon

    Hi Raimon,
    How are you binding to your shared variables?  This KB reviews three methods:
    http://digital.ni.com/public.nsf/allkb/FA610367EC62574186257118005089F2?OpenDocument
    I don't believe using FieldPoint VIs on a PXI RT target is possible because FieldPoint is not a driver that you are able to install on the PXI RT target.  We do have the cFP-2xxx line of RT controllers for FieldPoint, which can communicate directly to the FieldPoint modules, ensuring determinism.
    Trey B
    Applications Engineering
    National Instruments

  • Can we use shared variable in main report's crosstab

    Post Author: sangi
    CA Forum: General
    Hi,
    I have a main report with subreport (in Group footer), crosstab (in Group header).
    For cross tab calculation, I need a value from subreport to be passed to main report's crosstab.
    I could pass the value using shared variable.. but since the crosstab is in group header , I am not able to get the values .. .it is all 0....
    Please help me

    Post Author: wapper
    CA Forum: General
    To my best knowledge, what you ask for is impossible. The subreport in group footer is going to be evaluated during the last pass, so you are too late to get values into the group header. I could suggest creating a copy of your subreport and placing it (possibly hidden) into the group header just to get the values you need... But this would be the last measure if you really can't do anything else to achieve same goal. Wapper

  • TPC 2012 - Problems with shared variable

    Hi,
    I tried to program simmilar thing to this one http://zone.ni.com/devzone/cda/tut/p/id/5548 on TPC 2012. But it doesn't work.I can see that both programs on my laptop and TPC are working(I've added an additional counter with display), but I cannot see any effect on TPC when I change the value of shared variable on my laptop. I use LabView 8.6 with Touch Panel Module. My question is what are the exact steps to run such application on TPC2012? Are they the same as for TPC 2006?
    I've noticed following issues:
    1.I cannot deploy the program from Project Manager(there is an information that maybe TPC Service is not started. - I've found such information about TPC Service http://digital.ni.com/public.nsf/allkb/DE177828D27A14A48625734E00768B66 but in fact I cannot find Start » All Programs»National Instruments » NI TPC Service » NI TPC Service Manager 1.0 Does it mean, that the TPC Service is not installed and the programm with shared varibles won't be working or can I start it somehow in another way? Do I need to have TPC service installed on TPC2012?
    Until now, I've built the project and sent it through FTP to TPC(the folder was /TEMP) and then started it.
    2.Ping works OK
    Thank you in advance for any hints how to solve this problem.
    Martin

    Well no problem, but I'm frustrated with this issue... I've tested many things and nothing. Just to help someone else as I in the future, these are my sources:
    http://forums.ni.com/t5/LabVIEW/TPC-2012-Problems-with-shared-variable/m-p/1009631/highlight/false#M...
    http://digital.ni.com/public.nsf/allkb/28536DE7E2D9E98B8625770B00738920?OpenDocument
    http://zone.ni.com/reference/en-XX/help/372507B-01/lvtpcgsm/tpc_install_sharvar/
    http://zone.ni.com/reference/en-XX/help/372507C-01/lvtpcgsm/tpc_install_sharvar/
    http://digital.ni.com/public.nsf/allkb/23532363F4905EC28625727A00730B80?OpenDocument
    http://forums.ni.com/t5/FieldPoint-Family/TPC-2006-Not-Listed-in-Targets-and-Devices/td-p/566325
    http://forums.ni.com/t5/LabVIEW/MAX-can-t-detect-TPC-2106T/td-p/831524
    http://zone.ni.com/devzone/cda/tut/p/id/5868
    http://digital.ni.com/public.nsf/websearch/28B748B9697B79E18625725A00009066?OpenDocument
    http://digital.ni.com/public.nsf/websearch/D1726990DCEB82E4862570F20069C57D?OpenDocument
    http://digital.ni.com/public.nsf/allkb/3B469103BBDD4CE48625726000665B36
    I hope find some hint..
    Fabian León
    Certified LabVIEW Associate Developer

  • VBAI: how do I read a shared variable?

    I am trying to make my inspection to do things that are contingent on the value of Shared Variables. It is obvious how to set the Shared variables from VBAI, but I have not figured out how to read them and then create some kind of a CASE structure using that variable.
    Any ideas on how to implement such an architecture?
    Solved!
    Go to Solution.

    I would create two different states and use transitions that are based on the shared variable value. You can read the value of variables or previous measurements in steps that allow this (not all steps do, but most do) or transitions. To create a new state, go to the state diagram (click on the "Toggle Main Window View" so the state diagram is in the main part of the window). Right click in an empty part of the state diagram and select "Create New State".
    To create a transition, right click on a state and select "Create New Transition" and drag the transition to the new state.
    To edit the transition, double click on it and you will be able to select the shared variable as the measurement, along with comparison operations to make the decision. If this comparison evaluates to False, the Default transition will be taken instead.
    Select Help>>Show Context Help while editing the state diagram to get more details on how to use it.
    Hope this helps,
    Brad

  • Replace local shared variables

    Hi,
    I have a bunch of VIs in PXI RT target. There are about 300+ local shared variables distributed among these VIs. What I'd like to do is to change all these VIs target to PC instead of RT and debug and test these VIs logic in my PC. The reason that sometimes I could not use RT target for debugging purpose is because it is used to test the other program. The problem I have is that my local shared variables library is set up under RT target, how could I transfer the shared variable library to my PC. Even there is a way to transfer the library to my PC, It is hard to monitor and change the value of these local shared variables. I am thinking setting up a global variable VI in my PC and replace all these local shared variables with global variables. In that case, it is easy for me to control and read the variable value from global variable VI. My question is whether there is an easy way or tool to replace these local shared variables with global varaibles, and after I finish debugging VIs in my PC I could replace them back.
    Jason

    Hi,
    All of the files you deploy to your RT system are stored on your host PC.  If you want to run some of the VIs on the host PC instead of the RT target, all you should have to do is move them to your PC in your project or create a new project and add the files and libraries you want to use.  If you want an easy way to monitor the values of shared variables you can use the shared variable manager available under the tools menu in LabVIEW.  Unfortunately there is not a utility to convert local shared variables to global shared variables.
    Eric A.
    National Instruments
    Distributed I/O Product Support Engineer

  • Labview 8.2 can't write shared variable

    Hi!
    I developed LV 8.2 program using shared variable (network published) variant type. After extension of variable the vi charased after writing value in shared variable. If i changed shared variable from network published to single proces type the vi working OK.
    Attachments:
    problem.jpg ‏23 KB

    Hello,
    I have created a network published shared variable of type variant, and successfully written to and read from it.  Can you also post a snipet of your code which reproduces the problem?
    General things to try in case include:
    1. undeploy and redeploy the shared variable.
    2. repair your LabVIEW installation - this will repair the variable engine, and I know of at least one case where this helped after it was corrupted.
    I hope this helps!
    Best Regards,
    JLS
    Best,
    JLS
    Sixclear

  • Can't set intial value for cRIO boolean shared variable

    LabVIEW 8.0 gives me a configuration error when I try to force an inital value for a Boolean shared variable in my cRIO library.  Is that a bug, or am I overlooking some (probably obvious!) limitation of the cRIO hardware?
    Jeff
    Climbing the Labview learning curve!
    Sanarus Medical
    Pleasanton, CA

    There are 3 screenshots attached to this post.  Suppose I create a Boolean shared variable under My Computer in the project directory, then set the inital value as shown in BooleanInitialValue.gif.
    If I drag a copy of that Boolean shared variable to my RT target block diagram, the run arrow breaks and I get the error shown in ErrorList.gif.
    If I create a Boolean shared variable under my Real Time target (Compact RIO) in the project directory, then set the initial value and hit OK, I get the error shown in FixConfiguration.gif.
    Message Edited by Jeff in Pleasanton on 07-19-2006 03:42 PM
    Message Edited by Jeff in Pleasanton on 07-19-2006 03:44 PM
    Jeff
    Climbing the Labview learning curve!
    Sanarus Medical
    Pleasanton, CA
    Attachments:
    FixConfiguration.gif ‏6 KB
    BooleanInitialValue.gif ‏13 KB
    ErrorList.gif ‏13 KB

  • Shared Variable in DETAILS section reports value of previous item.

    I have a report with a subreport in the details section. I have set up a shared variable in the subreport to pass a value to the main report. For some reason, the value of the variable for the first detail line item, shows up in the field for the second, the value for the second shows up in the third and this pattern repeats. How can I get the shared variable to display in the correct record?

    It's because the data in the details line is evaluated/diplayed before the subreport executes.
    Split the details into two sections and place SR in top one and display formula for var in lower one.
    If there is data in the subreoprt you want on same line as the var then in section expert set the upper detail section to underlay.
    Ian

  • Shared Variable Initial value not licenced error with cRIO

    Hello Everyone,
    I've a project that will be deploed on cRIO. This project was created on a different machine and didn't have any error regarding the shared variables. when I transfered the project to the computer connected to the cRIO, I have this error with all shared variable. The error message says that:
    1. Initial Values: Not Licenced or can't be edited outside of LabVIEW.
    2. Logging: Not Licenced or can't be edited outside of LabVIEW.
    attached are two images for the error i have.
    Can I have help with this issue?
    Thanks in advance
    Attachments:
    1.png ‏134 KB
    2.png ‏142 KB

    Good day,
    Sounds like you are using the DSC module features on your code and you forgot to activate the runtime system on that machine. If you have access to the NI License Manager, please check the status of the license.
    We need an active license for the second message but, for the first one you can try to program your own initial values for all of your network-published shared variables by initializing whenever the PC is started. During the initialization portion of your code, you can just write a constant value to the shared variables so the values are the same initial values every time it is run.
    Regards,
    Alejandro | Academic Program Engineer | National Instruments

  • How Can i retain the Shared Variable Values after PC rebooting

    Hi all,
    I am facing a paculiar problem with Shared Variables. I have an application in which shared variables are used for data communication.
    One of the application requirement is to retain the variable values eventhough PC is rebooted or started after crashing. 
    As per the my understanding, the variable values will retain eventhough the PC is rebooted. But here i can observe a paculiar problem like some library variables are retaing the values while some others not. I enabled logging for all the variables.
    I tried many ways. like logging enabled, logging disabled, changing variable names, changing process names etc... But i am not getting a consistent behaviour.
    I hope some you can help me in solving this issue.. "How Can i retain the Shared Variable Values after PC rebooting"
    Thanks and Regards,
    Mir

    Hi Blackperl,
    Thanks for the post and I hope your well. 
    What do you mean by not getting consistent behaviour.. this will all depend on excatly when the crash happens i.e. before the write or after. 
    Surely a better method would be to log the data to a file during the reboot...
    I beleived the value read back
    will be the default value for the shared variable's data type.
    The LabVIEW DSC 8.0 module adds more functionality to the shared variable, including initial values and alarms.
    If you enable an initial value on a shared variable, when the variable
    engine comes back on-line it will default to this value. Setting a bad
    status alarm for the shared variable is also a good way of handling
    this type of event. Additionally, if you are using a LabVIEW Real-Time
    target such as Compact RIO or Compact FieldPoint, it is appropriate to
    consider hosting the shared variable engine on the real-time target.
    These devices have watch-dog capabilities and are typically the
    hardware controlling the critical pieces of an application. Most
    Windows or PC-based targets do not have these fail-safes.
    I guess, if you could explain to me again that would be great. From my point of view, if I have a cRIO and a Windows PC. If the windows PC crashes, the cRIO will still update its shared variables. Then once the PC has started up its own shared variable engine, and the bindings are loaded, it will once again continue to update its copies of the variables.
    Please let me know what you think,
    Kind Regards,
    James.
    Kind Regards
    James Hillman
    Applications Engineer 2008 to 2009 National Instruments UK & Ireland
    Loughborough University UK - 2006 to 2011
    Remember Kudos those who help!

  • How to create an array containing shared variable values

    Hi
    I am trying to programmatically create an array containing shared variable values and their names.  I can get the variable names by supplying the process name to the get shared variable list function.  How do I then read the value of all the shared variable items returned?
    I have used a data socket open to open a connection to all variables when my program starts.  I then use datasocket read on the opened connections to write to an array.  This works fine until I try to write to one of the variables using a shared variable node.  The variables writes can take from 4secs to 2 mins.  When I remove the shared variable node again all is fine.  Also when I stop using the data sockets, all is fine.
    Is there a conflict between shared variable nodes and data socket writes to the shared variables?
    Can anyone help?  I cannot easily post example code because I am reading the variables from a Wago PFC (PLC) using OPC.

    Hi
    Sorry I forgot to mention the LabVIEW version, its 8.20.  I have tried saving the shared variable node as a sub VI and it makes no difference.
    Attached is a stripped down version of the software.  You will not be able to connect to the IO server because it requires some Wago hardware and software.  You may spot something I have done wrong with the I/O servers, variables or sub VI's.
    The main program that runs is called 'HMI Engine' in the 'Framework' folder.  There may be some other things in the project that aren't used in this example.  I have removed all but the variable connection part of the code.
    I hope someone can help!?
    Thanks
    Mark.
    Attachments:
    HMI Test.zip ‏144 KB

  • Shared variable change its value with delay

    Hello. My shared variable shows an old value during some time after writing a new one. What is the reason?

    CKap,
    how to check buffering enabling for shared variables? I've attached pics of block diagrams: VirtualSpectrometer writes shared variable dLambda, and Camera reads it. And sometimes, even when VirtualSpectrometer attemp to write 0 to dLambda for the number of loop's periods, dLambda stay non-zero (to be exact +/-5.55) for a couple of seconds.
    Attachments:
    VirtualSpectrometerd.jpg ‏135 KB
    Camerad.jpg ‏386 KB

Maybe you are looking for

  • Friend deleted app (my disk for iphone) and need to get back data from my icloud backup...need help!

         I had this app called my disk (app store name is: Lock photo+video safe - secure folder manager to protect private photos vault & hide secret picture file privacy) This app lets me have two passwords with different pictures and videos in each of

  • Default File for folder

    Hi everybody I have a KM Navigation iView which display the content of a folder. On the left I have the files in a layoutset of a Tree, and when choosing one of the files, its preview appears on the right. The problem is that by default, if you don't

  • Regarding Work center

    Hi gurus, Presently I am working for a Engineering and Construction Project, I am new to Project systems. In this project client have one Fabrication unit and 20 Projects across the India. In project site also they are doing some production activitie

  • Prefill widget using document template

    Hi All, We are building a website in which customers fill user friendly forms and sign a W-9 and other documents in an echosign widget. We are going to use document templates to generate the widget for users to sign. What property do I need to set at

  • Why is stationery so kludgy?

    I am not much of a geek and do not necessarily have all the know how that I need to make things work all the time: and the stationery features in Mail are stressing me out! I have made some stationery and have it saved in the stationery folders and a