How to update shared variables

Hi, I have a VI that opens an text file and reads some information from that page. That information should be copied to shared variables. The problem is that I have 160 shared variables and I don't want to drag them all from project explorer to Block diagram and wire them all. Is there any other way to update that data to shared variables? I can easily open and read data with couple of while loops. I'd really be thankful if someone could help me.
Mika

I do need all 160 variables. I have to make a sequencer.With cFP modules and laptop is ment to specify sequences needed for testing some equipment. I have 16 digital inputs and 16 digital outputs and 8 analog inputs. Those shared variables specify which channel is ON and for how long, and the delay of the channel. There is also variable that tells if channel is in use or not. One variable is channel factor, which tells how many cycles there will be in that cycle time. So if one channel needs only 5 variables, those 40 channels need 160-200 variables.  Shared variables are specified in the user interface and then cFP module can easily read them. In user interface there is also the possibility to open a file that have variables specified earlier. In that point I need to open a text file and update the data to shared variables.
Mika

Similar Messages

  • How to use shared variables?

    Hello..
            Can anybody please guide me in using shared variables... I'm learning LabVIEW 8.5.... But did not understand how to use shared variables... I tried to read web pages regarding shared variables but got confused.... So anyone can please help me...?
             Thanks for any help from you...

    You will have to give us the whole picture. What is your client computer; a PAC, desktop etc? What are you running on the client computer; a VI or an executable? Where are you going to deploy your library? On the host machine or the client machine?
    If I assume that you are running a VI on the client machine and are depolying the library on the host, all you have to do is to create another shared variable and bind it to the variable on the host machine. You can do this by checking the Bind to Source option when creating the variable and browsing to the network item in options. Be sure to have the library deployed on the host side before you attempt to do this otherwise you won't be able to find the variable.
    Adnan Zafar
    Certified LabVIEW Architect
    Coleman Technologies

  • How fast can shared variable update?

    Hi,
         According to online documents shared variable engine update at 10ms or forced by flushing command. But  I tested the following two program and can not get the shared variable updated:
          Thanks fo rhelp!
          Tom
    Attachments:
    test_program1.png ‏20 KB
    test_program2.png ‏20 KB

    Hi,
         I don' use NSV to transfer large amount of data between RT and host. The actual application is as follows:
          I also would like to test how fast the NSV update rate and how the flush vi works. I test two programs and did not match the number in the documents.
        Tom

  • 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 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 use shared variables with native c programs

    Hello
    What is the way to use shared variables with native c programs?
    I have a c/c++ program that uses the NIDAQmx C-API to perform measurements. Now I want to communicate to a LabVIEW program via shared variables.
    Is there a C-API for shared variables as there is for the NIDAQmx functionality? Where can I find further documentation? The document "Using the LabVIEW Shared Variable" mentions that one "can read and write to shared variables in ANSI C", but there are no hints about how and where to look.
    Thanks in Advance

    Hi user42,
    with CVI 8.0, you cannot create or configure shared variables. However, you can read or write to an already configured LabVIEW 8.x shared variable from CVI using the DataSocket API.
    In order to do this you need to have and DataSocket 4.3 or higher installed.
    Here's a forum post about using the DataSocket functions a LabVIEW Shared Variables:
    http://forums.ni.com/ni/board/message?board.id=180&message.id=24569&requireLogin=False
    With CVI 8.1 and Measurement Studio 8.1 it's possible to use Shared Variables via the Network Varaiable Library (check out the end of the "Network-Published Shared Variable" section within the "Using the LabVIEW Shared Variable" documentation and the following link).
    Datasocket with LabWindows/CVI and LabVIEW Real-Time:
    http://digital.ni.com/public.nsf/allkb/CC4343488413A2F586256E6200099638?OpenDocument
    Daniel
    NIG

  • Bound control doesn't always update shared variable (LV 8.2 + DSC)

    It seems that it is possible for a bound shared variable to NOT always get updated with the latest UI control value that it is bound to. 
    If you run the vi in the attached project, and (fairly quickly) toggle the 'Keyswitch Control' between the 'Off' and 'Start' positions, you should be able to reproduce the effect shown in the attached pdf.  Sometimes the bound shared variable (Keyswitch_Control) gets stuck in the 'On' position when the control reads 'Off' or 'Start.'  It does not catch up after a little while either; it seems truly "stuck."
    Unless I am missing something here, this looks like a bug. 
    I haven't played around with any other control types yet to test further.  I also don't know if this is limited to 'control -> SV' binding or if it also affects 'SV -> indicator' bindings (I hope not!).
    Any ideas!?!?!?
    Attachments:
    DataBindTest.zip ‏21 KB
    DataBindTest.pdf ‏40 KB

    Hello WHAVEman,
    I was able to replicate what you were observing. It seems that there is a bug in the front panel binding code. I would be filing a Corrective Action Report to let R&D know about this. Thanks for pointing it out.
    Just on the side note, if you are looking to build an application based on the application architecture as in your posted code, then I would recommend that you refer to the attached VI for a much more efficient way of doing this.
    Regards,
    Chetan K
    Application Engineering
    National Instruments
    Attachments:
    Connect Shared Varibles.vi ‏29 KB
    DataBind UI_modified.vi ‏12 KB

  • Updating "Shared Variable" Map address

    Hi Experts!
    I have a question regarding shared variables:
    At the moment I am creating a Shared variable (81O_G01) in the library and this is binded to :
    My Computer\SVCREATION.lvlib\Modbus1\410611
    Question is: How can I change this SV address (410611) when tha variable has been already opened?  is it possible?
    Thanks in advance!
    Anibal
    Solved!
    Go to Solution.

    Hey Anibaldos,
    It sounds like you are basically attempting to change the binding of a variables from <MB I/O Server>/A1 to <MB I/O Server>/A2 at runtime. I think there are a few options for this:
    1) In LabVIEW DSC you can access a hosted variable and change the binding address using a property node. If you are running the modbus server on a windows machine, this is the best option. Otherwise, I am guessing you do not have DSC. If that is the case you can still change bindings by editing the library manually, but it sounds like this will not help you out.
    2) It may be possible to open a shared variable connection using the palettes (Data Communication >> Shared Variable) to that specific address, in which case you have no need to use the bound shared variable. You can simply open a connection to two different modbus addresses and read from one or the other as needed.
    3) If #2 does not work, then I believe you can still use the datasocket API to perform such an operation. There is a little bit of research you'll need to do to use it (for example, URL formatting and UI-thread issues) but it does work. I believe this is the approach taken by this document: https://decibel.ni.com/content/docs/DOC-13508 (from experience I know you have to dig a bit to find the VIs, but they are there).
    4) You can use the library on Ni Labs: http://ni.com/labs

  • How to use shared variables to measure analog input

    Dear All,
    I am using Real time remote system. I am using PXI-6259 card, PXI-8184RT controller and PXI-1031 Chassis.
    I want to use shared variable to measure and analog Input(voltage) from
    an analog input Channel.  I tried  attaching it  with the physical
    channel using the bind to source option but it idoes not seem to work,
    can any one give me any suggestions?
    Screen shot  of this is available.
    I tried using the Acq and graph example and deployed it to the RT but
    the Sine wave I input in the measurement channel  becomes highly
    distorted when I see it in the host.vi, there is also a Screen shot of
    this also. Is there any other option.
    What am I doing wrong? all suggestion are highly welcome.
    Thank you.
    Sincerely,
    Munir Afzal Bhatti.
    Attachments:
    SV2.jpg ‏2305 KB
    SV3.jpg ‏2305 KB

    You will have to give us the whole picture. What is your client computer; a PAC, desktop etc? What are you running on the client computer; a VI or an executable? Where are you going to deploy your library? On the host machine or the client machine?
    If I assume that you are running a VI on the client machine and are depolying the library on the host, all you have to do is to create another shared variable and bind it to the variable on the host machine. You can do this by checking the Bind to Source option when creating the variable and browsing to the network item in options. Be sure to have the library deployed on the host side before you attempt to do this otherwise you won't be able to find the variable.
    Adnan Zafar
    Certified LabVIEW Architect
    Coleman Technologies

  • Is it possible to use a NI-9871 module on a C-RIO to automatically update shared variables?

    I am trying to use shared variables to poll a modbus network automatically.  I have a C-RIO 9014 and NI-9871 serial module that the modbus network is connected to.  Does anyone know if this is possible?  If so, could you post a sample configuration?  I have not been able to get it to work...   
    Thanks,
    Dan

    Hi D Reck,
    Using the 987X modules with a cRIO is much like using any other C Series module with a cRIO. It will interface with the FPGA through read/write controls or use a DMA transfer to send the serial information to the RT controller for processing. Note...you will need NI-RIO 2.4 and above depending on your version of Real Time and LabView or you will have to additionally install NI-Serial. DSC can only be run on Windows so I would guess that you would use variables coming from the FPGA or RT to DSC on a windows host machine and in the DSC module you can do ModBus Instrument I/O. Does that answer your question?
    Ipshita C.
    National Instruments
    Applications Engineer

  • How to update bind variable and restrict values in a Model Driven LOV?

    Hi Guys,
    Using JDev 11.1.1.2.0
    I've recreated an excellent Frank Nimphius article about restricting values derived from a model driven LOV (http://www.oracle.com/technetwork/developer-tools/adf/learnmore/44-restrict-lov-169186.pdf)
    But my bind variable isn't updating. Deleting the bind variable gets me the entire LOV. Activate the code below and insert a bind variable into the where clause like Frank says and I get nothing back. Bind variable is blank. Any ideas? Code wasn't supplied with the article. It seems simple enough but the bind variable isn't updating in the SQL, even though the updated value shows up here...
      public void onLovLaunch(LaunchPopupEvent launchPopupEvent)
        BindingContext bctx = BindingContext.getCurrent();
        BindingContainer bindings = bctx.getCurrentBindingsEntry();
        FacesCtrlLOVBinding lov = (FacesCtrlLOVBinding)bindings.get("DepartmentId");
        lov.getListIterBinding().getViewObject().setNamedWhereClauseParam("deptId","60");
        System.out.println("lov name: " + lov.getName().toString());
        System.out.println("lov Param Attrs: " + lov.getListIterBinding().getViewObject().getNamedWhereClauseParams().getAttribute("deptId").toString());
        System.out.println("lov View Object: " + lov.getListIterBinding().getViewObject().getName().toString());
        System.out.println("lov IterBinding: " + lov.getListIterBinding().getName().toString());
       }Gets me ...
    lov name: DepartmentId
    lov Param Attrs: 60
    lov View Object: _LOCAL_VIEW_USAGE_lov_model_queries_EmployeesView_DepartmentsView
    lov IterBinding: DepartmentIdList_2

    That's a good idea, but it's still not working. Here is how I implemented it. It might be different from your suggestion as I'm still pretty new to this.
    I have a recursive tree table. You select a node. You then click a button which calls the listener below. "findParents" is a method call to the AppModuleImpl class and it finds all parent nodes of your selection. "restrictPartBomLOV", also of the AppModuleImpl class, then modifies the model driven lists' View Object (partBomLOV) to exclude those parent node values.
    The resulting model driven LOV on the popup should be updated, yeah? But it still isn't udpating. If I manually type in the updated Where clause in PartBomLOV.xml query tab, it works, but it doesn't programmatically.
      public void insertPopupFetchListener(PopupFetchEvent popupFetchEvent)
        BindingContainer bindings = getBindings();
        OperationBinding operationBinding = bindings.getOperationBinding("findParents");
        parents = (List)operationBinding.execute();
        operationBinding = bindings.getOperationBinding("restrictPartBomLOV");
        operationBinding.execute();
       public void restrictPartBomLOV(List parents)
          ViewObjectImpl vo = getPartBomLOV();
          String wcl = "";
          Object[]   p = parents.toArray();
          for(int i = 0; i < p.length; i++)
             if (i == 0)
                wcl = wcl + "PNUM <> '" + p.toString() + "'";
    else
    wcl = wcl + "AND PNUM <> '" + p[i].toString() + "'";
    vo.setWhereClause(wcl);
    System.out.println(vo.getWhereClause().toString());
    vo.executeQuery();
    Edited by: LovettWB on Nov 11, 2010 11:23 PM

  • How to deploy Shared Variables with aliases (Project Variable), when some machines are offline?

    Hi all,
    I have a distributed application (PC + a few CompactRIOs). My PC contains variables that have aliasing enabled -- they are bound to variables on the cRIOs.
    One of the cRIOs is currently offline. I'm trying to deploy some changes I've made on the PC side. Unfortunately, LabVIEW refuses to deploy my PC libraries, because it can't connect to the cRIO that the variables are bound to.
    How can I bypass that check, and force my PC to update? (I don't see why it's compulsory for the cRIO to be online for this :-/)
    Thanks in advance!
    Solved!
    Go to Solution.

    Thanks for responding, Esteban!
    To answer your questions:
    No error codes. The deployment dialog just says, "Failed to connect to Real-Time target". That's expected, because the cRIO is not connected to the network.
    I'm binding simple numeric types only.
    The cRIO has been taken offline for maintenance. I'd like to update my PC .lvlib files, and test some modified PC code, but I can't because LabVIEW won't let me deploy my PC libraries or run the VIs if it can't find the cRIO. (Here's another common use case: I'm developing software before I've received my hardware, and would like to test my VIs without a cRIO connected)
    I've attached a minimal example (LV 2012 SP1). I have a VI on the PC that plots data from the cRIO, and processes local data. I'm trying to run the PC VI when the cRIO is offline.
    Expected outcome: The VI should run, and "PC Output" should change according to "PC Input". "cRIO Output" should have a default value, and the PSP LED should be red -- mousing over the LED should say "Bad Quality".
    Actual outcome: LabVIEW refuses to run the VI completely, saying "Failed to connect to Real-Time target".
    Attachments:
    Project Vars.zip ‏10 KB

  • How to update the variables in sub-vi on main front panel?

    hi~
    The problem is to display variables in Sub vi on main front panel.
    What should I do?메시지가 04-07-2005 03:14 AM에 julitan에 의해 편집되었음
    Attachments:
    main_.vi ‏14 KB

    You probably want the slide to update while the while loop in the subVI is running, so you can't simply wire an output from the subVI to the main VI. So you are going to have to use some form of communication between the two VI's other than a hard wire. For this simple case I think I would recommend using a global variable. You could also use DataSocket or even write the value to disk, but using a global is probably the easiest method for this case. I've attached your modified VI's. Let me know if this works for you.
    Robert Mortensen
    Software Engineer
    National Instruments
    Attachments:
    global.zip ‏45 KB

  • How to Update Substitution Variable

    Hi All,
    we are using Essbase 9.3.1.2. i am trying to create substitution variable using essbase console and i am getting an error as 1051082: substitution variable currmonth already exists however i have deleted all my substitution variables before creating them. When i checked in the backend using maxl i am able to see that the new substitution variable is created (*Currmonth*) however in console when i right click on the server --> edit -> variables i am not able see that variable that i have created.
    Can anyone of you help me out...
    regards,
    Naveen.
    Edited by: user12209997 on Sep 13, 2010 11:29 AM

    Are you sure you're not creating the substitution variable at say, the database level, but are then looking at the application or server level? Or the reverse?
    What do you get in MaxL when you type:
    display variable all ;
    If you set a variable, can you use it in an Essbase retrieve through the Excel add-in? If yes, I'd say the variable really exists and it's EAS that is wrong. There's always the restart of the EAS service to try.
    Regards,
    Cameron Lackpour

  • How to find Shared Variable Processes on RT target

    It seems like it should be possible to query the SV Engine on a RT target for a list of all processes running and also the SV's within those processes.
    The DSM (Distributed System manager) can do it, why can't I?

    Also, you might also want to check out this  KnowledgeBase.
    Regards,
    Claire Reid
    National Instruments

Maybe you are looking for

  • ID3 tags - I can't be the only one

    iTunes 7.7.0.43, fully patched XP Pro SP3. "M:" drive on file server contains 4500 songs. Full read/write access. ID3 tags simply do not work in iTunes. I have "Convert ID3 Tags..."'d to "None" dozens of times for the whole library and have attempted

  • Is there a way to send audio from my mac to my iphone that i plug into a speaker dock?

    HI, I would like to watch a movie on my MacBook Air but would like to send the audio to my iphone to plug into my speakers so i can have a sort of surround sound system? help me please. thanks, spenserfromle mars

  • Need help in storing XML data in SQL server using EJB

    Hi all... i have one XML file and i need to store the data of XML in one of the table of SQL server ..i want to do this using EJB.. like this Example : Data i XML : ======== <Employee> <Details> <empid> 101 </empid> <name> Ajitha </name> </Details> <

  • NetBeans package not found

    Hello, I�m using NetBeans to develop a J2ME midlet. I want to use the MMAPI. When I try to import the corresponding package using "import javax.microedition.media.*;" Netbeans tells me that this package does not exist. But when I compile the project

  • COGS IS COST ELEMETN OR  NOT

    hi i have read all the previous forum on cogs is cost element or not i did not got a clarity. in MTS COGS is should be not  a cost element if GBB vax in MTO COGS is should be a cost element if  GBB VAY. but what in case if we have both scenario MTO O