Creating and loading 4000 shared variables

I need some help laying out the design of this system.  The data is coming over reflective memory.  I've written a dll and a simple server to do the interface between the reflective memory and shared variable engine.  Everything seems to be working.  The problem I am having is with scaling the application up to handle approximately 4000 variables.  I have a spreadsheet to manage the reflective memory allocation and can use it to import the shared variable definitions with the names from the system that is writing the data.
I am having trouble deciding on the best way to proceed.  I would like to read a buffer from reflective memory instead of reading 4000 times.  I also would like the server to read in a file that defines the association between the shared variable and reflective memory address.  The problem I am having is getting the data out of an array into each of the shared variables.  I don't see a way to load the value of a shared variable using the property node (so that I can do this inside a loop).  I also can't setup an alias that would access an array element.  I don't want to manually create 4000 variables.
Any ideas would be appreciated.  Thanks.

I have never had to resort to creating Shared variables programatically so I will leave that for others.
I would cheat.
In LV 7.1 DSC i could import my tag config from a csv file. After importing and saving in LV 7.1 I could let LV create the SV's when the code is updated.
THat all assumes I will only have to do that one.
I have used the interupts fired when SCRAMNet locations update to "steer" the value to appropriate code which could then in turn update the SV using a datasocket write since I can compose the URL for the SV dynamically.
Just sharing ideas,
Ben
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction

Similar Messages

  • 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

  • How do i create and pass a global variable from one vi to several sub-vi's?

    Hi Guys,
    I am trying to create a program that opens several front panels (sub-VI's) in sequence. in each front panel, the user would open a file that the name is obtained from the previous sub-VI. I would like to know how i could pass the filename and refnum of the file thorough from one sub-vi to another. A global variable would do it in VB, but how do we do global vars in LABWIEW. thanks
    Papish

    I put together a sample VI and Sub VI that illustrates how to pass a Refnum and access a data file while in a Sub VI.
    For multiple VIs just repeat the sub VI process.
    You probably don't wanna use a Global Variable if not needed (can add to the mess down the road haha).
    Let me know if it helps you out! Or if I can clarify anything else!
    Chances are if you have seen VI in the forest it hasn't fallen.
    Attachments:
    Passing Refnum.zip ‏21 KB

  • How to create and share attributes or variables in Standard WebDynpro?

    Tremendous 2010 guys!
    I'm having trouble about a Web Dynpro ABAP application. It uses two Web Dynpro components: FITE_VC_GENERAL_DATA and FITV_VC_COST_ASSIGNMENT, and the users would like to delete showed-in-text-field default info in the first View (contained in FITE_VC_GENERAL_DATA) but they want the user provides his/her own info in a second view by a window (view, contained in the second web Dynpro component FITV_VC_COST_ASSIGNMENT) that appears after clicking a button in the fisrt view. So, I want to declare an attribute or variable (a flag) in the second Web dynpro component that is to be copied or transmitted or exported at the first Web dynpro component to indicate "The user already used the second Web Dynpro component", and thus, to avoid an enhancement point I set in the first Web Dynpro having effect and delete the valid data entered by user (because in the begining, yes, I want to delete the data, but once the user writes his/her data, I need a FLAG to know it).
    Really I am a newbie, even a dummy in Web Dynpro ABAP, I dont know if it is possible to declare new attributes in a Standard Web Dynpro Component (but I used an enhancement point to declare a char variable inside a method, but it is only local and I cant communicate it to another WD component). Because it is OO ABAP, I know it is not possible to declare Global data usable by various Web Dynpro Components, isnt it?
    Beyond, If I could create my own attributes in the second Standard Web Dynpro Component, How I should export them to the first Web Dynpro Component?
    I was wondering if it would be a good idea to use a transparent table to store my flag and use it again when the run time is on the first Web Dynpro component... Or use ABAP or SAP Memories... Have mercy, help me please!

    Hi Parga,
    You need to declare the variable at Interface controller and need to map this at the context level.
    Like a variable declared at web dynpro component context level can be used among all views.
    every web dynpro component have an Interface component. this can be used in other components where this perticular component is used it is also have a Context.
    For more info Take Usage of Component Controller Examples.
    [Check this thead|http://help.sap.com/saphelp_nw70/helpdata/en/3a/165da11551994db913f56829f8f3f1/frameset.htm]MPUSAGE
    WDR_TEST_CMPUSAGE_CI1
    WDR_TEST_CMPUSAGE_CI2
    WDR_TEST_CMPUSAGE1
    WDR_TEST_CMPUSAGE2
    WDR_TEST_CMPUSAGE3
    WDR_TEST_CMPUSAGE4
    WDR_TEST_CMPUSAGE5
    WDR_TEST_REF_CMP_USAGE_CI
    WDR_TEST_USAGE_GROUPS_CI
    WDT_COMPONENTDETAIL
    WDT_COMPONENTUSAGECheerz
    Ram

  • How can I programmatically create and use a global variable?

    I have an app where the number of AI DAQmx tasks I create are specified in a config file.  I have a monitor task that periodically looks at the latest values from all DAQ tasks.  I've been doing this with a set of global variables because it was the simplest way to do it.  But to do this, I have to explicitly create a separate AI task that uses the hard-coded global variable name for the DAQmx samples.  I would prefer to only write one VI for the DAQ loop that writes to a global variable that I programmatically create based on the config file.  The only solution I can think of is to use a global variable "pool" that is sized bigger than I expect to need, and then have a big switch case to select which one I want based on the task index.  But this sounds pretty silly.

    I tend to agree with Ben. I don't buy the concept of taking the asy way out (globals) because it very rarely will things remain static. You almost always have to extend the features and functionality of an application and then you will run into issues with sloppy and lazy implementations. The solutions offered may require a little time to learn but once you do it doesn't really require any extra effort.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Create and Load Chart dynamically  in Flex

    Hi Friends,
    I want to create the chart dynamically [N numbers] . I try
    to create one line chart and add line series by action script , but
    i stuck up at how to embed that chart object in mxml code. I want
    to load the [action script created ] chart in canvas container.
    Plz help me if u have any ideas ,
    thanks
    ksam.

    what i would like to have is like this...
    XML Template :
    <class name="TaskA" getters="true" setters="true">
    <properties name="id" type="java.lang.Long" defaultValue="0"/>
    <properties name="name" type="java.lang.String" defaultValue="null"/>
    <properties name="priority" type="java.lang.Integer" defaultValue="3"/>
    </class>
    And using some java code i could generate a class at runtime, the prototype of which would be something like this...
    public class TaskA {
    java.lang.Long id=0;
    java.lang.String=null;
    java.lang.Integer priority=3;
    ..................... //Getters and Setters of the properties.
    }

  • 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

  • Modbus and shared variable performanc​e in large applicatio​n

    Hi all,
    I am preparing to work on an application which is going to reading from up to 500 Modbus input registers on a CompactRIO over Modbus Ethernet using the LVRT Modbus IO Server implementation.  I've put together some minor test VIs on the local network to test the Modbus connectivity and understand in the shared variable minding mechanism.
    To save potential headaches in the future, do you all have any best programming/proejct management practices for using high channel count Modbus applications?  Has anyone done high channel count testing (similar to the link below) but for shared variables bound to a Modbus I/O Server?  Any caveats I should keep in mind?
    Performance Benchmarks for Network Published Shared Variables
    http://www.ni.com/tutorial/14675/en/
    Thanks,
    Chris
    d2itechnologies.com

    If your application can deal with it I would recommend staying clear of the 'Networked Published' option.
    When I started my Modbus development on cRIO....I left it enabled, and with ~100 shared variables on a 9074, the CPU was railing, and I saw a buffering behavior on the shared variables (which was not desirable in my application).
    In my application I am using the old modbus library (as apposed to the new API) for cRIO to slave comms, the cRIO being the master.
    I am also using the IOserver making the cRIO a slave to an external SCADA - and it passes essentially the same data arrays as I use on the modbus library for my local HMI [Not an NI product].....Which is two full Modbus frame writes (@ 120 words each, and about 60 words more for ~300 words outbound from the cRIO).
    The IOserver slave was a recent addition and did not add much to the CPU load - although only 16 bytes is high speed, the balance of the total word package is at either 1 second or 3 seconds.
    So, in my experince, the 'Networked Published' option adds significant CPU loading (on entery level cRIOs) YMMV.
    I am huge fan of the shared variable engine (some at NI were pusing the CVT, and TCE etc...). However most of my shared variables are not the Networked Published variety (excepting local module channels) those have remained networked published for DSM (Distributed System Manager) use.

  • Data Logging a programmatically created shared variable of cluster or array datatype into citadel DB

    Hi,
    Is there a way to log a programmatically created shared variable of cluster or array datatype into citadel DB?
    I have attempted to programmatically create a shared variable of type 'double' and was able to successfully log the same into Citadel DB. In the attachment, Please refer to the attached project SV_TC.lvproj and specifically to SV_W.vi for the code that i have used (W.png file shows the dB in MAX and shared variable in NI Distributed System Manager)
    However when i tried the same approach to create a shared variable 'array of double', i noticed that traces are not getting created and hence data logging isn't happening into the Citadel DB. I was however able to write and read the shared variable array without issues. The same is true with cluster datatype also. Please refer to SN_NW.vi for the code that i have used - only difference from SV_W.vi is that i have tried to create a shared variable of type 'array of double'
    One observation is that if i create an 'array of double' or cluster in a shared variable library using the project explorer and deploy, i could see that these being logged into Citadel DB.
    Hence i want to understand what could be done to achieve the same programmatically? Could you please advice?
    Regards,
    Sridhar
    Attachments:
    SV_TC.zip ‏3925 KB

    Why is the transaction happening over remote?
    Because we need the information to be on our database immediately when they submit it.
    I don't know anything about streams or replication.....
    The web database is run by the company that hosts our web site. We use PL/SQL to show the pages and output the html. It fetches the data the customer is requesting from our database, but I'm struggling to get the best way to insert into our database from there.

  • Why do Single-Process shared variables create a single variable VI in my dir.

    I'm creating an application VI following the example which is created by starting a two loop Real-Time project which creates a Single-Process shared variable and a Network-Published shared variable for each variable that needs to be sent to a non-Realtime host VI. Each of the Single-Process variables shows up as a VI file with the following format: <variable library>_<variable name>.vi. The VI has one control which is the shared variable. I have a large number of variables and this creates a lot of clutter in the directory. I expected them to be rolled up into the library file. Is this expected behavior? I'm attaching a screen shot to show the behavior.
    Attachments:
    Shared Variables in Directory.JPG ‏383 KB

    Hi davidreed10,
    This is a known issue with single process variables that are saved in a
    project that has the .lvproj and .lvlib files initially saved in different
    locations, as is the case with Real-Time projects. This has been
    previously reported to our R&D department with the ID #56580, and
    is being worked on for a fix in a future release of LabVIEW.
    This should be only a problem for Single-Process variables, and not
    Network-Published variables, so if you want to keep your folder from
    getting cluttered up, changing the variable types to Network-Published
    should get you around the problem for now.
    Regards,
    Stephen S.
    National Instruments
    Applications Engineering

  • Network Datastreams and FIFO Shared Variables

    Does someone know why one would use a Network Datastream as opposed to a network published shared variable with FIFO enabled? Seems like they would be identical except that the Shared variable could potentially have multiple listeners.
    Thanks,
    Craig

    Hey Craige
    You are correct that a major difference between Network Steams and Network Published Shared Variables with RT FIFO enabled is that the Shared Variable can publish to many computers at once.  There are a few other differences that are outlined in the comparison table in this article  
    http://zone.ni.com/reference/en-XX/help/370622J-01/lvrtbestpractices/rt_gui_bp/
    There's another good comparison with some more information in the last paragraph of this article. 
    http://zone.ni.com/reference/en-XX/help/371361H-01/lvconcepts/networkstreams/ 
    Regards,
    Eric L.
    Applications Engineer
    National Instruments

  • Modbus ip shared variable network failure

    I am using lab view 8.6 DSC module to communicate to a watlow system which contains five watlow 96 controllers and an EM gateway.  I have created shared variables for the process temperatures and setpoints for each of the five controllers using watlow modbus register Numbers with a 400001 offset.  I have also created shared variables for Updating,CommFail,UpdateNow,and UpdateRate which where predefined. I have error when starting the VI if the SV  has been  dragged and dropped into the block diagram. The message is  Error -1967353902 (The Modbus I/O server failed to receive any response from the Modbus slave device.) occurred at SV in vi. If I bind a variable in the VI to this same SV the error does not occur but the variable cycles between Good, Network Failure, No known value, and device failure as stated in the variable manager watched variables.  The Updating, CommFail and UpdateRate all have a consistent Good in the quality column of the variable manager.  UpdateNow has X in value, type, timestamp, and quality columns.  CommFail and Updating does cycle between true and false randomly.  I have tried a third party software called SpecView 32 demo to see if the commincation with the modbus system is not working and I can create five watlow controlers on my screen and direct them to the ip address along with a unit address and the system works without faults.  This leads me to believe the commincation bewteen the SV Engine and the IP address is not correct.  HELP Please. 
    Robert Jensen
    UND EERC

    If your application can deal with it I would recommend staying clear of the 'Networked Published' option.
    When I started my Modbus development on cRIO....I left it enabled, and with ~100 shared variables on a 9074, the CPU was railing, and I saw a buffering behavior on the shared variables (which was not desirable in my application).
    In my application I am using the old modbus library (as apposed to the new API) for cRIO to slave comms, the cRIO being the master.
    I am also using the IOserver making the cRIO a slave to an external SCADA - and it passes essentially the same data arrays as I use on the modbus library for my local HMI [Not an NI product].....Which is two full Modbus frame writes (@ 120 words each, and about 60 words more for ~300 words outbound from the cRIO).
    The IOserver slave was a recent addition and did not add much to the CPU load - although only 16 bytes is high speed, the balance of the total word package is at either 1 second or 3 seconds.
    So, in my experince, the 'Networked Published' option adds significant CPU loading (on entery level cRIOs) YMMV.
    I am huge fan of the shared variable engine (some at NI were pusing the CVT, and TCE etc...). However most of my shared variables are not the Networked Published variety (excepting local module channels) those have remained networked published for DSM (Distributed System Manager) use.

  • Shared variables location

       I'm starting a fairly large project and wanted to organize it properly.  When I needed a shared variable, I first created a new library.  I was able to specify the location of this library in a sub-directory within my projects file structure.   Then I made some shared variables (single process).  After saving the project, the shared variable files appeared in the main project directory, at the same level as the .lvproj file, not in the subdirectory where the library was created.
       Any tips for orginizing shared variables?
    Thanks,
        Dave
    David Thomson Original Code Consulting
    www.originalcode.com
    National Instruments Alliance Program Member
    Certified LabVIEW Architect
    There are 10 kinds of people: those who understand binary, and those who don't.

       Thanks for the reply.  Unfortunately, the problem remains:
       I first create the library explicitely, before creating any variables.  I saved the library to a subdirectory.  Then I create variables.  When the variables are instantiated within a VI, at some point LabVIEW automatically creates vi files on the disk corresponding to these variables.  These VI files were placed in the main directory with the project file, not in the subdirectory where I put the library.  This is surprising to me and I would think this is a bug.
        My solution at this point was to create a "Project" subdirectory.  I put the .lvproj and the .lvlib file in that subdirectory and now the shared variable vis appear there as well.  This is a kludge.
       My main question at this point is:  can you specify where these shared variable VI's get created and stored?  I suspect that you could edit the .lvproj file or other xml files to change the share variable paths, but that is inappropriately difficult.  I tried just moving the files to where I wanted them, but then the variables don't load.  I managed to reload them, but at some point, they recreated themselves in the original location.
       At a minimum, the shared variable VIs should create themselves in the same directory as the .lvlib file that they belong to.  At least you can specify where the .lvlib file lives.
    Regards,
       Dave
    David Thomson Original Code Consulting
    www.originalcode.com
    National Instruments Alliance Program Member
    Certified LabVIEW Architect
    There are 10 kinds of people: those who understand binary, and those who don't.

  • I am trying to connect Dashboard shared variables to a server on a different subnet. Any ideas?

    My goal is to control a device that is connected to our wired network using an Android tablet via Dashboard.  I have created a vi with shared variables that controls the device as expected when it runs on a computer that is connected to the same wired network.  The problem is that my Android tablet running the Dashboard app cannot connect to the shared variables on the PC running the vi on the wired network.
    Our wireless network is on a separate subnet from our wired network.  I am able to ping my Android tablet from the PC on the wired network but when I try to connect a variable in Dashboard, the PC running the SVE cannot be found.  I tried listing it in the alternative server settings window and it still did not work.  The only way I have been able to get around this is to run the vi which launches the server on a laptop that is connected to the wireless network and the wired network at the same time.  My tablet can then find the server and my VI can connect to the instrument that is connected to the wired network.  The laptop is somehow acting as a bridge between the subnets.  I need to find a way for the Dashboard app to connect directly to the PC on the wired network.  My PC IP address is 192.168.0.105.  My Android IP address is 192.168.10.93.

    Data Dashboard doesn't care about subnets, but it has to be able to access the server using the right ports. There is probably a firewall blocking the shared variable ports. This document explains how to configure a firewall to allow shared variables to be accessed. Your challenge will probably be to figure out where the firewall is and how to configure it.
    It is also possible that the router that your Android device is connected to doesn't know how to route to the other network. Again, that is an issue with your router that you need to resolve.

  • Change Alarm / Quality of Shared Variables for I/O Server

    How does one set the Bad Status of a Shared Variable in 2009?
    IE).  I have a custom device that communicates via TCP/IP.  I wrote my own I/O server that handles this communication and publishes a set of Shared Variables that my Main Application displays on a screen.  These variables are all doubles and hold pressures and temperatures.   If my I/O server in labview loses communication I would like to be able to set the status of the variables to bad so they will set off an alarm.  In our main application we have colour indicators that are able to display this status.  For example the background goes yellow for all indicators that are in "HI" alarm status, red in "HI HI" and orange when "Bad Status" (disconnected). 
    We were able to accomplish this using LabVIEW 7.1 DSC, by creating a VI to register all our "Tags" and a VI to run the server.  The server vi's that came with 7.1 allowed us to set the quality when writing to the server item.  Therefore when the device was disconnected or failed we could set the bad status and use the DSC system to log an alarm and use the alarm features to colour code our indicators. 

    None of the Shared Variable IO Properties can be configured to allow you to set the alarm.  You can only configure the properties such as turning the possibility of the alarm status on/off and the priority, name etc.  You do not have the ability to indicate that this shared variable is in alarm because your custom server has encountered a problem.   I've talked to tech support about it and I've been informed that this was something that was removed when the shared variable engine was introduced.   I've been told informed that the recommended alternative is to create an additional boolean shared variable that will contain the status of the items, or to write some sort of unique garbage value to the actual tag value to indicate there is a problem with it.
    I now have to come up with a new way of providing this information.  I just find it will likely be a poor programming choice because now my entire system will have to handle "tags" differently based on what hardware is being used.  (IE) if its coming from a custom I/O device or from an OPC / Modbus etc capable device. 

Maybe you are looking for

  • What is the best design pattern for this problem?

    No code to go with the question. I am trying to settle on the best design pattern for the problem before I code. I want to use an Object Oriented approach. I have included a basic UML diagram of what I was thinking so far.  Stated simply, I have thre

  • Images edited in PSE10 and saved as Jpegs open up too dark on the desktop. OS is windows 7.

    Hi I have a new Laptop runnings Windows 7 Home Premium. I installed PSE10 this week. I uploaded scans of my artwork and I resized them and adjust the blue colour (by only one click/ or 1 shade of blue.) I saved the image as a Jpg - high. It opens up

  • Why is RAM preview crashing my After Effects CC 2014?

    Using Windows 7 x64 After Effects CC 2014 I'm getting numerous crashes when using the RAM Preview. Until my current project started getting more complicated all was good - no crashes. As I've added more assets to it, it's become very unstable. When I

  • Synchroniz​e with Windows Live Mail

    Hi! Newbie here and I apologize if this has already been posted.  I'm using Windows Live Mail running on Windows XP SP3 and BBDesktop Manager v6.0.  How do I configure the synch settings for mail and calendar?  When I select either of these to synch,

  • No tools in FreeHand

    I have lost my tools palette in FreeHand! I have tried the obvious chedking of Tools in the windows menu, but can't seem to! Any ideas? Not sure if I have "misplaced" it or hidden it somehow, or if I have a more serious problem. Also I can't make too