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

Similar Messages

  • 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 JavaScript in Controller Class...

    Hi All,
    Can any one tell me how to use JavaScript in Controller Class.
    Requirement is:
    I have
    Radio Group(RG1),
    Two Radio Buttons(RB1,RB2),
    Two messageTextInput(MTI1,MTI2),
    if i click RB1 i should Prompt to the end user to "Enter value for MTI1" or
    If i click RB2 i should prompt "Enter value for MTI2" while submitting page.
    Please let me know the steps to use JavaScript and the above client validation...
    Regards
    Alem...

    Using javascript is against the standard. I can tell you a workaround instead of you setting the javascript, check if that would be acceptable.
    You can use PPR and set the required property on the messageTextInput on clicking of the radio button. By doing this you will let UIX generate the javascript for you to handle the client side validation. But the validation will happen only on click of the submit button. The visual indicator is good enough to tell that the value has to be entered to the item.

  • 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

  • Using measuremen​t studio classes in VC++ applicatio​n

    How to identify the devices connected in the GPIB interface using measurement studio NI VISA classes with VC++ 2005 application? Please provide a sample.

    Hello, if you have installed support for Visual Studio, then you will be able to find the examples in the following folder
    C >> Documents and Settings >> All Users >> Documents >> National Instruments >> NI-488.2 >> Languages >> MStudioVC2005
    I am assuming that you are running Windows XP and that you have turned on hidden folders.
    Christian A
    National Instruments
    Applications Engineer

  • General Overview on How to use Final Cut Studio to create a Blu-Ray DVD

    I am a new user of Final Cut Studio and need an experienced user to give my a progression guide on how to create a Blu-Ray DVD of my recent Alaska Trip. Last month I spend 8 days in Alaska visiting Denali and Juneau primarily. During that time I took about 100 short video clips (HD 1080p) and 570+ still photos with my Canon 7D. I have experimented with some pieces of the software and have created a Blu-Ray disk using Final Cut Pro and Compressor. However my goal is to create this DVD with menus that will play short clips (some narrated) and still photos(also some narration). I did a short one in DVD Studio Pro this morning but need some general guidance on what progression and programs to use to create this project. I was not able to take my video from the Studio Pro Sequence I created for my 1st DVD I had to take the original clips which were processed using Apple ProRes 422 and copy them in one at a time and then find the audio (on the voice overs) I created and also place them into DVD Studio Pro one at a time. I obviously need some guidance on the proper progression.
    Any help would be greatly appreciated.

    Here's the situation...
    DVD Studio Pro will not do the trick for you - it doesn't do blu-ray discs. If you want to do Blu-ray you've got to use either Final Cut Pro's "Export" command or Compressor's "Burn Blu-ray disc" template. The downside to both of these approaches is that you can't burn more than one title (or movie, etc.) using Final Cut Studio.
    To do what you want to do, you need Toast (at least). Toast will auto-generate menus but will let you put more than one title per slide (so you can put multiple slideshows on the same disc).
    If you want to do full-on customizing of menus and multi-level menus, for that you need Adobe's Encore.
    My suggestion - Get Toast. Encore is close to $800.
    Here's your progression (at least the one I use).
    Edit in Final Cut Pro (ProRes 422 is fine, ProRes 422 LT would do the trick as well)
    Export as QuickTime movies (original settings)
    In Compressor using the H.264 for Blu-ray setting and Dolby Digital setting and create elementary streams for video (.264 file) and audio (.ac3). Make sure these files have identical names except for the extension.
    Using toast, add the video file to the Toast project and it'll find the audio file.
    Burn away!

  • How can I get Measurement Studio out of Evaluation Mode in Windows XP

    I have a licensed Measurement Studio version 7.1.  for Visual Studio 6.   I have been using this no problem on a Windows 2000 computer.   I installed this on my WindowsXP computer and it installs all the VB libraries put not the C++ libraries.  I message pops up stating that I need Service Pack3 for WindowsXP.    First of all, I don't think service pack 3 for Windows XP exists yet.  Luckily, I have been able to still use all my DataSocket components.  I believe Datasockets are part of Measurement Stuidio.   I notice that CWgraph has evaluation mode on the graph and I get a popup message in VB6 stating I'm using Measurement Studio in evaluation mode.   

    Hello,
    The service pack in question is not for Windows XP.  The Measurement Studio installer required the VC++ 6 service pack 3 or higher.  I know that Microsoft has a service pack 6 for Visual C++ 6, and this is what you should install to get the C++ libraries on your machine.
    There is a tool on the CD that is in the ActiveXLicenseFixer folder that you can run to fix up the license.  If you have a valid license on the machine it will correct any licenseing issues.
    -Jeff
    NI

  • How to use these method of class CL_GUI_PDFVIEWER

    how to use these methods in the class CL_GUI_PDFVIEWER
    1) CREATE_ANNOTATION
    2) GET_ANNOTATION_INFO
    3) SET_ANNOTATION_SETTINGS

    Hi,
       Refer
    https://forums.sdn.sap.com/click.jspa?searchID=10926572&messageID=1803295
    Regards
    Kiran

  • How to use commit work in class cl_bls

    Hi,
    When i have used commit work after email sent,
    it goes into dump.
    Here is the code segment:
      try.
        -------- create persistent send request ------------------------
          send_request = cl_bcs=>create_persistent( ).
        -------- create and set document -------------------------------
          pdf_content = cl_document_bcs=>xstring_to_solix( pdf_tab ).
          document = cl_document_bcs=>create_document(
                i_type    = 'PDF'
                i_hex     = pdf_content
                i_length  = bytecount
                i_subject = sub ).  "#EC NOTEXT
        add document object to send request
          send_request->set_document( document ).
        --------- add recipient (e-mail address) -----------------------
        create recipient object
          recipient = cl_cam_address_bcs=>create_internet_address( recip-recip ).
        add recipient object to send request
          send_request->add_recipient( recipient ).
        ---------- send document ---------------------------------------
          sent_to_all = send_request->send( i_with_error_screen = 'X' ).
         commit work.
          if sent_to_all is initial.
            message i500(sbcoms) with recip.
          else.
            message s022(so).
          endif.
      ------------ exception handling ----------------------------------
      replace this rudimentary exception handling with your own one !!!
        catch cx_bcs into bcs_exception.
          message i865(so) with bcs_exception->error_type.
      endtry.
    What could be the reason?
    Is there any way to use commit work in class while sending email as in SO_NEW_DOCUMENT_ATT_SEND_API1 fm?
    Thanks.

    Hi,
    I have used
    submit program.....
    but in update task i have used it.
    "Z_SD_ORDER_UPDATE".    program is a print driver program.
    However error says:
    There is probably an error in the program
    "Z_SD_ORDER_UPDATE".  
    This program is triggered in the update task. There, the
    following ABAP/4 statements are not allowed:
    -  CALL SCREEN
    -  CALL DIALOG
    -  CALL TRANSACTION
    -  SUBMIT
    I used submit as:
      WAIT UP TO 2 SECONDS.
      SUBMIT rsconn01 WITH mode = 'INT'
                      WITH output = ' '
                    AND RETURN.
    Instead of submit i want to use commit work but i also get a dump after commit work too.
    How can i use commit work in above code?
    Thanks.

  • How to Use Pattern and Matcher class.

    HI Guys,
    I am just trying to use Pattern and Matcher classes for my requirement.
    My requirement is :- It should allow the numbers from 1-7 followed by a comma(,) again followed by the numbers from
    1-7. For example:- 1,2,3,4,5 or 3,6,1 or 7,1,3 something like that.
    But it should not allow 0,8 and 9. And also it should not allow any Alphabets and special characters except comma(,).
    I have written some thing like..
    Pattern p = Pattern.compile("([1-7])+([\\,])?([1-7])?");
    Is there any problem with this pattern ??
    Please help out..
    I am new to pattern matching concept..
    Thanks and regards
    Sudheer

    ok guys, this is how my code looks like..
    class  PatternTest
         public static void main(String[] args)
              System.out.println("Hello World!");
              String input = args[0];
              Pattern p = Pattern.compile("([1-7]{1},?)+");
              Matcher m = p.matcher(input);
              if(m.find()) {
                   System.out.println("Pattern Found");
              } else {
                   System.out.println("Invalid pattern");
    }if I enter 8,1,3 its accepting and saying Pattern Found..
    Please correct me if I am wrong.
    Actually this is the test code I am presenting here.. I original requirement is..I will be uploading an excel sheets containg 10 columns and n rows.
    In one of my column, I need to test whether the data in that column is between 1-7 or not..If I get a value consisting of numbers other than 1-7..Then I should
    display him the msg..
    Thanks and regards
    Sudheer

  • Exe file will not start using a Measurement studio 2013 component

    Hello,
    I use Meausrement studio 2013 with visual studio 2012 and vbnet on windows 7.
    On a new project (windows form application), i use a form and a ScatterGraph component. I compile, no errors and it works fine. 
    Now, i try to start this application on a another Windows 7 station. (The framework 4.5 is installed on its station).
    The exe file is in a directory with the natrional Instruments dll files.
    The exe file will not start, no errors.
    PS: Before, with Meausrement studio 2010 and visual studio 2010 all worked fine. 

    Hi, virgule
    It sounds like you are using the "Publish" feature in Visual Studio (a.k.a., ClickOnce) for deployment, is that correct? If so, unfortunately ClickOnce is not supported by Measurement Studio components.
    If you are looking for a good way to deploy Measurement Studio applications, I would highly recommend upgrading to Measurement Studio 2015, which ships with Measurement Studio Installer Builder. You can read more about this here: http://www.ni.com/white-paper/52669/en/
    If you cannot update to Measurement Studio 2015 and are using Visual Studio 2013, NI recommends using WiX for creating your installer. More information on WiX deployment can be found here: http://digital.ni.com/public.nsf/allkb/764B727C9BD2C4C686257C970053D059
    Thanks,

  • How to use the opportunity stub classes to retrieve the opportunity objects

    Hello ,
    I have downloaded WSDL file for opportunity and i have created the stub classes by using axis as WSDL to java. Can any body suggest me , how can i use those created stub classes to retrieve the opportunity objects ?.
    Thanks,
    --bdr_09
    Edited by: bdr on Feb 3, 2009 1:54 AM

    http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/Tools8.html#63055

  • How too use the string tokeniser class to format date strings

    Using the code below I want to write a method which takes a string as a parameter and process it as follows:
    Input: 21/07/62
    Output: 21st July 62
    I wish to do this using the string tokenizer class. Can anyone help??
    import java.io.*;
    public class Input
    public static void main(String args[]) throws IOException
    String theString;
    BufferedReader stdin = new BufferedReader(
    new InputStreamReader(System.in));
    System.out.println("Enter your string now please");
    theString = stdin.readLine(); // throws IOException
    System.out.println("You entered ***" + theString + "***");
    }

    You can certainly use a StringTokenizer to parse your date into three numbers but I think you should use SimpleDateFormat, which will even help you generate your desired format: http://java.sun.com/j2se/1.4/docs/api/java/text/SimpleDateFormat.html

  • How to use user defined exception class

    Hi all
    I just need som help with creating a user defined exception class.
    Im writing a small/simple text editor.
    My exception class looks like this:
    public class myExcp extends Throwable
         private String message;
         public myExcep(String message)
              this.message = message;
         public void display()
              System.out.println(message);
    I would like to use it when a user tries to open a exe-file instead of a txt file.
    Here is some code from the editor:
    if (e.getSource() == open)
    saveOld();
    if (fc.showOpenDialog(null)== JFileChooser.APPROVE_OPTION)
    readFile(fc.getSelectedFile().getAbsolutePath());           
    saveas.setEnabled(true);                
    So, should I use exception here or at the readFile method?
    readfile:
    private void readFile(String fileName)
    try
    String tmp = fileName.substring(fileName.length() -4, fileName.length());
    if (!tmp.equals(".exe"))
    FileReader r = new FileReader(fileName);
    textarea.read(r, null);
    r.close();
    currentFile = fileName;
    label.setText(currentFile);
    changed = false;
    catch (IOException e)
    JOptionPane.showMessageDialog (this, "Cannot find the file " + fileName);
    Where and how do I use my exception class.
    Do I need to create an instance? Where?
    Should the exception class extend Exception instead?
    Thank you in advance /

    Extend Exception, not Throwable. It's a checked exception that way.
    Follow the Sun coding standards and make that exception class name start with a capital letter.
    When you extend Exception, override all four ctors.
    What's that display method you added? Isn't getMessage() good enough?
    You need to create a new instance just before you throw the exception, of course.
    Sounds like a terrible design, by the way. Exceptions shouldn't be used like "go to" for app logic. They should signal unrecoverable conditions. You can easily recover from the situation you've described simply by displaying a pop-up that tells the user to open only text-readable file types. I think that's a better solution.
    %

  • How to use constructer for javafx class

    hi
    when i create an instance of javafx class i do like this :
    var instance = ClassName{
    attribute1 : value1
    attribute2 : value2
    so i have to put all attributes as public ...wich is not respect the OOP rules !!
    how can i avoid this ?
    thx

    to preserve encapsulation you can use the public-init modifier like so
    public-init var foo;This allows initialization from public and read from public but write only from within the same script (file).
    All of the access modifiers are explained here: [http://java.sun.com/javafx/1/tutorials/core/modifiers/|http://java.sun.com/javafx/1/tutorials/core/modifiers/]

Maybe you are looking for

  • Can't set media kind to movie

    I imported a video in to iTunes, and it came in as a movie. It's an educational video, so I thought it would be nice to set its media type to iTunes U. I did that, then clicked iTunes U in my left hand pane, and the video did not appear. I created a

  • Updated itunes and now songs are gone

    when i updated my itunes, it deleted all the songs i had in my library. i was able to put the songs from albums back in, but all the songs i bought from the itunes music store are gone, and my back-up files were erased too. please help! dell   Window

  • Has anyone done work in LabVIEW with the LLRP protocol for RFID readers?

    [cross-post] Has anyone done work in LabVIEW with the LLRP protocol for RFID readers?  I've googled around and didn't find anything. Message Edited by Jim Kring on 10-31-2008 10:45 AM

  • I need firefox 3.6b revision 4 to install on a windows ce netbook

    It should support windows ce and be able to load youtube videos

  • GENERATION OF NUMBERS

    Pls, I have written a program. However, I'm expected to include sub-program that will generate numbers automically for students. For example, the number for first student may be 12367GE and the next may 56789AW. Pls, how do I do that? Thanks