Read LabVIEW shared variables ( network variables?) with VB6

Hi, i need to read some LabVIEW shared variables (network variables?) using a VB6 program.
Is it possible?
I think that yes, using Measurement Studio for VB6 but I don't know how and I haven't found information in the  Measurement Studio for VB6 help file
Could some one send me a program example or explain me how it is possible to read LabVIEW shared variables fromVB6?

Hello quintella,
To be able to interface with LabVIEW
Shared Variables with Visual Basic 6 you will need to use NI Measurement
Studio, which ships with examples on how to use VB6 with DataSocketing. Apart
from Data Sockets, if you are using Measurement Studio 8.1 or higer, with the
Network Variable Library introducted in NI Measurement Studio 8.1, you can read
and write to shared variables in ANSI C, Visual Basic .NET or Visual C#. (http://zone.ni.com/devzone/cda/tut/p/id/4679)
Here you have two links where you can
find more information about how to use the datasocket option. In addition, there
are several examples included in Measurement Studio with Network Variables and
Datasocket.
http://forums.ni.com/ni/board/message?board.id=230&message.id=2945&requireLogin=False
http://forums.ni.com/ni/board/message?board.id=230&message.id=3324&requireLogin=False
Regards,

Similar Messages

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

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

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

  • 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

  • Labview Shared Variable configuration

    I need some help with my labview shared variable configuration.
    In my setup I have a PC running with my lvlib on it.  This PC is NOT my development PC.  The application deploys the lvlib.  My program is I can't see those variables on my PXI RT Controller.  I have the shared variable engine installed on the PC.  But I can NOT add my realtime system to it.  When I enter in the IP address it just doesn't add it or give me an error msg or anything.  Anyone have any idea what's going on?

    Hi Zorro,
    I need a little clarification of the particular situation.
    1) You said this is not your development machine.  What software do you have on your development machine?  Did you make an installer, and install it onto the host?
    2)  Which PXI RT controller and chassis do you use?
    3)  Do you have Measurement and Automation Explorer on your host?  And can you see your controller there?  Can you ping the device?
    Brian K.

  • Labview shared variable

    Can any body help me in reading analogue shared variable read in LabVIEW 2009 dynamic event structure. I have tried to read the above tag through Tag Reader VI but i have experienced too much delay in first read for real data i.e. Plant data from PLC. when this particular VI executes it take minutes to display the data. if some needs its code i can provide it. Thanks in advance

    First one is On value Change Event Structure
    and Second one is Through Read Tag
    Attachments:
    On value change event.vi ‏24 KB
    Read Tag.vi ‏20 KB
    On value change event2.vi ‏22 KB

  • I/O direction of LabView shared variable?

    Can I programmatically change the I/O direction of a LabView shared variable?  I'm using LV 2010 and I'm trying to change the I/O direction of a NI 9403 module programmatically.  Is this possible? 

    Hi JAF,
    I'm assuming your intended purpose is to input and output data through the same DIO line.  
    In that case, I would recommend using a case structure. You would need to create a case for input data and another case for the output.
    Below is a link describing the characteristics of a case structure.
    http://zone.ni.com/reference/en-XX/help/371361G-01/glang/case_structure/
    I hope this helps. BTW, are you using a cRIO? I'm just curious.
    Regards,
    Josh L.
    Applications Engineer
    National Instruments

  • How can I use an Access front end and Access button to control a LabView Shared variable boolean?

    My company has invested a lot of money on the office network to write many many access databases and front ends. I'm looking for a way to tie a button on an access front end to toggle a LabView boolean shared variable to notify me when they changed something on their side of the network. I'm not seeing anything that helps on a web or forum search. They don't like the idea of a separate labview control that they have to push a button on to let me know.
    Thanks
    Solved!
    Go to Solution.

    Hi Patrick,
    While this is not the intended purpose of Network-Published Shared Variables, you might be able to accomplish this by writing separate accessor VIs for reading from and writing to the variable, making sure to wire the inputs and outputs. Then, you could build a DLL, making sure that you include the accessor VIs as Exported VIs and include the DLL Library in the Always Included section of the DLL Build Specifications. During this process, you will define the function prototype, which will provide the function call, required parameters, and return values. Once the DLL is created, you can then call it and its functions from another programming language (C, C++, C#, VB, etc.). This may or may not work, but it is the only way that I can think of at this point. I have included some references that may help you in this process.
    Building a Shared Library in LabVIEW (White Paper)
    Calling LabVIEW VIs from Other Programming Languages (White Paper)
    Calling LabVIEW DLL From C# (Forum with Examples)
    I hope this helps.
    Regards,
    Mike Watts
    Product Marketing - Modular Instruments

  • Error Reading a Shared Variable Array

    Hi,
    I am having a problem reading an array of 20 unsigned integers from an Allen Bradley ControlLogix PLC with Labview.
    I have set up a shared variable for this purpose.  I have set the Data Type of the shared variable to ArrayOf Unit16.  The Variable Type is Network-Published, and I have check the Bind To Source checkbox.  I think my problem is in the shared variable path.  I have tried the following with no success:
    MyComputer\ControlLogixTags.lvlib\RsLinx\ProjectX\Online\Faults\Faults
    MyComputer\ControlLogixTags.lvlib\RsLinx\ProjectX\Online\Faults\Faults[0]
    MyComputer\ControlLogixTags.lvlib\RsLinx\ProjectX\Online\Faults\Faults[]
    MyComputer\ControlLogixTags.lvlib\RsLinx\ProjectX\Online\Faults\
    MyComputer\ControlLogixTags.lvlib\RsLinx\ProjectX\Online\Faults
    I have created a simple vi for testing.  I have wired the shared variable to an indicator which is an array of UInt16 items.  When I run the vi, I get an error which says "Error 91 occurred at Variant to Data in Text.vi.  Possbile Reason:  The data type of the variant is not compatible with the data type of the input."
    Does anyone have a suggestion as to what I am doing wrong?
    Thanks in advance for your help,
    Phil

    Phil,
    In order to determine that you can correctly communicate with your OPC server, I would suggest creating a shared variable bound to a single tag. It sounds as if you already have an RSLinx I/O Server in your project library. Now you can create a new shared variable and use the browse option to browse the items of your I/O server. Be sure to select a tag that has a known value such that you can verify successful communication.
    Also, does your VI utilize a dynamic data conversion? The error code mentioned (error 91) is normally associated with this data type. Our next step will be to look at this VI once we can establish successful communication. I hope this was useful for you. Please let me know if I can be of further assistance.
    Mike
    National Instruments
    Applications Engineer

  • Slow performanc​e to read/write shared variables programati​cally

    We are using datasocket read and write functions to read and write shared variables programatically (in the same machine) but we only achieve a performance of aprox. 200 reads/writes per second. We are using Labview 8.6 with DSC.
    Is possible to get better results? That performance is normal?
    Any help would be appreciated. Thank you in advance.

    Hi MMCDAT,
    I think this value can
    be normal as you can see in this link:
    http://zone.ni.com/devzone/cda/tut/p/id/5037
    As you can see, the
    limit for datasocket depends on your Ethernet limitations, even if you as using
    it just in one PC:
    http://digital.ni.com/public.nsf/websearch/6AC9E65​734E53F9A8625672400637ECC?OpenDocument
    You can improve the
    performance changing the update mode or Vis configurations:
    http://digital.ni.com/public.nsf/allkb/F8F7DE98856​B50588625672400648045?OpenDocument
    http://digital.ni.com/public.nsf/allkb/2D9C6D73A16​0537986256B290076456E?OpenDocument

  • Use shared variables with FPGA device on Host PC

    Hi all I am having a frustrating problem. I am trying to use shared
    variables linked to a cRIO 9012. The shared variables were created and
    then written to in a RT vi. is there any way I can assign locations to
    these not within a RT vi. I altimately need to run the Host vi on a
    TPC-2512 touch panel computer and I can't run a RT application on that. I
    just need the variables to update without the RT vi running and I can't
    figure out how to do that, if its even possible. Here is what I have so
    far. Thank you in advance for your help.
    Attachments:
    PumpMonitoringDevice.zip ‏2083 KB

    Adam:
    You may be able to use arrays to speed up your program, but bear in mind that the TPC is pretty much guaranteed to be slower than your computer (as it's likely to have lower system specs).
    You'll want to use the array manipulation functions to combine and retrieve your data (most useful will likely be "Build Array" and "Index Array," see context/LabVIEW help for more details). Once you have the data in an array, you can likely pass it through a shared variable configured for an array datatype.
    I'm not sure if/how much of a speed boost it will give you, but I think it's definitely worth trying. If you're not sure about the speed, try simply cutting your variable count in half and see what kind of speed increase you get with the same amount of code but fewer variable values being transmitted through your network connection.
    Good luck!
    Caleb Harris
    National Instruments | Mechanical Engineer | http://www.ni.com/support

  • VBAI: how do I read a shared variable?

    I am trying to make my inspection to do things that are contingent on the value of Shared Variables. It is obvious how to set the Shared variables from VBAI, but I have not figured out how to read them and then create some kind of a CASE structure using that variable.
    Any ideas on how to implement such an architecture?
    Solved!
    Go to Solution.

    I would create two different states and use transitions that are based on the shared variable value. You can read the value of variables or previous measurements in steps that allow this (not all steps do, but most do) or transitions. To create a new state, go to the state diagram (click on the "Toggle Main Window View" so the state diagram is in the main part of the window). Right click in an empty part of the state diagram and select "Create New State".
    To create a transition, right click on a state and select "Create New Transition" and drag the transition to the new state.
    To edit the transition, double click on it and you will be able to select the shared variable as the measurement, along with comparison operations to make the decision. If this comparison evaluates to False, the Default transition will be taken instead.
    Select Help>>Show Context Help while editing the state diagram to get more details on how to use it.
    Hope this helps,
    Brad

  • Blink while alarm on using shared variables with remote panel

    I am creating an application where I have front panel indicators data bound to shared variables.  I also set it up to have them blink when the alarm is on.  I am using the DSC module.
    This works great under the development environment.  But when I connect using the remote panel, I can no longer see the blinking indicator if there is an alarm.  I can see the blinking indicator on the machine that is running the program, but no on any of the remote panels (I have no problems connecting to the remote panel and controlling the program).
    I have the remote panel set as embedded, since I want the user to be able to change some settings over the network.
    I am sure I am missing something simple, any ideas??
    thanks
    Kenny

    I have been using IE6 and Firefox, and I have found that the blinking does show up, if you refresh the page.  And then if the alarm stops and the blinking stops, you will not notice it until you refresh again.
    Kenny

  • Error -195067903​5 When Using the LabVIEW Shared Variable

    While communication of PLC & labview 2014 SP1 via modbus ethernet I am getting continuously Error -1950679035 as per attachment.
    Also distribution manager system is not responding while expanding of shared variable library. And it is not showing list of variable.
    Please share some solution.
    Attachments:
    error.png ‏263 KB

    If the Distributed System Manager isn't running, then something is seriously wrong!  Has it ever worked?  Have you ever had a successful deployment of Shared Variables?  Have you recently installed a new version or updated LabVIEW?  These questions are designed to see if something "broke", or possibly never worked in the first place ...
    Bob Schor

  • Sharing a network connection with an Ipad2

    I have a windows desktop connected to a network. I'd like to share the network connection with my Ipad while it is connected via the USB cable to the desktop. Is this possible? How?
    Thanks,
    Shaun

    Well duh - no. I misread the question. I share the Internet connection from my iMac which is connected to the Internet via Ethernet cable to the modem.
    The iPad shares my iMac's Internet connection through internet sharing. The iPad is not connected to my Mac with the USB cable. Brain clot! But is it not possible to share the connection via Internet sharing in the Windows world?
    Sorry to the OP!

  • Creating a LabVIEW Shared DLL for use with C# and Strings?

    Hi All,
    I am trying to create a prototype for a LabVIEW Shared DLL that all the VI does is take in a string and return an upper cased string. Needless to say the DLL builds fine but when I try calling the shared DLL from C# the .NET application recieves an exception about "Ansi char arrays can not be marshaled as byref or as an unmanaged-to-managed parameter". Does anyone have an example of how to pass a string to a VI and return a string or an example of a better way of accomplishing this.
    We are using labVIEW 7.1 on Windows 2000.
    I am in quite a bit of a hurry to prove that this type of a LabVIEW Shared DLL VI would work. The eventual system will be passing in a string of XML with a large amount of
    data and returning XML.
    Thanks in advance,
    Jim

    Hello jprucha,
    This occurs because LabVIEW DLLs are not considered managed code. As such, we need to define the C# function as unsafe to be able to call unmanaged DLLs.
    You can find more information about C# and managed code at Microsoft's developer website linked below.
    MSDN Home Page
    Good luck with the development,
    Matt F
    Keep up to date on the latest PXI news at twitter.com/pxi

Maybe you are looking for

  • Find in Bridge

    Hi All: Im having a problem with the find command in Bridge. Basically it cant seem to find anything. It cant even find a file in a folder that Im looking at with Bridge. No mater what search criteria I select Bridge reports that there is nothing to

  • MBP Retina display setting to make Photoshop less pixelated?

    I just purchased a MBP Retina and I've noticed (as many have, I've gathered) that Adobe CS6 programs appear pixelated on the new retina display. I realize that not all apps are upgraded for the retina display, but I was wondering if there is a displa

  • Built in isight camera and skype: crashing systmatically (iMac G5)

    Hi, I have problesm using skype video with the built-in camera on my iMac G5. Everytime i start the video or open the video preferences to select the video source, skype crashes. Has anyone epxerienced the same. If you have some tips, i'm in! thanks

  • Acrobat reader on Intel mac

    Every time I install adobe acrobat reader on my new intel mac it does not launch. the wheel just keeps spinning. Ihave uninstalled and reinstalled it several times. I have tiger. Sachin

  • Using Typekit fonts in print projects

    I have just started using a Typekit font for my demonstrations. However, I am interested in using it for my next book but I have questions. Are the Typekit fonts suitable for print production? They are listed as OpenType. Is that ordinary OpenType? T