Write/read a binary value to/from IO pin in python

I plan to buy 15 IO cards. Before I purchase I like to know if I can use python to write a binary byte to IO pin in python. What is step by step to achieve this?
I want to read a byte from IO pin, what is step by step of getting this? I am using PCI-DIO96H
Thanks
Chanh

Hi Chanh,
Unfortunately, we do not have any direct interfaces between our DAQmx drivers and Python.  For a list of programming languages that can interface with your DAQ 9.1.1, navigate to the link below and download the readme file, then go to the "Software support in NI-DAQmx 9.1.1" section:
http://joule.ni.com/nidu/cds/view/p/id/2034/lang/en
Some of our customers have done work with Python by calling our C-based DAQmx DLLs, but it is not officially supported so I cannot make any guarantees as to if it would work for you or not.  A google search for Python and DAQmx might also bring up some resources that you would find useful.
Andrew T.
National Instruments

Similar Messages

  • Java API to read the Encrypted Values from Windows Registry settings

    Is there any Java API to read the Encrypted Values from Windows Registry settings ?
    My Java Application invokes a 3rd party Tool that writes the key/value to windows registry settings under : “HKLM\Software\<3rdparty>\dataValue”.
    This entry is in BINARY and encrypted with 3DES, using crypto API from Microsoft.
    3rd party software to encrypt the data stored in registry it
    either uses C++ code: and uses the call “CryptProtectData” and “CryptUnProtectData” or
    If it is a .NET (C#) it uses the call “Protect” or “UnProtect” from class “ProtectData” of WinCrypt.h from the library “Crypt32.lib.
    Note: The data is encrypted using auto-generated machinekey and there is no public key shared to decrypt the Encrypted data.
    Since the data is encrypted using auto-generated machinekey the same can be decrypted from a .Net / C++ application using CryptUnprotectData or UnProtect() API of WinCrypt.h from the library “Crypt32.lib.
    To know more about Auto-Generated MachineKey in Windows refer the links below
    http://aspnetresources.com/tools/machineKey
    http://msdn.microsoft.com/en-us/library/ms998288.aspx
    I need to find a way in Java to find the equivalent API to decrypt (CryptUnprotectData) and Microsoft will automatically use the correct key.
    But i couldn't find any informato related to Java APIs to enrypt or decrypt data using auto-generated machinekey.
    Is there a way to read the encrypted data from Windows regsitry settings that is encrypted using the Auto-Generated Machine Key ?
    Kindly let me know if Java provides any such API or mechanism for this.

    If the symmetric key is "auto-generated" and is not being stored anywhere on the machine, it implies that the key is being regenerated based on known values on the machine. This is the same principle in generating 3DES keys using PBE (password-based-encryption). I would review the documentation on the C# side, figure out the algorithm or "seed" values being used by the algorithm, and then attempt to use the JCE to derive the 3DES key using PBE; you will need to provide the known values as parameters to the PBE key-generation function in JCE. Once derived, it can be used to decrypt the ciphertext from the Regiistry in exactly the same way as the CAPI/CNG framework.
    An alternate way for Java to use this key, is to write a JNI library that will call the native Windows code to do the decryption; then the Java program does not need to know details about the key.
    That said, there is a risk that if your code can derive the key based on known seeds, then so can an attacker. I don't know what your applicatiion is doing, but if this is anything related to compliance for some data-security regulation like PCI-DSS, then you will fail the audit (for being unable to prove you have adequate controls on the symmetric key) if a knowledgable QSA probes this design.
    Arshad Noor
    StrongAuth, Inc.

  • Write to binary file different from 8.0 to 8.2?

    I am communicating with a device via USB and am using a method setup by the USB driver programmer. To communicate, I write to a binary file with a filename of \\?\COMx. This has been working fine for about a  year in mfg with Labview 8.0. I recently "upgraded" to 8.2 and now it does not work. If I save for a previous version and run 8.0 it works fine. How can I make this work with 8.2?

    Yi Y,
    The USB device is one of the instruments we manufacture. The USB driver is written so writing to the USB port is just like writing to a file. I use the binary read/write VI's to send and receive commands to this USB device. The filename I use is \\?\COM#. I am told by the USB driver creator that this is common for low level C. I have been using this VI for that last year and recently upgraged from 8.0 to 8.2 and it does not work. I run the same vi under 8.0 and it works fine. This is not a common way to communicate, so will probably not get an answer.
    My next question is, is there any way to run an 8.0 dll or vi from an 8.2 executable?
    Thanks
    Hi dgtest1,
    Which USB device you are using, and which driver are you using? I'm trying to figure out specifically how you are communicating with the USB device by writing a binary file and how was the binary file written.  Could you please post more information to describe in more details about what your set up is doing?
    Thanks!
    Yi Y.
    Applications Engineer
    National Instruments
    http://www.ni.com/support

  • Write-read binary file Error 116

    Hi all,
    I am saving double, numeric array data into a binary file and then trying to read it back but keep on getting Error 116 (cannot read from binary file).
    I have attached screenshots of the way I am writing my data into the binary file and then the way I am trying to read it. Basically my data is chunks of 2D double arrays, coming at a rate of 1hz and this is why I have to use the get and set file size functions prior to saving into the file (i.e. so that each time I can append my file with new data).
    I have tried all combinations for the write to binary and read to binary file functions, thus meaning I have tried little, big and native endian options but I keep getting the same error. Also played with the way I append my data, i.e. I have used both the "offset in bytes" and "end of file" options, just in case this made any difference, but again no luck.
    Any help would be much much appreciated.
    Regards,
    Harry
    Solved!
    Go to Solution.
    Attachments:
    Write_Bin.JPG ‏154 KB
    Read_Bin.JPG ‏100 KB

    Just as an amendment to my original post, I can succesfully read my data in MATLAB using the standard fread function with double precision. I presume that this means that there is nothing wrong with the way I write the data into the file. However, it would be useful for me to be able to read it directly from Labview without having to build matlab executables etc etc...
    cheers again

  • How do I read a hex value and then convert to the binary equivalent?

    I am reading hex values from a register on my unit under test. I only want to monitor certain bits in the hex value to check a status. I have everything down to run the program except how to read my hex values in binary form. Any suggestions out there?

    If this is just a matter of display, then right click and choose "Format & Precision...". Beware, this works only with integer indicators (I8/16/32 and U8/16/32).
    If the problem is to extract a bit value in a specific position, then go to the "Advanced >> Data manipulation" sub-palette where are all bit manipulation functions (rotate, shift, split...).
    Don't forget either the logical functions (And, Or...) in the boolean sub-palette, where is also the "number to boolean array" function (to be used in conjunction with an index array node).
    Another option is to use string conversion functions, in the "String >> String/Number conversion" sub palette.
    Have a look to the attached image.
    Enough ?
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    Hex_&Bin.tif ‏20 KB

  • Reading a multi-dimensional array from a binary file?

    Hi, experts!
    Once again I'm stuck with a basic problem in labview. I've ben trying to make a VI that reads a binary measurement file that consists of a 2D array, i.e. n channels of sampled data. This seems to be easier said than done in LV and I the only example I find treats 1D-arrays exclusively. Take a look at the test file attached to this message. I saved it as a labview 7.1 file.
    Eternally grateful for all help
    Einar
    Attachments:
    W&R binary array.vi ‏115 KB

    Your write operation results into 1000 consecutive values written on disk without any array length indication. You can't read that data directly into a 2D array because the sizes are unknown to the Read function. You should read the whole file into a 1D array and the reshape the array into a 500 by 2 array. See the pict to figure how the Read/Write operations perform on arrays.
    Message Edité par JeanPierre le 03-14-2006 09:00 AM
    LabVIEW, C'est LabVIEW
    Attachments:
    Example_BD.png ‏18 KB

  • Can TestStand open, read, write and close binary files?

    From a TestStand sequence, I need to open, read, write and close binary files. Does TestStand support this capability?

    Christine -
    In the past I have used the C/C++ Adapter to call directly into the CVI RTE functions. The CVI functions I have used are OpenFile, WriteFile and CloseFile. The functions are exported from the DLL as CVI_OpenFile, CVI_WriteFile, and CVI_CloseFile. I just had to make sure that on termination of the sequence, that the integer handle was properly released by calling the close function.
    If you are using LabVIEW, you could call directly into the low level VIs to do a similar set of operations.
    Scott Richardson (NI)
    Scott Richardson
    National Instruments

  • Reading User Profile Properties pragmatically in SharePoint 2010 Returns Null Values Although it has values returned from AD

    Reading User Profile Properties pragmatically in SharePoint 2010 Returns Null Values Although it has values returned from AD
    I configured the user profile service application and run Sync and user profiles and its properties returned from Active directory but when I want to read it pragmatically it returns null values.
    this is my code...
       void runQueryButton_Click(object sender, EventArgs e)
               // Get the My Sites site collection, ensuring proper disposal
                using (SPSite mySitesCollection = new SPSite("http://sp/my"))
                    //Get the user profile manager
                    SPServiceContext context = SPServiceContext.GetContext(mySitesCollection);
                    UserProfileManager profileManager = new UserProfileManager(context);
                    UserProfile profile = profileManager.GetUserProfile("Contoso\\user");
                    foreach (Property prop in profileManager.Properties)
                       // if (prop.Name == "Department")
                        resultsLabel.Text += prop.DisplayName + ":" + profile[prop.Name].Value + "<br />"; ;

     Hi,
    Please try with the following code
          PrincipalContext principalContext = new PrincipalContext(ContextType.Domain);
                                SPServiceContext context = SPServiceContext.GetContext(site);
                                UserProfileManager profileManager = new UserProfileManager(context);                        
      foreach (Property prop in profileManager.Properties)
                       // if (prop.Name == "Department")
                        resultsLabel.Text += prop.DisplayName
    + ":" + profile[prop.Name].Value + "<br />"; ;
    Thanks,
    Vivek
    Please vote or mark your question answered, if my reply helps you

  • How can we use C# to read dynamic parameter's value list from .rpt?

    I'm using Cystal Report 2008. We know starting from CR XI we can create dynamic parameters, the list of items of this kind of parameter are fetching from database. So in general the SQLs to get the list of values for dynamic parameters are stored in the .rpt.
    In Crystal Report Designer, if I preview a report with dynamic parameters, it will first query the database and then show the input dialog with list of values from database for user to choose. My question is can we implement the same thing by our C# code? I'm planning to use C# code to read this dynamic parameter's value list from .rpt and render them on the web page. Then pass back the user selected values to the .rpt to run the report after user make the choice. I didn't find any APIs can do this. Is it possible?
    Thanks in advance!!

    Hi,
    Can you explain a bit in detail, I have similar scenario. I am using the following code but not getting the Column name for dynamic parameter list.
    foreach (ParameterFieldDefinition prm
                              in reportDocument.DataDefinition.ParameterFields)
                    try
                        string vParameterFieldName;                   
                        *vParameterFieldName = prm.ParameterFieldName.ToString();*
    Shakeel

  • Write/read image to avi file, VI works incorrectl​y from the second run

    Hi everybody, in my labview I write image from IMAQ USB to avi file and read image from avi file, the VI runs correctly at the first run then after that it goes wrong, I can write/read only one frame and it terminates automatically. Does anybody know why and how to solve this?
    Thanks a lot,
    Hannah

    Without seeing your code I can't comment specifically, but if it runs correctly the first time and then stops be looking for something that is not getting reinitialized correctly. Also what exactly do you have to do to get it to work again? Close and reopen the VI? Restart LV? Restart the computer?
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • How can I read an ID-value from the LMS and insert this into an URL?

    Hi
    Right now I am struggling with a little problem. Hopefully anyone here knows the answer. For the latest course I am building (Captivate 6), it is necessary that at one point the course reads an ID-value from the LMS. After that, this ID should be inserted into an URL.
    To be more precisely: the ID must be read (getValue) from cmi.archive_id and inserted into an URL like that: http://.../archive.php?action=pdf&objectID=ARCHIVE_ID.
    Unfortunately I am more of a designer und less of a javascript-maestro (well...I am a javascript-noob to be precisely), therefore I am pretty clueless how to do that. I tried a simple executed action (run Javascript: cpEIGetValue('cmi.archive_id'); and after that open URL http://.../archive.php?action=pdf&objectID=ARCHIVE_ID), but...well...that didn't work.
    Any ideas?
    Thanks a lot in advance

    Think you'll find help looking at Jim Leichliter's website:
    http://captivatedev.com/
    He has great tutorials about JavaScript and also a widget that allows to enter a variable in URL's
    Lilybiri

  • Write / read objects to/from File

    Hello,
    I have a problem with the writing and reading objects to/from a file.
    So what excatly I'm trying to is:
    I have a class Data. A thread creates constantly (until some limit) objects of this class Data.
    Once an object is created, is placed in a buffer (I wrote my own class DataBuffer extention of LinkedList).
    I have a limit on this buffer, so when the limit is reached, another thread starts getings objects from the buffer, writes them on the disk and removing them from the buffer.
    I'm putting the object always on the "top" and I'm reading them and removing always from the "bottom" of the buffer (FIFO).
    For writing the objects Data to the file, I'm using a FileOutputStream and ObjectOutputStream:
    I have something like that:
    FileOutputStream fos = new FileOutputStrea("file_name");
    ObjectOutputStream oos = new ObjectOutputStream(fos);after that I have this:
    while(size > i ){
                        try {
                             Data d = buff.getData();
                             //write to File
                             oos.writeObject(buff.getData());
                             oos.flush();
                             buff.removeData();
                             System.out.println("written data " + d);
                             i++;
                        } catch (IOException e) {
                             e.printStackTrace();
                   }here size is the limit for the buffer.
    So, when the size is equal to the total number of objects that were created and placed in the buffer, I have no problems with the writing/reading from the file.
    But if size is equal, for example, to the half of the total number of objects that were created, I have a problem.
    A more detailed exmple is:
    10 objects were created, the 10 objects were places to the buffer, a test was made and all the objects were written on the disk -> writing and reading are OK.
    if 10 objects were created, and I want to write 5 objects, and after that more 5, the first thing I remarqued is that the size of the file is different from the size of the file created by the first method. Second thing is when I'm reading from the file I can read only 5 objects and after that I have this exception:
    java.io.StreamCorruptedException : invalid type code : AC
    So ... is anyone has an idea why I have this problem?
    PS. For reading from the file I'm using another thread that executes this code:
    fis = new FileInputStream(readFile);
                        ois = new ObjectInputStream(fis);
                        while(true){
                             try{
                                  Data d = (Data)ois.readObject();
                                  System.out.println("data read " + d); //here I'm displaying the object that was read
                                  buff.putData(d);
                             }catch(EOFException e){
                                  break;
                        ois.close();
                        fis.close();
                   }catch (FileNotFoundException e) {
                        e.printStackTrace();
                   }catch(IOException e){
                        e.printStackTrace();
                   }catch (ClassNotFoundException e) {
                        e.printStackTrace();
                   }Regards,
    Anton
    PS. At present I'm writing first all the Data objects, and after that I'm trying to read from the file.
    Edited by: anton_tonev on Oct 5, 2007 4:14 AM

    Hello again :)
    Finally I found the solution :)
    In fact it is important to not to close the FileOutputStream and ObjectOutputStream until all the data was written on the disk.
    What I mean:
    in the begining of the program you have to open these two streams and write down the data that comes from somewhere.
    But you musn't close these streams before the final writing on the disk.
    It must look like this:
    1 Open file stream & opent object stream
    2 you're writing your all objects: one by one; 10 by 10 or as you wish ... but after each writing down you don't close the streams
    3 you already finished with the writing, (the end of your program), now you can close the streams.
    Unfortunatly I don't know why if I write the data and close the stream every time, after that it is impossible to append new data (with reopen the file)

  • How to Write/Read to files from Forms 6.0

    I would like to write some data to a file from Developer 2000.
    I should also be able to change the Font, color and size of the data written to the file.
    Mail Id : [email protected]
    Need a reply at the earliest.
    Thanking you, in advance
    null

    Dear Vinayak prabhu,
    I cannot make use of the stored procedure (using the util_package) or the Text_io package (from forms). This is because, only normal operations (like put_line,get_line...)are possible using the above procedure calls.
    Since I would like to change the "size" and "font" of the text written to the file, i would be requiring a procedure (package) wherein the above properties can be set for each line or para or page ..etc.
    Can you suggest me a suitable solution ?
    Ramnath Balasubramanian
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by vinayak prabhu ([email protected]):
    Hi Ramnath
    In forms you can use text_io package to read or write to a ASCII file or else write a stored procedure and use util_file which also does the reading and writing to a ASCII file.This stored procedure can be called from a form.
    Vinny.
    <HR></BLOCKQUOTE>
    null

  • Reading CRM Survey value from buffer

    Hello Experts,
    Does anybody know how to read survey values from the buffer?  I've only found the function module to read from the database which it will be to late as I want to read the value in the save badi.
    Thanks,
    --Jamie.

    You can read the stored survey guid by passing the activity guid where the survey is stored.
    call function 'CRM_SURVEY_DATA_GET'
    exporting
    iv_object_guid = Activity guid.
    importing
    et_survey_ui = lt_survey_ui
    exceptions
    error_occurred = 1
    others = 2 .
    Once you got the surver guids and version information in lt_survey_ui then pass the values to the below FM to get the stored XML data.
    call function 'CRM_SVY_DB_SV_READ'
    exporting
    valuesguid = ls_survey_ui-valueguid
    valuesversion = ls_survey_ui-valueversion
    tables
    surveyvalues = lt_surveyvalues
    You should be able to read the Filtered XML data from the table
    lt_surveyvalues.
    Regards,
    Krishna Murthy.

  • How to read value(entities) from disabled people editor control ?

    I am not able to read value from disabled people editor control. It is giving me count as zero. 
    As a workaround 
    I used :
    PeoplePicker.ShowButtons = false;
    PeoplePicker.AllowTypeIn = false;
    instead of
    PeoplePicker.Enabled=false :
    It stopped user from entering values in people editor but it is not controlling "BackSpace" i.e user can delete existing entities from people editor.
    NOTE : I have to achieve it through server side code or javascript only without using JQuery

    Hi,
    According to your post, my understanding is that you want to read value(entities) from disabled people editor control.
    Every time fill resolve is called
    FillClaimsForEntity is also called, you can use server side codeto get the value.
    Here is a similar thread for your reference:
    http://blog.krichie.com/2012/03/14/peopleeditor-resolvedentities-always-zero-when-control-is-disabled/
    In addition,  as a workaround, you can read the People Picker control value and added the value in a span and appended the span HTML into the ParentNode container for People Picker control, and hid the People Picker textbox, picker
    image and address book image.
    The article below use the JQuery to achieve it, you can also use JavaScript. Please refer to:
    http://www.c-sharpcorner.com/UploadFile/Ravish001/disable-people-picker-in-list-form-editform-aspx-using-jqu/
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

Maybe you are looking for

  • How can I hide the password and user name in url???

    Hi experts, I'm creating a login page and know I have a problem. The Username and password are verified in a Java class, after checking the user and password, the user should be linked to the portal. So far everything has worked well. But when I call

  • Audio quality in video imported from VHS tapes

    Hi All, I am trying to import old videos on VHS tapes, using a Canopus converter. The video is importing into iMovie just fine, but the audio has a loud buzzing sound that covers up the actual audio and is very annoying. Is there a way to extract the

  • How to initialize a Type Object??

    Hi, I have a procedure as below, which has type t_r_rep_data and a table having this type as record, but when I called this procedure, it has ORA-06530 error: Reference to uninitialized composite. Can you tell me how to initialize a type Object? Also

  • BT Broadband Usage Monitor

    I'm trying to keep a daily check on my Broadband usage; reason I overshot my limit last month. But looking at the BT BBand Monitor it seems that it is not updated consistently. At times the amount used increases but the dates of usage do not change.

  • Error in Activating Business Content

    Hi all, When trying to activating the technical content infosources from business content , I am getting the error "DataSource 0TCTAGGRST_TEXT from source system BWDCLNT200 could not be activated" , I have checked the source system everything seems t