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

Similar Messages

  • 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 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

  • 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

  • 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

  • Shared Variables, Scan Engine & Multiple Targets

    I am seeking some general advice about the structure of my LabVIEW project.
    The project consists of a laptop with LabVIEW, and a joystick connected, and a CompactRIO connected via ethernet. I had been running the cRIO in FPGA Interface mode, however a change in some things caused the project to have to be shifted to scan mode.
    As of now, the code on the laptop updates shared variables on the cRIO, and reads from shared variables on the cRIO for monitoring. I want the shared variables hosted on the cRIO because it will also need to operate without the laptop connected. Before switching the cRIO to scan mode, I found that I had to first run the laptop code, and then run the cRIO code, or the shared variables would not communicate properly. Now that I have switched to scan mode, I have to run the cRIO code first, and even then the shared vars do not communicate properly for more than a few seconds, and are much laggier.
    My ideal project solution is a system that can run with or
    without the laptop connected, and obviously not having all these shared
    variable issues. I would like to autostart the code on the cRIO, and
    have the user run the laptop code if necessary, but in the past this did
    not seem to work with the shared variables.
    I am really confused about why this is happening. Hopefully I have explained my problem well enough. I don't really want to post the entire project on here, but I can email it to people if they are willing to take a look at it. Thank you for taking the time to read this.
    I am running LabVIEW 2010 SP1 with the Real-time, FPGA, DSC, and Robotics modules. I have the Feb '11 driver set and NI-RIO 3.6.0 installed and all completed updated on my RT cRIO.
    Solved!
    Go to Solution.

    I do this type of stuff all the time...
    Move all your NSV libraries to the cRIO.  From the project you must deploy to the cRIO and from then on they are persistant until you reformat.
    From your windows HMI app, you can place static NSV tags on the block diagram or use the dynamic SV API to R/W.  Also you can bind HMI controls and
    indicators directly to cRIO NSV's (This is what I do)  Also I create a 'mirror' library in the PC HMI that is bound to the cRIO library.  This library has DSC Citadel
    data logging enable and will automatically save historical traces of all my important data - very nice.  PC hosted libraries can be set to autodeploy in the app build. 
    also the project has a autodeploy option for the Development Environment which I normally turn off.  If you have PC to cRIO binding setup then you need to be cautious
    about any sort of autodeployment since it will potentially force the cRIO app to stop when you deploy.  To get around this, you can use PSP binding (IP address rather than project
    process name) and use the DSC deploy library vi's in your HMI app.  Once you are using the scan engine you can use the DSM (Distributed System Manager) app to view, proble and
    chart all of you IOV and NSV's on your network.

  • Slow update of shared variables on RT (cRIO) after building exe

    Hi,
    I've been struggling with this for the past few days.  I am having a problem with slow updating of shared variables on my RT project....but only after building the application into exe's.
    The application consists of an RT target (cRIO 9073) sampling inputs at a rate of 1sec.  I have a host PC running the front panel that updates with the new acquired values from the cRIO.  These values are communicated via shared variables.
    Once the cRIO samples the inputs, it writes the values to the shared variables, and then flags the data as 'ready to be read' using a boolean shared variable flag.  The hostPC polls this boolean shared variable and updates the indicators on the front panel accordingly.  
    Now, this worked fine during development, but as soon as I built the RT exe and host exe's, it stopped working properly and the shared variables ended up being updated very slowly, roughly 2-3sec update time.
    To give you some more background:
    I am running the Labview 2010 v10.0.
    I am deploying the shared variable library on the RT device (as the system must work even without the hostPC).  I have checked that its deploying using Distributed System Manager, as well as deploying it into the support directory on the cRIO and not the exe itself. 
    I have also disabled all firewalls and my antivirus, plus made sure that the IP's and subnets are correct and its DNS Server address is set to 0.0.0.0.
    There are 25 shared variables all in all, but over half of those are config values only used once or twice at startup.  Some are arrays, plus I dont have any buffering and none of them are configured as RT FIFO's either.
    The available memory on the cRIO is about 15MB minimum.
    What strikes me is that it works fine before building exe's and its not like the cRIO code is processor intensive, its idleing 95% of the time.

    Thats exactly what I'm saying, it takes 2-3seconds to update the values.
    I have tried taking out the polling on the PC side, and registered an event on the changing of that shared variable and that doesn't do anything to change the slow update time.  Even if I stop the PC, and just monitor the shared variables in DSM it updates slowly.
    I also tried utilising the "flush shared variables" vi to try to force the update....that does nothing.
    I wire all the error nodes religously. Still no luck.
    Its very strange, I'm not too sure whats happening here.  These things should be able to update in 10ms. 

  • Shared variables update in QuickClient but not in Variable Manager

    Greetings,
    I am using LV 8.6 Developer with the DSC module installed. Also, I'm using WinXP Service Pack 3.
    I am trying to create a VI that will interact with an OPC server connected to some equipment.
    I've created shared variables to read the value of tags in my OPC server exactly according to the instructions on this page:
    http://zone.ni.com/devzone/cda/tut/p/id/6346
    For some reason though, the value of the shared value never updates to reflect the value on the server.
    When I follow the tag on the OPC QuickClient, it updates just fine, but somehow the value of the shared variable isn't updating. 
    I also tried retreiving this data using the DataSocket method in the "Multiple OPC Items Monitor.vi" example, but running that VI crashes LabView every time. 
    Also, I can create a shared variable and write to tags using a VI, but I can't read them.  
    It seems like I'm *this* close to getting the shared variables to work. Any suggestions?

    Hi Rob,
    To answer your questions...
    DataSocket: NI doesn't give me the option to investigate the error when I restart the program. I did a search for .cpp files, but none turned up. I did collect the error report that Windows generates, and I attached it. I'm not sure if that would be something useful or not.
    SharedVariables: I went to use the Distributed System Manager to take a look at the variables. For both my shared variable as well as the tags on the I/O data source, the data type is listed as "advanced" and the quality is "unknown bad."  I collected the logs from the I/O server and attached them. Oddly, when I look through there, I see some Quality=BAD  and some VT_ILLEGAL flags. The deadband is set to zero, and the update rate is 1,000ms.
    Also, I've configured the DCOM and Local Security Policy settings as described in numerous support articles, and my Windows Firewall is turned off. The OPC server and LabView reside on the same computer. 
    I suppose the confusing thing is why the QuickClient works fine, but the SVE doesn't.  
    I've tried this on three different computers with the same results in all cases. Currently, LV and the OPC server is the only software installed on any machine. The only other OPC server I have access to is the LV server, and it seems to work okay. 
    Thanks,
    Wes
    Attachments:
    a793_appcompat.txt ‏133 KB
    screen.JPG ‏105 KB
    OPC I-O Server Diagnostic Information.txt ‏69 KB

  • Shared variables not updating in exe

    Hi,
    I've created a project with 2 vi's, they share data via Networked Shared Variables, one vi writes while the other reads.
    The data is passed between the 2 vi's whilst running in the Labview 2009 SP1 development environment, but when I create an exe, the screen values in the reader vi do not update at all.
    In the build specification I've tried both including the vi's which reference the shared variables and the
    option to list the shared variable libaries for deployment at run time, as methods to overcome the problem.
    Please, any clues why the exe should fail to allow shared variables to pass data ?
     thanks,
    Gary. 

    Hey Gary,
    I've just created a project to replicate the issue you are having and indeed when I built the application, the Shared Variables were no longer working. This is because I hadn't deployed the Shared Variables in code; which I think may be the problem that you're having at the moment. When create a Network Published Shared Variable library in LabVIEW, it auto-deploys itself for the development environment; but this is definitely not the case for when you build an executable. Instead, you must deploy the library yourself in code.
    In the attached zip folder, please follow the following instructions and hopefully you'll be able to fix your VI:
    Unzip the folder and extract the files.
    Open up the project.
    Look at the project layout. Notice the SharedVariableLibrary.lvlib and inspect the Shared_Double variable.
    Look at how the Reader.vi and the Writer.vi interact with the variable.
    Go into the Main.vi. See that I make an Open Application Reference VI and Invoke Node to manually deploy the library in code. You'll have to change the path to this library to match the directory structure of your own computer, so just make sure it navigates to the library in the extracted folder.
    Check out the Build Specifications. I've done nothing here except ensure I only include the Main VI. Finally build the VI and run the executable. 
    You should see that this will give you a working Shared Variable setup. The Machine Name input for the Open Application Reference is blank because you only want to communicate with the localhost i.e. Your computer. Therefore by explicitly deploying all libraries you require, your VIs should be able to communicate effectively.
    Does this solve your problem?
    Alex Thomas, University of Manchester School of EEE LabVIEW Ambassador (CLAD)
    Attachments:
    GlobalVariableProject Folder LabVIEW 9_0SP1.zip ‏26 KB

  • Shared variable no longer updates

    All,
    I have an RT Systems 2011 and have been using shared variables between the RT and Host. Working for months. Then I renamed a shared variable and it no longer updates. When I try to look at the variable in the NI Distributed System Manager, it reports that it does not exist.
    I changed the name back to what it was, it is seen by the System Manager but the current value is not displayed.
    I did a remote debug into the RT code and the variable is being updated.
    Any ideas\comments\etc would be appreciated?
    Thanks

    What hardware are you using as your real-time target? When you mentioned that you are using "RT Systems 2011", are you using LabVIEW 2011 and the Real-Time Module?
    After you updated the shared variable, did you re-deploy it? I highly recommend reading through the “Deployment and Hosting” section of the DeveloperZone Tutorial linked below:
    http://www.ni.com/white-paper/4679/en/#toc3
    Regards,
    Cameron F
    Applications Engineer
    National Instruments

  • Why string type shared variable takes more time to update in the client

    I am using shared variables to share the data across a master and the client PCs connected in a network. (Network published & no buffering)
     I have created an integer type shared variable(I32) and a string type shared variable (data size is 60 bytes) in the Master and subscribing to the same in the client PCs. In the master PC, I am modifying the data in this order - update the data in the string type variable and then update the data in the integer vaiable.
    But in the client PCs, due to the size difference in the variables, I am receiving the data of the integer first and after that about 3-4 sec later only I am receiving the string data. Can any optimization be done to reduce this latency period? Instead of the string data type any better data type will reduce this delay?
    Please suggst. Advnced thanks.

    Latency has a lot to do with your network.  3-4 seconds is a long time though.  This could also be due to the larget data size of your string.  The integer data size is definitaly not 60 bytes.  If you're looking for better performance, I would highly recommend looking into Datasocket communication or TCP/IP communication.  (There are shipping example for both.)
    When it comes to performance of throughput and efficiency, network-published variables are lower on the totem pole.
    I hope this helps,
    Kevin S.
    Applications Engineer
    National Instruments

  • 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

  • Datasocket read stop but shared variable can update

    Hello ,
    I program with datasocket open/read, sometimes the read stops and after some time,maybe 10s, it go on reading, I compare this with shared variable (DSC) and found
    the shared variable can update ,I don't know what happen to my program.
    ( the reason I'd like to use datasocket is that I need to change the ULR dynamically , I have many OPC tags to read ( 100 PLCs time 80 tags per PLC )  )
    thanks for your help!  
    Solved!
    Go to Solution.
    Attachments:
    shared variable VS datasocket.jpg ‏23 KB
    shared variable VS datasocket.vi ‏17 KB

    Hi~
    The read function waits for items to be updated, and 10ms is the default time for this waiting. Setting wait for updated value to false will probably solve this issue.
    PS: URLs of variables could be changed programmatically, see this document if you like.
    Good day

  • RT target slows down after updating with a shared variable

    I am using a shared variable that is defined in the RT target (cFP-2110) to transfer data from the host PC.  The shared variable is a cluster of scaling parameters that needs to be stored in the RT target.  The host PC is only connected temporarily for system setup and calibration. 
    There is only one instance of the shared variable in both the host PC vi and the target vi.  The shared variable in the host is located in an event case that is activated when there is a value change.  Everything works great until I make a value change in the shared variable.  The target vi promptly slows from 30mSec to about 500 mSec and stays that way.  The only way I can get the RT target to run full speed again is to recycle power or reset it.
    What am I doing wrong?
    Temporarily slowing down the RT target when the shared variable is updated is not a problem for this application.  The problem is that I have to restart the target to get it running at full speed again.
    I’m using Win-XP, LV 8.5.1 and FieldPoint 6.0.1 
    Thanks,
    Dave J.

    Hi Mark,
    The host is sending the shared variable via an event case.   When the event is activated, the data is sent to the target and it functions as expected, except that it slows down to a crawl. I have to restart the target to get it working up to speed again.   The are no error codes.
    The shared variable is a cluster of several items and it is attached.
    In the mean time to promote the project, I split up the cluster into smaller clusters to use several shared variables and now I do not have a slow down problem.  In other words, it works great.  As an experiment I have sent the several small clusters at one time and I get the slow-down problem again.
    I've come to the conclusion that large single cluster (which is attached) is too much to send at one time.
    Please advise if there is something else to learn or understand.
    Thanks,
    Dave J.
    Attachments:
    Host Data In.ctl ‏33 KB

  • Shared Variables Won't Update

    Hello All -
    I'm having a problem interacting with my OPC server, and I'm hoping some suggestions will help me out here.
    I have an OPC server running on a XP SP2 machine, and it is interacting properly with my equipment (a bioreactor). When I use the NI OPC Quick Client, I can browse to the tags I want to see, and those tags update as expected. I can put my hands on the temperature sensor and watch the output change on the QuickClient screen. The only odd thing that I have to do with the Quick Client is that I have to manually set the data type (Float, Single, Double, etc.) and request an asynchronous read before it will begin updating. 
    When I try to connect via Shared Variables, it's a different story. I create the shared variable using the instructions at the bottom of this page:
    http://digital.ni.com/public.nsf/allkb/EA15F53DB6FECCA5862567240064DF09
    Next, I drag the variable to my front panel and start the VI. A summary of the behavior is this:
    * As long as the variable type is read/write, the LED is green on the VI.
    * I can write values to the OPC server
    * The VI never shows data arriving from the OPC server, I can only write.
    * No error messages are received.
    This behavior doesn't change for any permutation of "read/write" status in the variable definition, switching the node from read to write, changing the control from read to write, etc.
    I'm using Labview Developer Suite 8.6 with the DCS option. Fresh install of Windows and LV. No other software on the machine.
    Any ideas how to troubleshoot this? I'm running out of ideas...
    One other update, which may or may not be related: Whenever I try to connect using a DataSocket method via one of the example VIs such as "Monitor Multiple OPC items.vi", LabView crashes immediately. 
    Message Edited by wdmarner on 10-06-2008 10:56 AM
    Message Edited by wdmarner on 10-06-2008 10:57 AM

    Hi Wdmarner,
    When you configure OPC CLient I/O Server, what server are you using? The NIOPCServers or the Varable Engine or something else? With respect to datasockets, does the system hang or does it crash and totally exit labview?
    Regards,
    National Instruments
    RIO Embedded Hardware PSE
    CompactRIO Developers Guide

Maybe you are looking for

  • Show report in different currency depending on user parameter

    hi all, i'm trying to show my report in different currency, depending on users given parameter. i hold my account balance in USD based. User should select one parameter, in which currency they want to see their account balance. (e.g. EURO, GBP ...) a

  • Automatic posting of With holding tax

    Hi While making an entry in TC-F-51 (post with clearing) by selecting transfer posting with clearing under (transaction to be processed) with posting key 31(vendor invoice) the following message appears. Withholding tax information ignored.Hence the

  • Battery replacement options

    The model in question is an original Macbook (White), circa September 2006. I'm thinking that even though the battery replacement program is over I still might be able to convince Apple otherwise. The battery holds it's charge for about an hour and a

  • Transfering docs between pages and word

    I recently purchased a macbook air to finish writing a manuscript that I had been writing in word on my macbook pro. It was automatically transferred into pages and now I can't get it back into word. Help!

  • SAP Transaction via WinGUI

    Hi, we have got the following issues with the build in SAP Transaction iView: If you create a SAP Transaction iView using the iView Wizard the WinGUI is displayed within the portal frameset. The "Create a new session" button is disabled. - Is it poss