How to choose which shared variables to read

I am trying to clean up a code and I'm looking for style tips. The following code actually works as you wish, but I wonder if there is a more elegant way to do it.

I have a number of variables shared playing of Modbus devices. The problem is that these can be disabled as needed. When the unit is off, all vi to try to read that variable sharing waits a time out, then gives an error.

What I did is to put each read operation in a case structure and then have an array of Boolean to tell which ones is turned on (see screenshot). It works fine, but I wonder if there is a better way to do it?

Thank you

Mike

Replace all the tables index and case with a single loop and use 'I' connected to a case to choose which variable to read.

/Y

Tags: NI Software

Similar Questions

  • How to make a shared variable, which is an update on the host channel?

    Hi all

    I'm relatively new to LabVIEW, so I apologize in advance.  I'm working on a vision for research application and I'm trying to convey an image of the smart camera target to the host.  I flattened the IMAQ image to a string and pass the string to a shared variable.  On the end of the host, I unflatten image and try to post to see if I don't really get the image data on the host.  However, it only displays the first image and after that the image is not updated.  In addition, the shared variable itself is not up-to-date.  I have a loop timed on the target and a loop of simulation on the host.  Help or direction would be appreciated.

    Thank you very much.

    I thought about it and will post here just in case it might help someone else.  For some reason, the IMAQ flatten channel gives a format that did not like the unflatten of the chain.  When I have no flat chain, it didn't recognize it as an image.  Instead, I just used the generic flatten the string on the target and then block when I have not flattened image on the host computer, I had to only give the guy I got to report the allocation of memory IMAQ.  Maybe I'm just slow, but if this helps someone else, fine.  Thanks again.

    mkillpack

  • Are published network shared variable write & read Atomic actions

    Hello

    I have a very basic question about shered (published network) variable.

    I think I know the answer already, but since I couldn't find in my documentation, I thought that it is more prudent to request...

    Are reading and writing on a shared variable of stocks Atomic?

    To be more precise: on my target real time I create an array with data (each element being the configuration item or a cluster containing name, value, and type) and when the table is finished I am this store in a published network shared variable.

    On my host (Windows), I'm voting (in a loop) until the table contains at least 1 item, when this is true I'm parsing all the elements in the table.

    Is there a chance that, reading of the shared variable, the table contains a subset of the original painting on RT target (i.e. the action of reading takes place while writing is still ongoing).

    Or is the action of reading delayed until the write is completed? (i.e. both write and read actions are atomic even over the network)

    I think the latter is true but not could find no evidence in the documentation.

    Kind regards

    SoC

    Hello Rob,

    Yes, you can access the entire value, data type - you use both. For the table data type, the integer value is actually the full picture. So, Yes, you can see reading and writing as Atomic actions.

    But, on the other hand, you can lose data if the RT system rewrites the variable before the host had the time to read. To avoid this, you can enable buffering for the variable. See the following links for more information:

    http://www.NI.com/white-paper/4679/en

    http://zone.NI.com/reference/en-XX/help/371361H-01/lvconcepts/buffering_data/

    Finally, you can also activate a FIFO RT on your target RT if you need to send data through the variable in a deterministic section of the RT. See also, more information:

    http://zone.NI.com/reference/en-XX/help/370622H-01/lvrtconcepts/rt_projectvariable/

  • Why cant a shared variable be read as a diagram in SignalExpress

    In SignalExpress I add a step to read a shared variable. I can display it in graphical mode, but not the graphics mode. Can someone explain why this is? I'm doing something wrong?

    Kind regards

    Frank Greenslade

    Christchurch

    New Zealand

    I found that the problem was the type of data. SignalExpress discovers double graph table.

  • Shared variable problem reading after deployment

    Hello

    I tried to create an OPC client to communicate with a server KUKA. I have a project with an i/o library configuration server. When I run the project, I can perfectly read/write my variables using the Distributed System Manager. If I put all the variables, I can read the correctly updated value at the server end. However, as soon as I start a VI that contains variables (which deploys them automatically), everything stops working and I can not write them to the VI or the DSM.

    I would be very happy if anyone knows how I could handle it.

    Best,

    Glauber

    OK, so it seems that the problem was that the request from the client to the server rate was too high. I added a wait on the loop that r/w, the variables and now this works. There is no need to be a single writer, and the autodeploy option can be.

    in any case, thanks to those who responded to the message.

  • How to use the shared variables to address several Watlow controllers on the same COM port

    Hello

    I am using LabVIEW 2010 to control 4 Watlow temperature controllers on a port com 3 are model 96 and 1 is a zone EZ controller. The controller has a unique modbus address and I'm trying to read from and write in the individual records (for example, setpoint closed-loop) variable shared help. I would return the data during playback (even if the data is displayed as invalid), but I am unable to change the value in the registry in writing. How can I be sure that's the Modbus server send commands to the correct controller?

    Chuck

    Hi Chuck,

    Sorry for the delay in response, I was away last week. You can create as many servers for Modbus on one COM port that you would like, the only problem you'd see is if you tried to call the port from different locations at the same time. With respect to the documentation to cross, I'd start with the tutorial below for a comprehensive manual of Modbus. There are also quite a few listed under Datalogging and supervisory control Module help topics that may be useful if you want to solve specific issues.

    Introduction to MODBUS

    Kind regards

    Peter W.

  • How to choose which language version of Windows to use?

    In Finland Toshiba Satellite L670-128 comes with pre-installed Windows 7 Home Premium and the user must be able to choose between versions of Windows in English, Swedish, Finnish, Norwegian and Danish. However, when I started the computer for the first time, he began to make a few final installations and configurations in Swedish. She is most recent asked which language version of Windows, I like to use, so now I have Swedish Windows in my computer. It is however version of Windows I want to use, then, how can I change language of operating system?

    Hello

    As I know you can change the language in Windows 7 Ultimate or business

    http://www.webtlk.com/2009/05/29/how-to-change-language-in-Windows-7/

    http://www.mydigitallife.info/2009/05/28/change-display-language-for-Windows-7-UI-welcome-screen-system-and-new-accounts/

  • How to sort the shared Variable libraries

    I have large libraries SV in my project I want to sort by variable name.  I tried to export to Excel, sort and then import them into the library, but the type did not appear.  It looked like loading each variable then the multiple variables Editor opens with the original (unsorted) list I pressed the fact and then is back to were I started.  Any ideas?

    "In LabVIEW, you can sort variables shared libraries by right-clicking on the library" arrange by "name.

  • How to choose which drive to install to?

    No where in the registration, purchase, download or installation it allowed me to choose where I wanted my photoshop and other programs to install to. I would like a few on my SSD and the rest on my HARD drive. But they all go directly to my SSD, and I'm very picky about what is happening here against the hard drive...

    Hello

    Please see the FAQ section of this link: download and install Adobe Creative Cloud applications

    NOTE: We suggest to install the application on the primary drive however, you can configure the destination of installation of in creative cloud application preferences. Please note that there will always be shared resources stored on your primary drive.  In addition when installing temporary process files will also be created on your main drive. Creative desktop cloud application can be installed in the main drive that the place for this app can not be changed.

    If you have already installed Photoshop you have to uninstall and make the changes of the location in Creative Cloud Desktop app after that reboot the machine and now to install Photoshop Again and it should install on you new chosen location.

    • Click the parameters of wheel on the upper right window creative cloud and go to preferences to change the installation location:

    Let us know if that helps.

    Kind regards

    Bani

  • How to choose which monitor displays "Preview full screen.

    I have a dual monitor and configured bridge Setup so that the left monitor I have windows 'maps', 'filter', 'Keywords' and 'content' and on the right (which is a better monitor and callibrated) monitor, I have the 'Sample' pane

    Now if I select one or more tumbnails in the "content" on the left screen pane, they appear in the pane 'Preview' on the right screen.

    Until recently, when I've quand j' ai choisi chose a single thumbnail in the "contents" pane (left monitor) he appeared in the "Preview" pane (right monitor) and hit the space bar he showed full-screen on the same monitor right and left click on the image full screen, I got a glimpse of 100%, yet once again on the right screen.

    Now, the problem is that suddenly, hitting the space bar, the full preview screen is no longer displayed on the screen to the right, but is displayed on the left screen. (Same problem for the preview to 100%).

    I hope I made clear to myself and someone knows how can I change this back once again?

    You have your setting of the 2 screen by enlarging the window in the two screens?  Then rearrange panels to achieve results you?

    If so, save you this as a workspace?  If so, reset the workspace.

  • How to choose which folder to update

    Created a registration form updated in dreamweaver cs5, in the form that I created a dynamic list that the user selects point to be updated however rest of the form displays only the default registration data any item is selected in the drop-down list.

    How to get the data to change to point match what the user selects from the list and that point will be updated and not the default item

    kennyhp

    OK, the DW server behaviors will do that for you - you'll need this code to hand. Essentially, your page has two forms. One to submit a query whose results will be repopulate the form fields and another to send the update form. And of course your page needs additional code that evaluates which form has been submitted and takes the appropriate action. Or, you can use AJAX if you don't want the entire page to reload.

  • How to choose which site a new tab go to?

    When I open a new tab by clicking on the sign more, need me to an empty search bar that uses bing. I wish that the new tabs to take me to google.

    Here's how you can change your new tab page:

    (1) in a new tab, type or paste Subject: config in the address bar and press ENTER. Click on the button promising to be careful.

    (2) in the search above the list box, type or paste newtab and make a pause so that the list is filtered

    (3) double-click the preference browser.newtab.url and enter your favorite page:

    • (Default) page thumbnails = > subject: newtab
    • Blank tab = > subject: empty
    • Built-in Firefox homepage = > topic: welcome
    • Any other page = > full URL of the page

    Press Ctrl + t to open a new tab and check that it worked. Fixed?

    If the problems persist, some potential diagnoses and remedies:

    If Firefox will not let you change this setting: you can have what is called SearchProtect on your system. This must be removed the control panel.

    Firefox if allows you to save your changes, but he doesn't know: one of your extensions may be the substitution of her. You can consult, disable and/or remove extensions on page modules. Either:

    • CTRL + SHIFT + a
    • "3-bar" menu button (or tools) > Add-ons

    In the left column, click Extensions. Then, take a critical look on the list on the right and turn off (or remove) something unknown.

    If the modification works during your session, but during the next startup is return to the unwanted page: you could have a user.js file in your personal settings Firefox (your Firefox profile folder). This article describes how to track down and delete the file: How to fix preferences that will not save.

    A little luck?

  • My Officejet Pro 8500 for Mac 10.6.8 printer needs the driver update. How to choose which of the 3 available?

    Online response gave me 3 types of A910a for all-in-one printers, but I do not know which applies and my printer manual does not indicate. Help, please.

    Waiting4U

    You are welcome.  Good impression!

  • How to choose which servers and applications do not monitor?

    Hello. I have a bunch of applications and servers monitored by AppSpeed, but now I seem to face the 'mapping limit', which causes a few new applications do not monitor.

    Instead of throwing more CPU on the server AppSpeed I would rather to filter some applications and servers for which I do not wish to follow. Is there a good way to do it? I can't find it in the GUI.

    In the question addressed in the next version of AppSpeed, where the limit of the mapping is significantly higher and the dynamics and configured from the GUI.

    In the meantime, AppSpeed team released the scalability tool AppSpeed can increase the capacity of AppSpeed as well as allow a more efficient use of the existing capacity of AppSpeed. Please consult your SE/TAM on this toolkit.

  • How to choose which songs to import.

    After the 12.5.1.21, I can't check what songs on a cd I want to import.  It will be important only the whole cd. Any suggestions?

    Kennecter,

    Go in Edition > Preferences > general and make sure that you always "see the list boxes" activated.

Maybe you are looking for

  • Satellite Pro L300-1CZ - WLAN disappeared after reboot

    Realtek RTL8187B 802. 11b / g 54Mbps USB 2.0 disapperd after restart and material unknown adapter USB2.0 come after the reboot of Vista SP1.Today, a day after Realtek RTL8187 come back again after the reboot. I didn't work yesterday after the restart

  • Journal of faxes

    When I send a fax from my 6700 Officejet premium, the printer immediately print a fax log. It's a waste of paper and ink that I don't need. How can I disable this feature?

  • XPS M1530 customization - what is a 'Slot Load Blu - ray Disc (BD/DVD/CD read/write) "?

    Hi all! I'm looking to customize my laptop so that it can play Blu - Ray movies. Is "Slot Load Blu - Ray Disc" the thing I'm looking for?

  • I can't download the pictures

    Hi, I have a camera digital dsc Nortek 66, and I can't download the pictures on PC (win.7 ultimate 32-bit SP1) I'm trying to find an explanation, the apear of camera on the PC as a USB (mass storage), I check USB ports, the camera'software, cable...

  • SQl query to find out time between the different lines of transactions

    (See both images from an attachment to get the clear picture of the data and understand the question correctly.)I have a set of data like this in one of my paintings. (This is a simple representation of the original data.)Reference table1.jpgId