LabVIEW + phidget (ratiometric setting)

Hello

Quick googling produced this: Labview manual IFSetRatio: http://www.phidgets.com/documentation/web/LabVIEWDoc/index.html?ifsetratio.htm

Tags: NI Software

Similar Questions

  • Information from LabVIEW to TestStand using a notifier TestStand and the SetEx method

    Hi all

    I'm trying to use the parameter dataPropObj of the SetEx method to send information of LabVIEW TestStand during setting of the notifier. The works of declarant perfectly by itself when I wire variant empty constant by default entry dataPropObj of the INotification invoke method node, but all that is wired in causes some kind of problem. I tried wiring a string (which, according to the description of SetEx, should work), as well as a string converted to a Variant. If the string is empty, no work. TestStand hangs at step waiting for this notification. Again, the notification works very well when I wire only a constant varying vacuum at the dataPropObj of entry.

    All this is to work as part of a larger VI, but I extracted just this feature on its own sequence and vi, so there should not be other interfering factors I can think. If it makes a difference, the VI is called asynchonourly during the cleanup of the MainSequence group. I have to do this by calling a sous-suite as a new thread.

    Any help is appreciated.

    Thank you

    You must use Engine.NewPropertyObject () to create the variable you pass to the dataPropObj parameter. For example, if you want to pass a string, you must do the equivalent of:

    PropertyObject myPropObj = Engine.NewPropertyObject (PropValType_String, false, "", 0);

    myPropObj.SetValString ("", 0, MyStringValue);

    Hope this helps,

    -Doug

  • Call a VI that uses the 'exec.vi system' with the LabVIEW runtime as adapter

    Hello

    My TestStand sequence called a VI that includes a call to 'exec.vi system '. When I try to load it in TestStand and if LabVIEW adapter is set to the runtime, I get an error message «Unable to load Vi...» ». If I change the map to the 'development system', then it works fine.

    Is it possible to use the 'exec.vi system' in a VI that is called by TestStand with LabVIEW run-time?

    Thank you

    Alex

    Hi Alex,

    In case you, you get an error-18002.

    The reason is explained in the following link:

    -18002 errors in TestStand

    http://digital.NI.com/public.nsf/allkb/D82FEAF0B4BA293A862575710053E252?OpenDocument

    Please take a look at # 2. This is your case.

    It will be useful,

    Regrads

  • Download the Version of the LabVIEW project

    Lets say I have a random LabVIEW file.  Can I use the Get file Type.vi in the VI.lib to understand what the file type.  It could be an Instrument, control, project, library, XControl or one bunch of others.  If it is a VI I can use the Version of VI get call node to find what version of LabVIEW, it was made with.  If it is a library I can use the Version of LabVIEW in the Library.Get file for the version, or if it's a project I can use the LabVIEW Version of the Project.Get file.

    What I find strange, is if I have a VI in 2013, and I run the node invoke for the version of LabVIEW reading but my development environment is 2011, he will say that the VI was marked by 2013.  But if I have a project saved in 2013 and use the node invoke for the version, and my development computer is 2011, I get an error indicating that the file version is later than the common mistake of version LabVIEW 1125.

    Is this a bug?  I mean I read the project file as text and analyzed with an XML parser version.  So why this function choke and die trying to read the most recent versions of file, but a VI and the library can be read without problem?

    There was a bug in the "Project.Get LabVIEW Version file" method. LabVIEW has been set in 2012.

  • Programming a c application that calls a *.so built by LabVIEW.

    Hi all

    This question has probably been asked, but I can't find the answer.  So here's my question:

    I built a *.so LabVIEW under Linux and I would like to call from a 'c' application  The *.so LabVIEW returns a set of strings, and I want to know how to call from my c (memory allocation?) application.

    Here's the *.so source code, the function is named "testvi":

    Here is the source code of my c application:

    #include 
    #include 
    #include "testclusterofstrings.h"
    
    int main()
    {
        Cluster_Of_Strings clusterofstrings;
    
        Testvi(&clusterofstrings);
    
        printf("-------------\n");
        printf("String_A: %s", (*clusterofstrings.String_A)->str);
        printf("-------------\n");
    
        return 0;
    }
    

    I am getting the output when calling my next application:

    LabVIEW caught fatal signal
    13.0 - received SIGSEGV
    Reason: address not mapped to the object
    Try to reference the address: 0x0x19f5c381
    Segmentation fault (core dumped)

    So, what is the right way to do it?

    Thank you

    Michel

    smithd wrote:

    If it is a dll built labview and you pass parameters by reference, I'm not too surprised to initialize (although I expect labview to be kind enough to allocate the data structures for you). Maybe if you spent it a pointer to null instead it would work? Since your original post, maybe try this:

    int main() {}

    Cluster_Of_Strings * clusterofstrings = NULL;

    Testvi(clusterofstrings);
    .... }

    For some reason, I remember reading that labview will interpret the null as a sign that it must allocate the structure, but I could be completely crazy on this point.

    If it does not, then Yes you will have to allocate all the handles according to the case. Of \cintools\extcode.h you can see that a string is defined as follows:

    typedef struct {}
    Int32 cnt; / * number of bytes following * /.
    uChar str [1]; / * cnt bytes * /.
    } LStr, * LStrPtr, * LStrHandle;

    Since you have arrays of size-0 I think you really need to call DSNewHClr(sizeof (int32)) which will allocate a handle with all 0, and 0 is what you want. End result would be...

    int main()
    {
    
        Cluster_Of_Strings MeasInfo;
    
        MeasInfo.String_A = (LStrHandle)DSNewHClr(sizeof(int32));
        MeasInfo.String_B = (LStrHandle)DSNewHClr(sizeof(int32));
    
        Testvi(&MeasInfo);
    ....
    }
    

    Oh and for string functions, make sure that you look at the built-in functions first before making your own.

    In fact, all this is as well a little easier and more complicated at the same time. LabVIEW is entirely managed with its data types, but you must follow this management contract when you interface LabVIEW C code.

    First of all, the first attempt to assign a string handle with sizeof (int32) + sizeof (uChar) bytes without initialization of the length element is bad. This element of length can contain any value and cause LabVIEW wrongly that the handle is already large enough to fill its data and not to do anything and then by writing over the end of the allocated buffer.

    Also equipped to initialize the structure with the value NULL is not going to work. This group should be provided by the appellant that this is a region of data of fixed size passed as a pointer. However, initialization of the string inside the cluster with NULL handles should work fine, since LabVIEW considers NULL manages as the canonical zero length handle.

    However after calling the LabVIEW DLL function you are the owner of all memory that is allocated by this function and comes back to you, just as you would be if you had allocated those manages yourself before the call. So label correct is also deallocate it and it is not an option, but a requirement or you create memory leaks. He isn't getting noticed here since your test program ends in any case just after, but he bite you bad in a larger application if you forgot it.

    The code would then look like this:

    int main()
    {
        Cluster_Of_Strings MeasInfo;
    
        MeasInfo.String_A = NULL;
        MeasInfo.String_B = NULL;
    
        Testvi(&MeasInfo);
    
        printf("-------------\n");
        printf("String_A: %s\n", LV_str_to_C_str(MeasInfo.String_A));
        printf("String_B: %s\n", LV_str_to_C_str(MeasInfo.String_B));
        printf("size %d", (sizeof(int32) + sizeof(uChar)));
        printf("-------------\n");
         if (MeasInfo.String_A)            DSDisposeHandle(MeasInfo.String_A);        if (MeasInfo.String_B)       DSDisposeHandle(MeasInfo.String_B);   return 0;
    }
    // Returns the pointer to the string buffer in a LabVIEW string handle that has been made// sure to be zero terminated.char *LV_str_to_C_str(LStrHandle lv_str){    if (lv_str && !NumericArrayResize(uB, 1, (UHandle*)&lv_str, LStrLen(*lv_str) + 1))    {        LStrBuf(*lv_str)[LStrLen(*lv_str)] = 0;        return LStrBuf(*lv_str);    }    return NULL;}
    
  • LabVIEW IMAQ: How to release a one-shot cushion of space

    Hello

    We use IMAQ version 14.5.0.

    We have management problems of the buffer that IMAQ uses to store acquired images.

    We are releasing a device of linear scan at very high speeds (~ 145 000 lines per second) using an external clock sent via the RTSI cable pulse.

    In our LabVIEW program, we set up a list of ~ 200-element buffer and set the parameter of "Continuous?" to "One-shot", so that pads spaces will successively be filled by the camera and no data is lost. (We can't use "Continuous" or else the data is lost)

    Then, we enter into a software loop where each iteration:

    1. the device receives impulses clock ~ 200 to align the images ~ 200 (lines) to fill the list of buffers.

    2. the computer retrieves images buffer ~ 200 sequentially and records the data elsewhere.

    So we want to be able to fill repetitive the same list of buffer. The problem is, after the first iteration of the loop, "One-shot" buffer spaces are filled and may not be disclosed to the following iterations. So we end up 'extract' the images first ~ 200 over and over again, which of course is not useful.

    We tried to release buffer using "Extract IMAQ buffer VI" spaces, by entering "-1"to "stamp out"." But nothing helped.

    We looked at using "IMAQ dispose" of completely destroy the images and clear memory space buffer, then using "IMAQ Create" to make fresh buffer space memory. But we will have to do in each iteration of the loop - this is not practical, because we want to use the capabilities of the camera's high-speed.

    Is there a method to "erase" a space of "One-shot" buffer for subsequent iterations?

    A test version of our code is attached. Sync_Camera_v3 is the main VI.

    I deeply appreciate someone has suggestions to our situation! Thank you.


  • Calibration Executive

    I use to perform external calibration and adjustment on the module, PXI - 4070 FlexDMM Cal Exec 3.2.2.

    How to access the comments field to include additional information?

    Thank you!

    Hello Philippe,

    You can use the LabVIEW VI to set what appears in the comment field.

    We'll find these VI in the LabVIEW function palette. Go to IO action > DMM OR > calibration > calibration utility.

    Use the VI, to initialize the first DMM as shown in the image below.

    After you run the VI above, the comment for the device field is as follows

    Does that help?

  • Bug: Find/replace does not work if the statement contains the string is too long

    Hello

    in my sequence, I press Ctrl + F to open the Find dialog box and enter a string. All the checkboxes are checked 'Elements for search' and ' limit the search to "is not enabled.

    Now comes the finding it is only announcing the discovery in the main sequence.

    Other places in a sous-suite that are part of a labview vi action setting is not in the list. Also if I open the sequence and I'm looking at this place.

    If I create a comment in the subsequence containing the searchstring, then it is.

    When I open the properties of the action of labview and open the parameter that contains the string and click on check for errors, and then close all and supplementary search then the value lies.

    Is it possible that the variable is too long setting? It's about 200 characters and one thing very nested SationGlobals and the table and the TestSockets. Search string Dees is finally an arrayindex in this grand statement.

    It seems that this is the problem.

    Is this a known bug?

    Solved.

    There was an empty character at the end of the search string...

  • Why my custom device break only when VeriStand trying to run it?

    Hello

    I have a custom device, he worked for some time now, today, I made a few changes to add some features more and now VeriStand tells me the RT pilot is more executable.

    I have not change my build configuration or add any functionas that could bring in an external DLL, or something that could link incorrectly.

    Any ideas of how I could go on this shrinking.  The problem is that when running in VeriStand.  Built LLB has no problem, the source of the development has no problem, it's only when VeriStand tries to deploy there is a problem, so there must be something that is not bound correctly Yes?

    The system isn't RT, it's just deploy on Windows using a SMU.

    I am not sure the exact cause, but I ended up simply remove parts of the code piece by piece pilot to refine what was causing the problem. It turned to be a VI of debugging I used several times before in various projects, but which contains the string "call" LabVIEW primitive, but set apart from that, it's just a simple string manipulation.  So I don't know if it was just a few cases of random edge that occurred when running under code basic LabVIEW VeriStand clean, but for some reason, he broke the driver VI.

    So, solved the problem, but the cause, I can't really say.

  • Facing problem in OCR

    Hello world.

    I want to read the characters in the document. and I do not select the return on investment. My numbers will be in one line but its position will vary and this number are locked in the border. How can I detect numbers?

    Hello ddsdds,

    You can certainly detect patterns at the scale of an image. If you use Vision Assistant, I recommend trying the geometric stage corresponding tab of Machine Vision. If you click on the settings tab in the geometrical configuration of Matching, you will see four options for the types of games that will be detected. Check the box next to the option "Chipped" and set a range for the scale you want - 100 being the same size as the image of the model. This would allow you to detect a version to the scale of the image of the model.

    In LabVIEW, you can set the scale settings in the geometric model VI IMAQ Setup game using the entrance to 'Beach settings. " You can define a range of scale values to identify matches in the image. You could, of course, simply create a LabVIEW VI from a Vision Assistant script do that instead.

    I hope this helps.

  • Siemens Logo8 communication (0BA8)

    Hello, this forum has helped me a lot before, but now, I have to ask for your help.

    I have a problem with siemens Logo8 (0BA8) communication. I use for communication vi-s https://decibel.ni.com/content/docs/DOC-5467. I want to read and write to meters (see photo below) for example B035 K where the NTC is 5. I don't know how to read or write to these data. I guess that I do not process correctly. On s7-1200 successfully read/write to DB - s (choose DB and start address and that it is) but on the logo, I can connect but not read and write. Someone did it successfully and is ready to share that? I would be very grateful.

    Thank you for your time!

    Hello

    shalumdawg thanks for your help and sorry for the late reply. I know that I can connect because it reads something and answers, but not what I wanted and last week I found the solution.

    SoftComfort v8 Logo, you must map the addresses (software development for Siemens Logo8). You do this by going to Tools --> setting VM mapping... and there you set the addresses for what you want to read.

    Mine looks like this:

    In labview, you assign to database DB1 and use for example mapped addresses if you want to read meter B035 in labview, you can set playbackfunction, Transport to DWORDsize, replaced by 1length, data block # 1, add the surface of DB and the start address to 35.

    You can read all seven addresses at once using the same settings but playing selected to address 7 time and start the first address whitch you want to read (in this case 35) and you will get a table with all 7 parameters.

       

    Writing is performed by shanging function to write.

  • Replace and index space

    This is another one of those things that could be an exchange of ideas to some and one bug for the other.  If I have a table 1 d, and I use the Index function, it starts at index 0 without having to connect anything to the terminal index.  If I use a Structure of elements in Place and choose the Index and the spare board, I get a broken arrow if I leave the terminal wired UN index.

    Also if I am wiring an index with a value of 5, when I expand the bottom I expect for the element index 6, 7 and 8 and continue to the size of the index service.  This is once again where the native function of Index behaves differently from the index of PEI and replace it.  Is this a bug?  Is it an idea of how the International preliminary examination should work?

    It was already suggested here - http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Provide-good-defaults-for-unwired-indices-of-the-array...

    And here (which covers a slightly different behavior with > 1 d tables)- http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Allow-unwired-index-for-quot-Array-Index-Replace-Eleme...

    We also had a discussion that addressed the topic of the behavior of the IPES here - http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Set-index-inputs-on-LVOOP-array-element-accessors-to-R...

  • Can I have a global calibration for different images sizes in VBAI

    I run a VBAI algorithm on images from several cameras to linear scan.  We use a square, simple, calibration (.42mm/pixel) for each image, they are always 1024 pixels wide, but can vary in length of the image.  Currently, I use several instances of Calibration Wizard then 10 to account for variations in length, but it seems to me that the internal calibration resulting is the same for each instance.  So is it possible that I can set up a unique calibration use if for any length of the image?

    Thank you

    This is a feature that we added in the latest version of Vision Builder AI (2012), which will be available very soon.

    Would it be possible for you to use the LabVIEW execution step to calibrate your image? If so, you can call a LabVIEW VI that sets the calibration using IMAQ Calibration2 Simple to set, after the steps in the acquisition. Once the image is calibrated, all subsequent steps must return results calibrated, even if you do not use the VBAI built in calibration.

    Christophe

  • Dependencies missing cRIO due to legacy

    Hello

    I use LVOOP on an RT target where the following dependencies are missing:

    Class A {}

    b: class B

    }

    In this case, a class C inherits B is not among the outbuildings, C unless explicitly used.

    This can cause error, for example, if an instance of A is serialized and sent to the target.

    It would be sure to add all the classes that inherit from B for dependencies. Instead, LabVIEW ignores these set of dependencies.

    Is this a bug or a feature? LabVIEW support the addition of such dependencies?

    Thank you

    Peter

    There is no way to make LabVIEW automatically includes all the classes that are children of a specific class, because LabVIEW follow this dependence. Inheritance is a one-way relationship: a class knows her parents but not her children. This makes it possible to add the new class of the child at run time, for example a plugin that inherits from an existing class.

  • XNET removes the priority of SAE J1939 Message identifier...

    I am currenty using LabVIEW 2015 and set up a simple looping CAN test to test the J1939 XNET. I noticed that XNET seems to remove the message ID's priority. Example, I put the ID of the message to 0x18C45671 with '0 x 18' slice that contains the priority of the SAE J1939 message, she is received on the other side and displayed as "0xC45671". Why is this? I have attached a reference image.

    Further reading in the software and hardware manual OR XNET to 2015 has led me to this:

    "Standard frames, the full identifier is considered the CAN message identifier;

    in J1939, only the PGN determines the message. Images with the same PGN but different

    priority or source address are considered as the same message. "- Chapter 4, p 59.

    I understand that, but I don't disagree with the implementation of X-NET that removes the priority on the side of the reception (or is it just before transmission?). I would like to keep it, but this isn't a big problem I can live with that...

Maybe you are looking for