How to use CWPictureDisp of Measurement Studio in VB ?

Is there an example of using the CWPictureDisp object
of ComponentWorks/Measurement Studio in Visual Basic?
I am developing a display for a system that will track
an underwater vehicle and I would like to show a
vehicle shaped icon that would move around on an XY
plot.
The only help information for CWPictureDisp I could
find just says it manipulates images within controls.
But I can find no examples or detailed description
of how to use it.
I would greatly appreciate if someone could provide
more detailed information on the CWPictureDisp
or tell me where to look for the information?
Thanks.

The easiest way to do this is using the new Annotations feature in the 2D Graph. An annotation object in the graph consists of a shape, an arrow, and some text. In your case, you want to hide the arrow and the text and use an image for the shape.
Here is how you can play around with this idea.
1. Right-click on the 2D Graph and select Properties.
2. On the Annotations property page, click Add to add a new annotation. If you like, you can rename the annotation to 'vehicle.' This would be useful when programmatically accessing the annotation.
3. On the Style sub-page, click on the Picture icon. This is a shortcut method of setting several styles on the annotation for an image only.
4. On the Coordinates sub-page, choose Plot-1 (or whatever the name of your pl
ot is) for Plot and Point On Selected Plot for Snap Mode. This tells the shape to snap to a specific point on a specific plot.
5. On the Images (top-level) property page, select the name of your annotation in the list, click the button to the right of File or URL, and select Load. Find the image of the vehicle you want to use.
During run-time:
6. Programatically change the PointIndex property on the annotation object to move the shape's position on the plot.
Remember to use the ?-help feature on the property pages to see example VB code that uses the properties.
I hope this helps,
David

Similar Messages

  • Using graphs in measurement studio

    I have written in multiple languages, and this �easy� �user friendly� software package has left me completely stumped. How on earth do you put data in to a graph and display it????? Can someone please show me code examples of firstly how to shove an entire array of numbers into a graph in VB.net using the new Measurement Studio and secondly how I could update a graph plot with a next acquired sample. Please help

    "Where would I find "Creating Measurement Studio Strip Charts, Scope Charts, and Graphs" document. if it is on the website it is extremeley well hidden even from its own search engine. Does this specifically talk about VB .NET and measurement studio"
    You can find this topic, as well as several other conceptual topics about the Measurement Studio .NET features with VB.NET/C#, in the Measurement Studio help that installs with Measurement Studio. You can find this help in two ways:
    Integrated into VS.ET 2003/MSDN Help - Go to the table of contents, then the "NI Measurement Studio Help" node.
    Measurement Studio standalone help - Go to the Start Menu, then Programs->National Instruments->Measurement Studio 7.1 for VS.NET 2003->Measurement Studio Documentation
    Once you're in the table of contents, you can find the topic above by navigating to:
    - NI Measurement Studio Help
    - NI Measurement Studio .NET Class Library
    - Using the Measurement Studio .NET Class Libraries
    - Using the Measurement Studio Windows Forms .NET Controls
    - Using the Measurement Studio Graph .NET Controls
    The topic above is the second link in the list. If you have Measurement Studio 7.1 installed, this link will take you directly there.
    "Using Measurement Studio ActiveX controls I wouldn't even know where to start, there is no AxCWGraph on any toolbar."
    AxCWGraph is the name of the interop wrapper that is automatically generated by VS.NET when you add CWGraph to your project, so you won't see it in the toolbox. WaveformGraph/ScatterGraph is what you should use in .NET applications if you have Measurement Studio 7.0 or higher. I only mentioned CWGraph because this was posted to the Measurement Studio for Visual Basic forum instead of the Measurement Studio for Visual Studio .NET forum, so it wasn't clear if you were using the Measurement Studio .NET controls or the Measurement Studio ActiveX controls.
    "If NI could just stick an example of exactly how to use VB.NET with measurement studio on displaying data and the various options available and stick it for all to see on the measurement studio home page it would be great."
    There are several examples that are installed with Measurement Studio 7.1. If you installed Measurement Studio to the default location, you can find this examples at:
    Program Files
    National Instruments
    MeasurementStudioVS2003
    DotNET
    Examples
    UI
    Graph
    "I write in over ten different languages and scripts and fluent in two of them. It worries me that I can't even find the front door let alone open it."
    I can understand how this could difficult if you were not aware of the Measurement Studio help and examples. Is it easier now that you know about this content that installed with Measurement Studio? If not, what else do you feel is missing?
    - Elton

  • Why can't visual basic 6 load CWDAQ.OCX in the example programs? I am using the latest Measurement Studio 6 and VISTA OS.

    Can someone help me with getting controls to work with Visual basic 6 in an Vista environment?  I cannot get the examples to work that use the CWDAQ.OCX control.  I did a search on my computer and the file is not even there.  What functions are in CWDAQ.OCX?  Is there a descriptions of what functions are included in this control and other controls?  It is not obvious where to find these descriptions. 
    I did install Measurement Studio 6 with all the options for Visual basic 6.
    I am new to programming NI cards with visual basic so any help in getting me started will be greatly appreciated. 
    I need to talk to a PCI-6110 card in visual basic 6.  I would like to preprogrammed the D/A fifos, store to two analog inputs simutaneously, and use some of the digital I/O.  Can someone direct me the direction as to what controls I need to use?
    Thanks in advance for any help or guidance. 
    Tony

    Hi Tony,
    So the reason you can't find the CWDAQ.OCX ActiveX controls in VB 6.0 in Vista is because that is a Tradtional DAQ (legacy) control meant to work with the Traditional DAQ Driver.
    The Tradtional DAQ drivers aren't officially supported in Windows Vista (KnowledgeBase 4FDH4MZN: Traditional NI-DAQ (Legacy) for Windows Vista OS) and so the CWDAQ.OCX controls don't get installed.
    However, the good news is that the PCI 6110 is a newer card that uses our newer driver, NI-DAQmx. DAQmx is supported in Vista and you can communicate to your card from VB 6.0 using DAQmx in Vista.
    There are several examples that show you how to communicate using DAQmx in VB 6.0.
    These can be found in:
    <Users>\Public\Documents\National Instruments\NI-DAQ\Examples
    This is also mentioned in the following Knowledgebase article:
    KnowledgeBase 47CCSQ5B: NI-DAQmx, NI-VISA and NI-488.2 .NET Example Locations
    Also, the DAQmx functions are documented in the following locations:
    Start»Programs»National Instruments»NI-DAQ»NI-DAQmx C API Visual Basic 6.0 Help
    Start»Programs»National Instruments»NI-DAQ»NI-DAQmx C Reference Help
    Hope this helps!!
    Message Edited by Jervin_J on 06-05-2008 02:58 PM
    Jervin Justin
    NI TestStand Product Manager

  • How to use labView to measure temperature using a thermistor

    I'm trying to create a labView that will give a temperature reading based on a circuit using a thermistor. Any ideas on the VI or how to construct the circuit would be helpful!

    Well, you need to generate a voltage. You also need a way to read that voltage. Do you have a meter, or a DAQ device?
    Temperature Measurements with Thermistors: How-To Guide
    As for other circuits, the internet is a good place to search. Have you tried? Here's a couple of places:
    http://www.discovercircuits.com/T/therm.htm
    http://www.facstaff.bucknell.edu/mastascu/elessonsHTML/Sensors/TempR.html
    http://www.ecircuitcenter.com/Circuits/therm_ckt1/therm_ckt1.htm

  • How to use WD My Book Studio with iPhoto?

    I have a MacBook Pro running OSX 10.6.8.  I'm out of hard disk space so I purchased a 3 Terabyte Western Digital My Book Studio, connected to MacBook via Firewire 800.  I intend to move all my photos to the WD drive and delete them from the MacBook.  How do I do so and preserve the file structure on as it appears in iPhoto?  Is this possible?  The last thing I want is thousands of photos on the WD drive with no clue which "event" they belong to.
    Secondly, my MacBook Pro is backed up continuously to a Time Capsule via Time Machine.  How do I set things up so that the WD My Book Studio is backed up as well?

    Thanks.  That sounds easy but ... I tested by dragging 1 event w/ 16 photos over to the My Book Studio.  Then deleted the event from iPhoto on the MacBook.  Opened iPhoto with option as you said but can't select the My Book Studio as an option.  When I try I just the the photos listed out individually, not a library. 
    I'm guessing this is because I copied the photos but not the whole library?  What's the best way to do that, from the username folder drag the whole thing?

  • How to use NIDAQmx to measure voltage, resistance and thermocoup​les

    I'm new to using NIDAQmx. I was looking for examples to measure multiple functions like voltage, resistance and thermocouple in the continuous mode at the same time.
    ben

    In order to do that you would need to build multiple Create Voltage Channel VIs into the same string. Attached is an image of what this would look like.
    Otis
    Training and Certification
    Product Support Engineer
    National Instruments
    Attachments:
    675977 - Multiple AI Tasks.JPG ‏21 KB

  • How to use peak detection in labview to detect peaks from data acquisition information

    Hi
    I am a university engineering student who is working in a team to develop a coin detector, its purpose is to recognize different coinage and detect fakes.
    For this we are using LabVIEW 8.5.1. I am relatively new to labview and have had no experience of using to before. We are trying to integrate four voltage signals produced by an electromagnet, straingauge, optical sensor and a proximity sensor. We have already developed signal conditioning for these tests and now wish to put them into labview.
    Our plan is to use peak detection on each of the tests so that labview can detect peaks which correspond to different coin types, provided they meet set criteria for each coin. Then to combine these either using logic or mathscript to produce a Boolean output for each coin.
    One of our advisors helped us develop a peak detection program for a simple simulated sine wave however we are struggling to adapt this for data acquisition information and itegrate it with mathscript and to be honest it does not make much sense. I have attached the program below. Thanks in advance for your assistance. 
    Attachments:
    Strain 2.vi ‏25 KB

    Chris,
    Here are several ways to help  you get started with peak detection:
    1. On your functions palette, you can search for "peak detect" and you'll find several different variations of VIs that will do peak detection.
    2. You may also want to take a look at this tutorial: Peak Detection Using LabVIEW and Measurement Studio
    3. There's an example in the example finder called "Peak detection and display" that will probably be useful. 
    Hope this helps, 
    Misha

  • How To Use PlotXvsY

    Hi, I am new to AxCWGraph for measurement studios. I am using Measurement Studios 7.0 for VC++.
    I want to use the method PlotXvsY. I currently have a 1D array of floats which contains all the x/y values respectively. I want to plot them in a graph. I checked the prototype for the method, and it wants type objects__gc*. Therefore just typing
    mygraph.plotXvsY(array[x], array[x+1]) just doesn't work.
    I looked at all the examples online, and it seems people are using CNiVectors to be passed into the method. I am even more confused because I never used CNiVector class before. Can someone help me point to the right direction on what I should pass in?
    Thank you very much for your time!
    -Mike

    The examples that you are looking at are for the Measurement Studio C++ interfaces, which are MFC-based classes that are intended to be used from unmanaged C++ applications.  The Measurement Studio C++ UI classes are custom C++ interfaces to ActiveX controls and use native Measurement Studio C++ data types, such as CNiVector.  If you are creating a .NET Windows Forms project, you must use .NET Windows Forms controls on the form.  You cannot use the Measurement Studio C++ UI classes on a .NET Windows Forms form.  The AxCWGraph class that you are using is a .NET interop wrapper around the CWGraph ActiveX control.  There are no C++ examples that demonstrate using the ActiveX control in this manner.
    The interop wrapper approach will work, but I suggest using the controls that are native to the type of application that you are writing.  This means that if you're writing an unmanaged C++ application with MFC, use the CNiGraph class, and if you are writing a .NET Windows Forms application, use the native Measurement Studio .NET Windows Forms graphs, which are called WaveformGraph and ScatterGraph.  These graphs accept .NET data types and will be much easier to use from a .NET application.
    - Elton

  • How to save the value in Cedit control into a text file bu using measurement studio c++?

    Im using measurement studio c++ to create a application. How to save a randomly generated value which display in the CNumberEdit Control to a text file? how to do the coding part?

    You can use the CNiFile class to write the value out to a file. For example, create a new Measurement Studio C++ project and follow these steps:
    Add a CNiNumEdit to the dialog.
    Add a member variable for the CNiNumEdit called m_numEdit.
    Add a button to the dialog.
    Double-click the button to add a message handler for the button's BN_CLICKED message.
    Add the following code to the button's BN_CLICKED message handler:
    CNiFile file("C:\\Values.log", CFile::modeCreate | CFile::modeWrite | CFile::typeText);
    file << m_numEdit.Value << endl;
    file.Close();
    Run the application, edit the CNiNumEdit's value, and click the button. The value should be written to the Values.log
    file as specified in the code above.
    Hope this helps.
    - Elton

  • How to use Measurement studio math lib in VC6

    dear sir,
        I get the evolution version of measurement studio, which works well in DotNet and I confront with the problem that i do not know how to use measurement studio math library in VC6, please help me out ?

    All versions of Measurement Studio released to date include support for Visual C++ 6.0 (and Visual Basic 6.0).
    This support is on a separate CD from the support for Visual Studio 2003 and Visual Studio 2005.
    For example, the Measurement Studio 8.0.1 kit includes 5 CDs. One CD includes support for Visual Studio 2003 and 2005. Another CD includes support for Visual Studio 6. The other 3 CDs are Device Driver CDs.
    You want to use the CD that includes support for Visual Studio 6.0. This CD contains 2 installers. First run Setup.exe. Then run MeasurementStudio6Updater.exe to get the latest components. See UpdaterReadme.htm for information on what components are updated by MeasurementStudio6Updater.exe.

  • How to measure current and resistance if i only have DAQ using VB 6 and Measurement Studio

    I want to do a remote lab for basic electronic lab. One of the task is to measure current and resistance. How to do it if I only have DAQ card and using Visual Basic 6 and Measurement Studio. Can anyone give me a clue.

    If your DAQ device is supported by DAQmx, you can use it with VB6. Here's how: NI-DAQmx Support in Visual Basic 6.0.
    Michael P
    National Instruments

  • I would like to know how to transform an API C++ application in MFC C++ application to use the measurement studio components or Labwindows CVI

    I don t know the way used to transform a C++ with API program in an MFC application using measurement studio or Labwindows CVI.
    Thank you for you help.

    You can use the Measurement Studio Add/Remove Components Wizard to add Measurement Studio components to your C++ application. For more information, see the "Adding and Removing Components from Measurement Studio Projects Using a Wizard" topic in the Measurement Studio reference. You can find it in the table of contents under:
    Visual C++ Help
    Tutorials
    Measurement Studio for Visual C++ 6.0
    If you're using the Measurement Studio update for Visual C++ .NET, this topic will be under:
    Visual C++ Help
    Tutorials
    Measurement Studio for Visual C++ .NET
    - Elton

  • How to use a Measurement Studio class in MFC

    I am new to MFC coming over from VB.NET.
    I have created a VISA class to measure something from an instrument and have a simple dialog box with a Button to invoke the measurement and display it to a text box. I changed the ID of the control and made a member variable for the text box and can code the OnButtonClick event to display text in the Text box as a test.
    The problem is I cannot seem to create an object of the Visa Class that I built in the OnBnClickedRun()function. I can code the OnInitDialog() to make this measurement:
    double power;
    CGetBandPower BPower;
    BPower.Run(power);
    but want to do it when I click on the button. I am using VS.NET 2003 with Measurement Studio 7.0.
    Help

    Hello,
    I think the following other discussion forum post contains useful information for you:
    http://forums.ni.com/ni/board/message?board.id=232&message.id=1306&requireLogin=False
    In particular, read the posts by the names in blue... you'll find paths to great examples which should help you use VISA in the .NET environment.
    Repost if you continue to have any problems!
    Thank you,
    Best Regards,
    JLS
    Best,
    JLS
    Sixclear

  • How to use NiGraph control component in the MFC not measurement studio MFC??

    I want to use the NiGraph control component in the normal MFC(exe) program, but after you add the component to the project ,it will generate a CCWGraph class, and it doesnt work. If I want to use NiGraph class to plot data, What should I do? Help
    Thanks a lot!!!

    I have attached an image of the toolbar items. If there items are not visible on your toolbar, right-click the toolbar, and select the item labeled "MStudio" (if using VC++ 6.0) or "NI-Measurement Studio" (if using VS 2003). These items will only be available if you have Measurement Studio support for C++ installed.
    I hope this helps
    Bilal Durrani
    NI
    Attachments:
    icon.JPG ‏13 KB

  • How to use TDMS API in Visual Studio 8.6

    I am using Measurement Studio 8.6.1 for Visual Studio 2005. I need to read/write TDMS files from my mfc c++ application and I can't figure out how to add the TDMS capability to my visual studio project. I don't think it's part of the installed c++ class libraries, yet it is available as a .net library. help!

    Hi Julienp,
    You can download a C dll from this website: http://research.ni.com/run/2007codelicenseagree to do TDM/TDMS communication with your C++ project.  There is another thread that discusses some of the problems another poster had with using this, so it may also be helpful to look over if you have problems using the dll: http://forums.ni.com/ni/board/message?board.id=180&message.id=37932
    Eric B.
    National Instruments

Maybe you are looking for