How to sum a shared variable

Hi All
I am using Crystal XI and have my shared variable displaying on my main report but can't get the total of these in the RF. Report is as follows;
details a;
@sumtotal
whileprintingrecords;
numbervar sumtotal:=0;
details b;
subreport
details c;
@sum of shared
whileprintingrecords;
numbervar sumtotal;
shared numbervar lineamt;
sumtotal:=sumtotal+lineamt;  (this calculates and displays fine)
RF;
whileprintingrecords;
numbervar sumtotal; (this displays as 0)
I either have the wrong formula or it is in the wrong place.
Thanks in advance.

Hi,
try this
create in RH
@sumtotal_total
whileprintingrecords;
numbervar sumtotal_total:=0;
create in details d
@sum of shared_total
whileprintingrecords;
numbervar sumtotal_total;
sumtotal_total:=sumtotal_total+@sum of shared;
zettels

Similar Messages

  • How do I install Shared Variable Engine on a computer not having Labview?

    Hi,
    I am trying to communicate with a real time program running on Compact RIO through shared variables. I have an executable of the host vi that runs on a Windows computer. If I run this executable on the computer that has Labview installed on it, it functions fine. I want to be able to run this executable on a computer with Labview. I learned that I have to first install Shared Variable Engine on this computer.
    How do I do that? Where to install it from? Is that going to be sufficient? Please provide the solution or point me to the right resources.
    Thank you.
    Anmol.

    When you built the installer for the executable, you have a choice to include additional installers. One of them is the "NI Variable Engine". Have you tried including it?
    LabVIEW Champion . Do more with less code and in less time .

  • How you connect a shared variable between internet?

    Hello;
    I have a aplicarían which use the shared variables, and other one which is the slave. both work rightly, in a local lan, but now I need connect the slave aplication between Internet.
    what is the procedure?????
    thanks in advance

    Hola Joju,
    La tecnología de variables compartidas sólo es válida dentro de una red local. Si necesitas acceder a una variable desde Internet, tendrías que hacer uso de DataSocket y de servidores DNS.
    Servidores DNS para que tu PC tenga asociado un dominio en Internet y, de esta forma, se pueda acceder a él a través de su nombre. El problema es que tendrías que dar de alta dicho dominio. Después, seguir las instrucciones de este link, cambiando direcciones IP por nombres de equipo:
    How to Use Shared Variables and DataSockets to Pass Data Between Two Networked PCs
    Esto no es trivial y dependiendo de la configuración de la red del operador, es posible que haya problemas. Para comunicación a través de la red, siempre es más recomendable utilizar funciones básicas de TCP/IP o servicios web.
    Un saludo,

  • How do I setup shared variables between executables created in sepparate projects

    Hello,
    I have several sepparate projects with their own respective executable files and I would like to be able for these executable files to all share the same variable (one program controls the value of the variable, while the others read from it).
    I got this setup to work on my personal computer (by being able to access variable manager, etc), but I need to deploy these executables on different computers that don't have the labview development program. What steps do I need to do in order for me to be able to put these executables on any computer (I'm assuming I need to setup a path for the shared variable that is always in the same folder, etc)
    Thanks
    Vlad
    Solved!
    Go to Solution.

    Hi Vlad,
    I think this article may answer some of your questions regarding shared variables in deployed applications.
    http://zone.ni.com/devzone/cda/tut/p/id/9900
    It sounds like you already have your executables built, but this article may answer some questions about deploying them to other machines.
    http://zone.ni.com/devzone/cda/tut/p/id/3303
    Jeff S.
    National Instruments

  • How is work "Get Shared Variable List with another computer " ?

    Hi all
    I can't receive the list of Shared Variables from   another computer  .
    From localhost computer I received it.
    Why?
    Regards
    Iskander

    First the stupid questions...
    Are you sure the variables have been deployed on the other computer?
    Are you sure you have the right IP Address?
    Could your IT department be blocking you?
    Could Windows firewall be blocking you?
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How to convert variables on program to shared variables?

    Hi I want the controls and indicators of an already existing programs to be available on the Data Dashboard of a tablet/phone. What are the steps to follow if I want to convert them into shared variables so that I can send them to the dashboard. I just found results on how to create new shared variables.
    Also the existing program is a state machine. So will the variables be available on the dashboard simulteneously or is it possible to visualise the controls in the form of multiples tabs on Dashboard, like it is on the original program?

    I don't know of any way to convert the controls to shared variables. You're going to have to create the shared variables fresh and wire them up in a way that makes sense for your application.
    As for tabs...kind of. Each dashboard can be configured to have different screens and you can move between them. This is probably the guide you want to follow:
    http://www.ni.com/white-paper/13757/en/

  • 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

  • Initialize the shared variable

    "From the issue description it seems that the Shared variable needs to be reinitialize.
    Create a formula to initialize the shared variable value and place it in appropriate section of the Main Report based on the section in which you are displaying shared variable value of the Subreport."  (post from Poonam Thorat 7/7/08)
    This is a solution to my problem.  However, I'm not sure how to initialize the shared variable value nor do I know where to place it in the appropriate section of the main report.  Therefore, what should the formula look like and where should it go in the main report?
    Can anyone help me with this?
    Thanks much!

    Hello
    Lets say you have a report like this
    Report Header
    Page Header
    Details
    Report Footer
    Page Footer
    If you want to create and initialise a shared variable, create a formula like this
    For this example call this forumula Rate
    whileprintingrecords;
    shared numbervar Rate := 1.5; // this can also be a field
    If you needed to use this shared variable in the Details section, then you would place the Rate formula in the Report Header, or Page Header (above Details so that it is created before the Details section is created)
    In details lets say you have some other calculation - Commission
    The Commission formula would look like this
    whileprintingrecords;
    shared numbervar Rate; // a shared variable must be referenced in each formula that it will be used.  It is NOT being initialised or set to any value here, just referenced
    {table.fieldname} * Rate
    Place the Commission formula in the Details section and Rate will be for each record in the report
    The same process applies for passing values from main report to sub report and vice versa
    There is also plenty of info in the Help and online about using shared variables
    Best regards
    Patrick

  • Comparing Previous shared variable to current variable Whileprintingrecords

    Hi All,
    I have a report with items listed in the footer. I need to compare the shared variables of 1 record to the next but I can't use Previous(field) because I'm doing the comparisons in the footer. How can I use Shared variables to find duplicate values? In some kind of WhilePrintingRecords Array? If so, how do I limit the array to compare the present value to the previous value only?
    footer row     SharedVariable    
    1                    887768
    2                    887756
    3                    887756
    4                    887787
    Thanks,
    John

    Hi John,
    Create a formula with a code that looks something like this and place it in the footer section(by the way, which footer are you taking about?):
    WhilePrintingRecords;
    numbervar array arr;
    numbervar x;
    shared <variable_datatype> <variable_name>;
    if Not(variable_name IN arr) then
         x := x + 1;
         redim preserve arr[x];
         arr[x] = variable_name;
    Create another formula to display the contents of the array and place this on a footer section below the above one:
    WhilePrintingRecords;
    numbervar array arr;
    stringvar vals;
    numbervar i;
    for i := 1 to ubound(arr) do
         vals := vals + arr[i] + chr(13);
    left(vals,len(vals)-1);
    Right-click this formula field once it's placed > Format field > Common tab > Check the 'Can Grow' option.
    Hope this helps.
    -Abhilash

  • Strange behaviour with Vision 8.2 and Shared Variable 1D Image Array

    I've just upgraded to LabVIEW 8.2 and Vision 8.2.  When loading a particular VI, it is searching numerous times for ...\LabVIEW 8.2\resource\objmgr\IMAQ Image.ctl - which of course doesn't exist.  As best as I can track it down, this seems to be cause by a Shared Variable I have in the project which is a custom control of a 1D array of Image. 
    So I've created a new project from scratch to illustrate (attached).  The VI runs OK, but any editing means that this non-existant control is searched for again.  Of interest is also that there is a coercion dot where the Image is used, but the data type on the wire seems OK.  Creating a control (rather than a Shared Variable) works fine.
    Anyone know what's going on here?
    Message Edited by GregS on 02-26-2007 03:43 PM
    Attachments:
    1DImage.png ‏4 KB
    1DImageShared.zip ‏15 KB

    Hello Greg,
    I downloaded your project and opened it up on my
    system.  I received the same results as you
    did – I tried to open the project it searched for \LabVIEW 8.2\resource\objmgr\IMAQ Image.ctl.  I also used the 1d Image.ctl file as a constant on my block diagram and it did not
    show the coercion dot as you mentioned.
    There does seem to be some strange behavior going on here
    with the coercion dot and the shared variable. 
    I will have to look further into it and report this to R&D. 
    But for now, we need to address your application.  What is the goal of your application?  How does using a shared variable with IMAQ
    Images help you get there?  You may be
    aware of this already, but when an Image wire is passed around LabVIEW, it is
    not actually passing a copy of the data in a dataflow manner.  The large size of IMAQ Images necessitates
    that LabVIEW pass around a pointer to the IMAQ Image.  Therefore, when an array of Image controls is
    made and used as a shared variable, the controls do not contain the actual
    image data.  Instead, they contain
    pointers to the IMAQ Images.  When they
    are passed into a shared variable, unexpected results may occur.  If the shared variable is network published,
    for example, another computer on the network would receive a pointer to an
    image that it would not be able to find or access.
    There may be a much better way than shared variables to
    achieve the same functionality you are currently looking for.  If you do in fact require shared variables,
    you could use IMAQ ImageToArray.vi
    to create an array that can be used in the shared variable like any other data
    type, and then use IMAQ ArrayToImage.vi
    on the other end to be able to view the array as an image.
    Please post back with more information about your
    application and we should be able to find the best solution for you.
    Regards,
    Luke H

  • Shared Variable does not update when typedef is changed

    I have a shared variable of type custom control (typedef made up of a cluster). When I chang the typedef, e.g. the name or type of one of the fields in the cluster, and then save it, the shared variable does not update to reflect this change. That is, if I place the shared variable on my block diagram and do a "UNBUNDLE BY NAME" on the output, I see the old fields. I have to go back to the properties of the shared variable, change its data type, apply it, then go back and change it back to my custom control.
    Anyone else seen this behaviour? Anyone know how to get the shared variable to update without going through this procedure?
    Bill
    “A child of five could understand this. Send someone to fetch a child of five.”
    ― Groucho Marx

    I guess I should have included this information:
    LabVIEW 8.2.1 using Project Explorer.
    “A child of five could understand this. Send someone to fetch a child of five.”
    ― Groucho Marx

  • How to use shared variables to address multiple Watlow controller​s on the same COM port

    Hello,
    I am trying to use LabVIEW 2010 to control 4 Watlow temperature controllers on one COM port. 3 are Model 96 and 1 is an EZ zone controller. Each controller has a unique modbus address, and I am trying to read from and write to individual registers (such as closed loop setpoint) using shared variables. I am getting return data when reading (although the data appears to be invalid), but am unable to change the value in the register by writing. How can I be sure that the Modbus server is sending commands to the correct controller?
    Chuck
    Solved!
    Go to Solution.

    Peter,
    Thanks for the reply. I have actually solved that problem. I realized that the Modbus server address has to be the same as the controller's Modbus address.
    I have, however, run into another problem. Perhaps you could help me with that. I have a system with 4 Watlow controllers, 3 are series 96 controllers, one is PID only and 2 are ramping. The 4th controller is an EZ zone. I am using RS485 for communications and the controllers are all wired in parallel for communications and power.
    I have set up 2 Modbus servers for 2 of the controllers.
    This is the first I have ever worked with Modbus based communications. I have successfully programmed using the Modbus read/write VIs, and am wanting to move to shared variables. My questions right now revolve around addressing, Modbus I/O servers and COM ports. Specifically, at this point, I know the addresses need to match up between the server and the slave device (Watlow controller in my case), how many servers can I create and use on one COM port? If the number is limited, is there a way I can specify an address that I want the server to talk to? Will the broadcast mode work to request data values from the controllers?
    I'd appreciate any information you can help me with, or if you could point me to some sort of concise 'How-To' for Modbus communication.
    Thanks.
    Chuck

  • How to add a new Shared Variable programmatically to an existing and deployed library?

    Hi there!
    I am trying to accomplish this on both LabVIEW 8.6 and LabVIEW 2010 and seems like it's not any different in this situation.
    My case: A project has a library with 4 Shared Variables (SVs). The library and the variables are deployed (visible in Distributed System Manager 8.6/2010). I want to add 2 more variables into this library. It is possible to do this manually from Project Explorer window's options menu. But while running an application it has to be done programmatically. Can I provide the library reference to the one currently existing without creating a new one?
    "Create Or Add Library To Project" function in the Datalogging and Supervisory Control (DSC) toolkit does not help in this case. That function, as the name suggests, just tries to create a new library in the project.
    Two possible methods:
    The function "Add Shared Variable To Library" (DSC>EngineControl>Libraries & Processes) needs a library reference, which could be provided via "CreateOrAddLibraryToProject" function, but this function tries to create a new library, and if I provide the path of the existing library it throws an exception that the library already exists in the project (yes, as I wrote above, I need to add new variables to an existing and deployed library).
    OR
    The function "Create Shared Variable" (DSC>EngineControl>Variables & I/O Servers) will add Shared Variable in a process, and not physically in a library file, and the problem (limitation) with this approach is that it doesn't allow to add complex data type Shared Variables (for example in LabVIEW 8.6 it has only 4 datatype options in input parameter, and even in LV2010 it does not have "Image" datatype that I need).
    The scond method is my preferred method as it allows to work on Online Shared Variables and doesn't create them physically in libraries (and this is good as the variables' scope remains only till the Variable Engine is running). But it doesn't support advanced data types, and the first method is powerful in terms that it supports to virtually any datatype, it just seems tricky to get that reference to the library.
    Any tips?
    Thanks ahead!
    Vaibhav

       <<<<>>>>   
    As the above two images show, while a library does not exist, it is easy to use the "CreateOrAddLibraryToProject.vi" which will add a new library to the project (if it doesn't exist on file system, a new library will be created) and that way, using the reference (the green wire going out from the function and the Case Structure, can be used to add Shared Variables to the library. The problem was what to do when a library already exists in the project, how to add more variables to it. I was looking for a way to get a library reference, and somehow I could not see it inside a Project's property (VI Server functions). Hence I posted the question. And upon continuing my search, I found it on the Application's property list.
    I hope it was useful for someone else as well. And thanks for the replies. Please share a better idea if you have.
    Vaibhav

  • How to read shared variables inside event structure ?

    Hi,
    I have a problem that my shared variables do not update inside event structure. The program(s) I am trying to get working is seen in the attached screenshot. It works as follows:
    0. I start the vi that is unsquared.
    1. I write a string to a shared variable using vi in red square. I make sure that its updated using write-wait-read.
    2. I run the other vi (blue square), this changes the boolean shared variable.
    The unsquared vi has been running the whole time, it has event structure bind to boolean shared variable change (the one in blue vi). After I have runned the blue vi, the unsquared vi should change the indicator values to match the ones in red vi. However I have to start the blue vi multiple times to get it to change, sometimes even 6 times.
    Also, when I change the value in red vi to a third value and start blue vi multiple times, the unsquared vi shows all the variables. I.e. I put "cat" to red then start red, put "mouse" to red then start red,... and then start clicking blue... Unsqured shows cat, mouse,..., dog (dog is the default).
    How can I force the shared variable to update inside event sructure. I want the current value of the variable, not some historical values.
    Attachments:
    Screenshot-5.png ‏108 KB

    Found the buffering... disabling it solved the problem... thanks.
    FYI, there is another solution that I just found out... attached. Adding timeout to the event structure and the variable read outside the event structure... This makes the shared variable strings (one that is read outside and the otherone that is read inside) different.
    Could someone explain why the variables are in different state even if they are used in the same place and looped with 10ms intervals?
    Juha
    Attachments:
    Screenshot-6.png ‏110 KB

  • How do you synchroniz​e accesses to a LabVIEW Shared Variable?

    I would like to create an ad-hoc weather station program (I'll explain more in a bit).  I am using LabVIEW 8.0 Full Edition, and I would like to share data over a network between stations with the LabVIEW Shared Variable.  Here's what I want to be able to do:
    A node would start up, and begin publishing data to a network via a shared variable.
    The shared variable is an array of clusters
    The cluster information would hold things like:
    Station Name
    Station Location
    Weather information cluster (temperature, rainfall, windspeed, wind direction, etc...)
    Timestamp of last update
    When a new node would like to enter, it would bind to the shared variable, grow the array, and add its information.
    If a node's Station Name and Station Location is already in the shared variable, it would merely update the information in the cluster.
    Viewing nodes could pop in, bind to the shared variable, and read/display the information at any time. 
    I am trying to enumerate problems with this before implementing, and I have run into a stinker of a problem that I am not sure how to solve.  How do I synchronize accesses to the LabVIEW Shared Variable?  If I read the variable, modify it, and write it back, I will undoubtedly run into a race condition where 2 nodes attempt to update its data and I will lose the data written by the first node - Node A reads, Node A modifies, Node B reads, Node A writes, Node B Modifies, Node B Writes, and thus the modifications made by Node A are lost.  In my specific application losing some data isn't critical, but if not remedied this type of problem could cause massive amounts of data to be lost when there are numerous nodes, and that is definitely not acceptable. 
    Does anyone have any recommendations on how to synchronize the read-modify-write operations on the data in the Shared Variable?
    -Danny

    Wendy,
    I am afraid Semaphores are not network-shared objects (to my knowledge), they are system-level objects that use operating-system synchronization mechanisms.  If I were synchronizing on a single machine, a semaphore might be a valid mechanism; as an aside, most user-mode semaphores are designed to synchronize within a single process - to synchronize between processes you need to store the semaphore in the Kernel, and to synchronize over a network you would need a network node to handle serialization of requests.  My Shared Variable is published over a network, and to my knowledge there are no network-published synchronization mechanisms available - mostly because there is no way to currently perform an atomic test-and-set on the Shared Variable (am I correct?) and there isn't a mechanism for blocking access to a Shared Variable from another network device/machine (or is there?).  I've been looking for some way to implement an atomic test-and-set but I am running into a wall; I know that if I select the "single writer" attribute of the Shared Variable I can get LabVIEW to force a single writer allowing me to have an atomic "set", but I need more than that.
    If only there was a network-shared Semaphore or some way to block other network accesses to the Shared Variable I would be in business - something like what I want doesn't exist, does it?
    Thanks!
    -Danny
    Message Edited by texasdiaz on 02-23-2006 02:52 AM

Maybe you are looking for

  • Trigger Question

    All, i have the need for a trigger (Insert/Update) on a person table. if INSERT -create log record with new account id, datetimestamp, 'INSERT', batch control code (used for batch processing later in evening) -check child table to see if person on in

  • Filed not reflecting in infopackage data selection screen

    Hello Gurus, I have added a time stamp fiield in generic datasource in R3 and selected that field,but when i replicate the data source in BI and go to infopackage data selection screen,i dont see that field.I tried all the possible things but its not

  • How to change the name of my wireless network?

    I would like to change the original name of my wireless network for a more personal name. How can I do it? Regards

  • Exam 1Z0-591 - Oracle Business Intelligence Foundation Suite 11g Essentials

    Hi, does anyone knows if this exam can be taken online, or at all ? When pressing 'Register for this exam' at 'Oracle Certification Program: Oracle Technology and Applications Certification ' I'm directed to a general page for exam-registration, but

  • "add_drv/rem_drv currently busy; try later"

    I am writing a device driver for PCI card on intel /x86 p/f Solaris 8. I have succefully written some portion of the driver & is able to read from the device register.Now i had to initialize the DMA in BUS master mode residing on my device.For that i