Python with NI-SCOPE DLL

Hi, I'm trying to use ctypes in Python to import the NI-SCOPE_32.DLL and interface with a 5105 and 5124.
So far, I have successfully (I think) created a new session with the 5124. I can't do anything else as trying to access any constants results in an error such as "AtrributeError: function 'NISCOPE_VAL_NORMAL' not found" when trying to access any of these constants. I can look in the niscope.h file and see that they are #defined, but it seems the compiled DLL doesn't contain these definitions, or I can't access them for some reasons. Has anybody got this to work correctly or have any advice?

snelltaylor wrote:
Thanks for the input. I had been looking for the #define's in the headers, and found them, but the definitions were just to other strings - such as IVISCOPE_VAL_NORMAL.
Where would I go about finding what the values these represent are? Do I just have to chase them down through the headers?
Also, what kind of value should I be getting back from the niScope_init function? Right now, it gives a return value of -10something, maybe 5 or 6 digits, but the viSession pointer (which I pass using ctypes.byref()) ends up with a value of 0. The two booleans that are passed were just Python's False, so the function call looked like:
import ctypes
scope = ctypes.cdll.niscope_32
viSession = ctypes.c_long() #do I need a value here for an actual variable rather than null?
scope.niScope_init("PXI2::13::INSTR",False,False,ctypes.byref(viSession))
Does this seem reasonable? Am I missing something big here?
Thanks,
Sean
Sean,
As far as deciphering the various #define's, you will have to look at niscope.h, iviscope.h, and perhaps even ivi.h. Namley, anything IVISCOPE_VAL_xxx will most likely be defined in iviscope.h, and anything IVI_VAL_xxx should be in ivi.h. There might be some definitions elsewhere, but little grep-ing ought to get you all you need. This is where the type library information would come in very handy, but again, I am not sure how to do this in Python.
NI-Scope functions will return a ViStatus (a signed 32-bit integer). Value of 0 means that the function succeeds without an error, a negative value indicates an error, while a positive indicates a warning - one can usually ignore the warnings, while the errors usually mean some run-time condition that will prevent further predictable execution.
In you specific case (from the code snippet), I believe that the first parameter is invalid ("PXI2::13::INSTR"), and niScope_init() function does not generate a valid session - hence the value of 0 for ViSession (by the way, your ViSession definition is just fine). Specifically, the first  parameter for niScope_init() needs to be the device name that you see in MAX under Devices and Interfaces >> NI-DAQmx Devices (something like "Dev1", or "PXI1Slot5", or something similar - you can also give it your own name (both 5105 and 5124 are DAQmx devices). Refer to the NI-Scope (a.k.a. NI High Speed Digitizers Help) for more details on the functions and their parameters.
Hope this helps.
Regrads,
Sead Suskic
National Instruments

Similar Messages

  • Ni Scope dll not found in LV 8.5

    Dear All,
    The History:
    My test station with more than 1000 vis work well in 8.2 full Dev System now I have to upgread to 8.5 full dev system and now I have Problem.
    ISSUES:
    The ni Scope Error Vi says Get Error function Not found in ni scope.dll. I have Install the lastest ni scope 3.3.1 and still the error is there.
    Kindly see pics.
    Thanks
    CLAD
    Certified LabVIEW Architect
    Certified TestStand Developer
    Attachments:
    Error_2.JPG ‏38 KB

    Dear all,
    so no solution from any wire worker..........
    I did it myself........
    Solution:
    when you upgrade from 8.2 Application with ni scope 2.6.0 to 8.5 you will have the same issues that I have this is becouse 8.5 does not support
    ni scope later than 3.3.0. What i did after some hours of reserch is to upgread my scope vis to 3.3.2 and then I had no more problems.
    have fun wireworking .
    CLAD.
    Certified LabVIEW Architect
    Certified TestStand Developer

  • How do i correct a failure of iTunes to download because of a failure with file MSVCR80.dll?

    How do i correct iTunes' failure to download because of a problem with file MSCVR80.dll?

    Hello there, RGGGGGG.
    The following Knowledge Base article provides some great in-depth troubleshooting steps for troubleshooting issues with installing iTunes:
    Issues installing iTunes or QuickTime for Windows
    http://support.apple.com/kb/ht1926
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • ME57 transaction with ALV scope of list

    hi all!
    i want to run ME57 transaction with ALV scope of list, but i'm facing a problem because if the list of requirements are bigger than 50 recors, the system says that  'Max. 50 requirements can be processed simultaneously' and I can not assign source of supply to all my list. I guess this will be customizable, because if I run it with A scope of list, there's no limit of processing.
    how can I change that value in order to be able to process all the requirements of my list in ALV view?
    thanks in advance.
    Fabian

    Hello Fabian ,
    This limit is maintained in class CL_REQUISITION_AGGREGATE_MM
    attribute N_EDIT_MAXIMUM initial value 50.
    If you want , this value can be changed using transaction code SE24. However , please take note that this change is considered a modificationto the SAP standard system and will no longer be supported.
    I hope this information has been helpful.
    Best Regards,
    Frank

  • Killing a bean with application scope?

    Is there any way to kill a bean with application scope?
    I am writing a web application, that most likely the browser window will never be closed. The problem is a user is authenticated onto our site but because the bean containing the users acct info is application scope, if another user logs in it still shows the old user as logged in. So on logout i would like to kill the application, the bean, servletContext...anything that will refresh the bean and the corresponding jsp. Any help is much appreciated.

    There is an indirect way if you know servlets. The "application" implicit object that you use in your JSP is the javax.servlet.ServletContext object. Instead of declaring your bean using the jsp:useBean tag, directly put your objects into the ServletContext using ServletContext.putAttribute() method. Objects put in the ServletCOntext are available to all pages in the application. Just use the ServletContext.getAttribute() method to retrieve this bean in any other page.
    To "kill the bean", just reset the value of this object to null by calling putAttribute(null).

  • Problem with current scope forum

     I have searched my computer for trojan downloader and it was found and removed however the search said having a problem with current scope.
    Skin222

    Hello Skin222,
    Your problem is beyond the scope of support. This forum is for feedback and questions related to the current versions of the ADO.NET Entity Framework and LINQ to Entities including object-relational mapping and entity data modeling.
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Share stateful session bean in JSF managed beans with different scope

    Hi,
    I have a JSF application and I want to try to use of stateful session beans.
    So I created a new stateful session bean and its local interface.
    @Stateful
    public class StatefulSessionBean implements StatefulSessionBeanLocalInterface{
    private String name;
    @Local
    public interface StatefulSessionBeanLocalInterface {
    ...In my JSF application I have a mananed bean with session context which registers the new interface by
    this annotation
    @EJB(name="sessionbeanref", beanInterface=StatefulSessionBeanLocalInterface.class) and set the name to something.
    Now I want to fetch this name in another managed bean with request scope. So I looked up the bean and tried to get the name.
    StatefulSessionBeanLocalInterface = (StatefulSessionBeanLocalInterface) new InitialContext().lookup("java:comp/env/sessionbeanref");
    System.out.println(currentmailingbean.getName());but the name is null.
    Why?

    The xsd was created via the netbeans J2EE enterprise application dialog and I think its the most recent.
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">All other annotations seem to work.
    Wouldnt the lookup completely fail if the deployment process thought that it is version 1.4 ?

  • Error with the Scope parameter for component

    Hi, I am using JSF2.0 in my web. In the home page (index.xhtml) i have an album gallery with session scope. However the gallery is available to all the users, what should be the scope for this component? After setting session scope, a session key is generated which is appended with the URL and because of this (perhaps) other links are not opening. i mean whenever i clicks on any link (about.xhtml), it displays nothing. Removing the bean from session scope makes everything fine except gallery (gallery doesn't rendered).

    That version of the package has been built with apache 2.2.x. Be sure to use that version of apache too, as 2.0 won't work with that specific package.

  • After updating to adobe  reader 11.0.3 my registry was corrupted with a gapi32.dll missing error. I

    after updating to adobe  reader 11.0.3 my registry was corrupted with a gapi32.dll missing error. It was not missing and was conflicting with outlook as this dll file is a common file. The only way I could fix the problem was to do a system restore back to when I had the 11.0.2 version and everything will work with that. You have a problem with version 11.0.3 installation. The same thing happened on 3 computers so I know it is this new version of adobe reader which is the problem.

    It would be great, if you could provide us with the following details:
    1. The OS you are working on.
    2. The version of MS Office installed on your machine.
    3. A screenshot of the error message along with the scenario in which the same is displayed.
    4. How exactly did you go about updating Reader 11.0.02 to 11.0.03. Was it via the updater mechanism or by downloading the patch from the Adobe site.
    Also, it would be great if you could let us know if there was any other Windows or Antivirus related updates applied on your machine in the same timeframe as the Reader update.

  • Application crash with error ntdll.dll 00018fea

    Hi,
    I have a problem with my app.exe build.
    I attach a simple code; the Vi open and close a TDM file.
    If I run this Vi in Labview works fine.
    If I build the application.exe on a notebook and I run it I got "Application crash with error ntdll.dll 00018fea".
    I've tried to build the Vi on another Pc Desktop with Labview and here if I run the exe it works fine.
    On the two PC I have LV8.5; the build options are the same.
    On the notebook I've try also to reinstall LV8.5 but I got the same error.
    Can you help me?
    Thanks a lot
    Attachments:
    open tdm.vi ‏33 KB

    MicheleS wrote:
    This morning I've try to put the ntdll.dll of the other PC in the notebook but the problem remain.
    Never ever do that! You were very lucky that both ntdll.dll files were probably the same version so the exchange didn't do much but ntdll.dll is one of the core Windows DLLs were everything goes through that normal applications may access in Windows. A mixup in such a part because of incompatitible ntdll.dll with other system API DLLs might prevent your computer entirely from starting up even in safe mode.
    You should not attempt to ever switch system DLLs between different computers. In such behaviour lays insanity. If you expect a system DLL to be corrupt attempt to do a repair installation instead. Also Windows nowadays has techniques to detect if a system DLL got corrupt and will attempt to repair it, though I guess if ntdll.dll would go belly up it's likely your computer won't even start up.
    Rolf Kalbermatter
    Message Edited by rolfk on 01-14-2008 08:05 AM
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • HT1222 How do I download itunes with a MSVCR80.dll error message?

    How do I download itunes with a MSVCR80.dll error message?

    Solving the iTunes Installation Problems in Windows
    1. Apple has posted their solution here: iTunes 11.1.4 for Windows- Unable to install or open - MSVCR80 issue.
    2. If the Apple article does not fully resolve the problem for you, then try Troubleshooting issues with iTunes for Windows updates - MSVCR80.
    iTunes 11.1.4 for Windows- Tips for Unable to install or open - MSVCR80

  • Firefox "The procedure entry point PK11_Derive With Template nss3.dll" wont start warning message?

    Firefox will not start warning message "The procedure entry point PK11_Derive With Template nss3.dll" after IE update and zeroing cookies.

    Do a clean reinstall and download a fresh Firefox copy from http://www.mozilla.com/firefox/all.html and save the file to the desktop.
    Uninstall your current Firefox version and remove the Firefox program folder before installing that copy of the Firefox installer.
    It is important to delete the Firefox program folder to remove all the files and make sure that there are no problems with files that were leftover after uninstalling.
    You can skip the step to create a new profile, that is not necessary for this issue.
    See http://kb.mozillazine.org/Standard_diagnostic_-_Firefox#Clean_reinstall

  • Output pulse with NI-Scope only, on 5102 PFI line

    The NI-Scope documentation briefly mentions a "Configure Digital Output" function, but it is not clear exactly what this does, and what parameters are available (e.g., pulse width, polarity, stand-off, etc...), or if it merely "configures", and another function is needed to actually generate the pulse.
    Programming in VB, with NI-Scope, for the 5102, what NI-Scope function(s) would I call to initiate an output pulse on a PFI line? What parameters of the pulse can be controlled?
    Thank you, Ed More

    Hello Ed,
    You need to use functions in NI-DAQ in either LabVIEW or ComponentWorks to do this. There are some examples and a knowlegdebase article that describe this.
    Here are the links:
    http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/fead136291ec002186256aaa006c2019?OpenDocument
    http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3DFC756A4E034080020E74861&p_node=175381&p_source=external
    http://sine.ni.com/apps/we/niepd_web_display.DISPLAY_EPD4?p_guid=B45EACE3DD5756A4E034080020E74861&p_node=175341&p_submitted=N&p_rank=&p_answer=&p_source=External
    If the links do not work, go to developer zone and search on 5102 and pfi to find the examples and go to support and search in knowledgebase on 5102 and pfi for t
    he knowledge base entry.
    -Brian

  • Why doesn't SignalExpress communicate with TDS3054B scope?

    HELP!
    I have a TDS3054B scope with v3.39 firmware installed on it.  I want to communicate with it using SignalExpress but can't!  I can see the instrument in Measurement & Automation Explorer (v4.2.0.3001).  It shows up as GPIB0::1::INSTR.  I have a USB-GPIB cable going from my laptop to the scope.  The laptop is running LabVIEW 8.2.  I have installed the drivers for the scope from NI's website but still can't get it working...
    I can communicate with the scope using Tektronix's OpenChoice Desktop software, but that software is limited in what it can do...
    Any suggestions?

    Thanks again, Kent. 
    The article helped some, but I still don't have it working...
    In MAX, under the IVI Drivers >> Logical Names, I have the name MyScope.  For the General tab, I have the Driver Session listed as tkds30xx & a Description "TDS3054B oscilloscope".
    In MAX, under the IVI Drivers >> Driver Sessions >> tkds30xx >> General tab, I have the following:
    Initialization Options enabled: Cache, Range Check, Query Instrument Status;     Simulate With: Don't Simulate;     Driver Setup: tkds30xx;     Description: TDS 3000 Series
    In MAX, under the IVI Drivers >> Driver Sessions >> tkds30xx >> Hardware tab, I have the following:
    Hardware Assets: Name - TDS3054B (checked); Resource Descriptor - GPIB0::1::INSTR
    In MAX, under the IVI Drivers >> Driver Sessions >> tkds30xx >> Software tab, I have the following:
    Software Module: <None>;  my only choices are <None> or NIDMM.
    In MAX, under the IVI Drivers >> Driver Sessions >> tkds30xx >> Virtual Names tab, I have the following:
    Virtual Name: CHANNEL1, CHANNEL2, CHANNEL3, CHANNEL4;     Physical Name: CH1, CH2, CH3, CH4
    In MAX, under the IVI Drivers >> Driver Sessions >> tkds30xx >> Initial Settings tab, I have nothing.
    In LabVIEW SignalExpress, I go to Add Step >> Acquire Signals >> IVI Acquire >> IVI Scope Acquire.  The Step Setup box is displayed.  On the Configuration tab >> Device section >> IVI session name, I select Create New...  Another dialoge box opens with an IVI session name in it.  I change it to MyScope (same as in MAX), choose the Resource Descriptor GPIB0::1::INSTR (same as in MAX), but can't select an instrument driver.  The only thing available under Instrument driver is a check mark.  I can't select it for some unknown reason.  I hit the OK button & the box closes, returning to the Step Setup screen.  I try to run the step once & get an error stating:
    "ivi_IviScope Initialize With Options.vi<ERR>
    Driver Status: (Hex 0xBFFA1207) Primary Error: (Hex 0xBFFA1207) The item does not exist in the collection.
    Elaboration: tkds30xx"
    Back to square 1...

  • Got trouble with the scope....

    Hi,
    I have a program, and I have trouble with the scope.
    I created two nodes, and I can print them out within that sort of proceedure say
    public void a();
    //generate nodes and such
    but when I do this:
    public void b();
    //search through the made nodes
    it will compile, but will say that there are no nodes created, when i already did by another one, now I know this is a static scope, and I was wondering what to do here?

    1) You need to declare the nodes in the class, and assign them in a(). Variables declared outside a method are referenceable within all methods of that class.
    2) Get rid of the semi-colons at the end of your method signatures -- the code you've provided won't compile that way.
    3) Not to insult you, but you should really spend some time on fundamental programming concepts. Scope is fundamental concept, suggesting that there are some troublesome holes in your knowledge. The more you know, the more efficient you will be.
    Bueno suerte.

Maybe you are looking for

  • Labview 2009 32 bit not running on xp 64 bit

    Hi all, I tried to upgrade to LabVIEW 2009 from LabVIEW 8.6 on 64-bit windows XP machine. Following about a 2 hour removal of 8.6 and subsequent installation of LV 2009 it turns out that the device drivers are not compatible with a 64-bit machine. On

  • Is it possible to send a 2D text array from a Labview progarm...​....

    I also posted this on the "Fieldpoint Family" board.  Is it possible to send a 2D text array from my LV program running on my PC to a LV program running in Realtime on my FP2010 Processor? When I tried to build the RT program using the wizard, it did

  • HD monitoring with HP DreamColor LP2480zx Professional LCD

    I am new to HDV editing using Final Cut Pro and want to set up an editing system. Does anyone have experience with HPHP DreamColor LP2480zx Professional LCD monitor? Does HDMI input mean this monitor will display High Definition picture? What kind of

  • SLiM Problem

    I put SLiM as a daemon and I have done everything in the wiki. But when the daemon loads, it fails and says x timeout 5 minutes, something like that. It goes too fast for me to see. Oct 30 17:56:20 arsenic init: Switching to runlevel: 6 Oct 30 17:56:

  • Labview talking to agilent 54830B oscilloscope

    Our lab recently bought an Agilent oscilloscope.  I have installed the appropriate software and drivers that I found on the NI website.  However I am relatively new to all this.  I was wondering if anyone knew of a typical setup for such a labview pr