Using vector in labview

Hello,
I'm verry new in labview so I don't know a lot about it (yet).
I use a Vision assistant from labview to detect red points in a scene, another one assistant to dectect blue points and a third one  to detect green points. I receive coordinates and area of each point detect by all the assistants, for each color I only use the two biggest point. So Now I have six points, two of each color.
For the experience I'm working on, I need to give a ID to each points, red => 1 and 2, blue => 3 and 4, green => 5 and 6. 
All of these work perfectly. I need help for the following:  I need to calculate the angle between the vector 12 and 23 and the vector 23 and 56.
I have no idea how to it in labview and the only stuff I found on the web was the NI documentation on Unit vector, and i havn't understand anything...
Thanks for your help !

convert the vectors to complex (x=RE, y=IM), subtract pairwise, then get theta.
LabVIEW Champion . Do more with less code and in less time .

Similar Messages

  • CCP command to ECU using Vector CAN cardXL

    Hello ,
    I want to know ECU measurement and calibration tool kit support Vector CAN CardXL.
    How to communicate to ECU using CCP command using Vector CAN cardXL in Labview 8.0.

    No, the toolkit does not support Vector products. It only supports NI boards.
    DirkW

  • Exception IndexOutOfBoundsException using Vector. Christmas homework!

    Hi everyone, I'm not a java expert (almost a newbie, I would say) and this is the first time I post anything in a Forum. I have the following piece of code:
    public class Test extends javax.swing.JFrame {
    private java.util.Vector list;
    public Test() {
         super("test");
         list = new java.util.Vector();
         javax.swing.JButton add = new javax.swing.JButton("Add");
         add.addActionListener(new java.awt.event.ActionListener() {
              public void actionPerformed(java.awt.event.ActionEvent e) {
              String value = "new element";
              System.out.println("size: "+list.size());
              list.add(value);
              int i = list.size();
              System.out.println("size + 1: "+i);
              /**/System.out.println("elem i: "+ (String)list.get(i));
         getContentPane().add(add);
         pack();
         setVisible(true);
    public static void main(String[] args) {
         new Test();
    and when I run it I have the following printout:
    size: 0
    size + 1: 1
    java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 1
    at....
    (omissis)
    Does anyone have any idea of why? how can I solve the problem? Isn't Vector supposed to be "dynamic"?
    Elsewhere I use Vectors with no problems but I am not accessing it right after having added any element, rather I return it as the result of some elaboration and then access it.
    I know it's Christmas time and so I wish you all Merry Christmas and Happy new Year. I hope someone has time to answer me over this holydays.
    Thanks anyway,
    Rosario

    Does anyone have any idea of why? how can I solve the
    problem? Isn't Vector supposed to be "dynamic"?You try to access an element after the last element. When you set i = list.size(), i will be the index of the last element plus one. This is because indices count from 0.
    It is the list.get(i) that causes the problem.
    Søren

  • Is there a way to "mix" colors using vectors?

    Here's my problem: I'm not a very technical and detailed artist, and I'm not trying to be. My works is pretty cartoonish actually, so I never dabble with the paintbrush and always use vectors. Anyhow, I was wondering, if I want to draw, using vectors, a guy with half of his legs in a pool, and half not, how would I go about coloring that? I mean, I'm intending to make the man pinkish, and the water light bluish, but how can I achieve the mixture, a combination of the two, for the half of the legs underwater? I'm not seeking color recommendations (for the legs) by the way. Is there a way to combine two colors to achieve an in-between ground?

    Put the legs on one layer and put the water on another layer above/in-front and adjust the opacity of the water-layer to let some of the leg-layer show through.  If you don't want to construct your cartoon using layers which is one of Photoshop's main benefits, you can figure out what color to make the wet leg with by creating a swatch of leg color in one layer and then make a water-colored layer in front/above it and adjust the opacity then use the eyedropper to sample the color of the combination.
    Of course in a real situation with the observer above the level of the water looking through it at an angle, the leg would become bluer the further into the water it went because there would be more water between the foot and the observer than say the knee and the observer and you'd want to make a gradient of color or gradient of transparency using a layer mask with a black-to-white gradient in the mask instead of just one opacity setting, and there would also be some size and offset of the leg due to refraction of the water, but as you said you're not a detailed artist.

  • I would like to convert a matlab file into a .dll and use it in LabVIEW. However, when I run the .dll in LabVIEW I get an error stating "... Procedure not found". What could this be? Can anyone help me...

    I wish to convert my Matlab files into .dll's so that I can use them in LabVIEW. I am using 'mcc' and 'mbuild' of Matlab to convert my .m files into .c and .dll.
    When I try to run the .dll's in LabVIEW, I get an error message in a modal window stating some required .dll or procedure is not found.
    How should I resolve this issue. Should I add any other Matlab .dll's in course of making my .dll?
    Please help in solving this issue... Thankyou very much.

    KJV wrote in message news:<[email protected]>...
    > When I run the matlab generated dll, it is stating 'matllb.dll not
    > found'. Is it that I should set the path for matlab\bin to include
    > all the dll's before I compile? When I make dll from C, it works fine
    > in LabVIEW. The problem is from .m to .dll. The problem also arises
    > when I convert my .m to .exe. The same error of 'matllb.dll not
    > found' comes over. Should I change my matlab compiler options or
    > something else? Please help me?
    I have the same question,I don't know how to use the matlab DLL file in labview,
    I hope someone can descripe the procedure in detail.

  • How to use dll in Labview ?

    I compile this code to dll file with VC++2010 filename is test_dll.dll .
    #include "stdafx.h"
    #include <iostream>
    #include <Windows.h>
    using namespace std;
    int main(int a){
        cout << "Test dll...............\n";
        return a;
    After that, I put Call Library Function node in editor and double click Call Library Function node. I browse test_dll.dll into Library name or path and set function prototype to int32_t main(int32_t a); but it show error Call Library Function Node 'test_dll.dll:main':function not found in libraly. How to use dll in Labview ?  And I have more question is what is differrent from Tools -> Import -> Shared Library(.dll) and use Call Library Function node.
    Solved!
    Go to Solution.

    The issue you are having is that LabVIEW is not capable of using C++ DLLs directly. It only handles C DLLs. This does not mean that if you you cannot use the DLL if it's compiled with the C++ compiler as opposed to the C compiler. Rather, it means that you must take extra steps in order to use it from LabVIEW. The primary issue is that of name mangling or adornment. This is discussed here: http://zone.ni.com/devzone/cda/tut/p/id/4877. Basically you need to prepend extern "C" in front of your prototypes in your header files. I would also suggest reviewing this article: https://decibel.ni.com/content/docs/DOC-14564.

  • How to use Vector or other ArrayList etc to store my JTree??

    How to use Vector or other ArrayList etc to store my JTree??
    Dear friends,
    I have following I posted before, but not get satisfactory answer, so I modify and repost again here.
    I have following code can add classes and students in the JTree,
    in class Computer Science, it has student Bill Brien,
    in Math, no,
    Then I I add Student Nancy, Laura, Peter into Computer Science Class,
    add AAAA, BBB, CCC into Math class,
    I create a new class called Chemistry, then I add DDD int Chemistry;
    so this JTree is dynamically changed,
    [1]. How can I dynamically save my current JTree with all above tree structure and its nodes in a Vector or ArrayList(not sure which one is best)??
    see code below:
    import java.awt.BorderLayout;
    import java.awt.Container;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTree;
    import javax.swing.tree.DefaultMutableTreeNode;
    import javax.swing.tree.DefaultTreeModel;
    public class ModelJTreeTest extends JFrame {
      private JTree tree;
      private DefaultTreeModel model;
      private DefaultMutableTreeNode rootNode;
      public ModelJTreeTest() {
        DefaultMutableTreeNode philosophersNode = getPhilosopherTree();
        model = new DefaultTreeModel(philosophersNode);
        tree = new JTree(model);
        JButton addButton = new JButton("Add Class/Students");
        addButton.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent event) {
            addPhilosopher();
        JButton removeButton = new JButton("Remove Selected Class/Students");
        removeButton.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent event) {
            removeSelectedPhilosopher();
        JPanel inputPanel = new JPanel();
        inputPanel.add(addButton);
        inputPanel.add(removeButton);
        Container container = getContentPane();
        container.add(new JScrollPane(tree), BorderLayout.CENTER);
        container.add(inputPanel, BorderLayout.NORTH);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setSize(400, 300);
        setVisible(true);
      private void addPhilosopher() {
        DefaultMutableTreeNode parent = getSelectedNode();
        if (parent == null) {
          JOptionPane.showMessageDialog(ModelJTreeTest.this, "Select Class", "Error",
              JOptionPane.ERROR_MESSAGE);
          return;
        String name = JOptionPane.showInputDialog(ModelJTreeTest.this, "Add Class/Students:");
        model.insertNodeInto(new DefaultMutableTreeNode(name), parent, parent.getChildCount());
      private void removeSelectedPhilosopher() {
        DefaultMutableTreeNode selectedNode = getSelectedNode();
        if (selectedNode != null)
          model.removeNodeFromParent(selectedNode);
      private DefaultMutableTreeNode getSelectedNode() {
        return (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();
      private DefaultMutableTreeNode getPhilosopherTree() {
        DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode("Students");
        DefaultMutableTreeNode ancient = new DefaultMutableTreeNode("Computer Science");
        rootNode.add(ancient);
        ancient.add(new DefaultMutableTreeNode("Bill Brian"));
        DefaultMutableTreeNode math = new DefaultMutableTreeNode("Maths");
        rootNode.add(math);  
        DefaultMutableTreeNode physics = new DefaultMutableTreeNode("Physics");
        rootNode.add(physics);
        return rootNode;
      public static void main(String args[]) {
        new ModelJTreeTest();
    }the actual Tree dynamically created somehow looks like following:
                             |            1.Peter
                             |---CS---    2. Nancy
                             |            3. Laura
                             |            4.Brian
                             |
    Root(University): -------|---Math- 1.AAA
                             |            2.BBB
                             |            3.CCC
                             |
                             |
                             |---Chemistry- 1. DDDThanks a lot
    Good weekends

    you can't directly store a tree in a list.Ummm... Just to be contrary... Yes you CAN store a tree in a table.... In fact that's how the windows file system works.
    Having said that... you would be well advised to investigate tree data-structures before resorting to flattening a tree into a list.
    So... Do you have a specific requirement to produce a List? Your umming-and-erring about Vector vs ArrayList makes it sound like you're still at the stage of choosing a datastructure.
    Cheers. Keith.

  • I got a java excutable file and document from the instrument supplier I want to use it in labview , I want to Know how to do it , step by step

    I got a java excutable file and document from the instrument supplier I want to use it in labview , I want to Know how to do it , step by step
    Attachments:
    this is a java file changr the jpg to jar .jpg ‏101 KB

    I'd recommend searching the forums to find your answer.  http://forums.ni.com/ni/search?submitted=true&q=java+labview

  • How to use vector in JTable? Please help......

    Hi there
    I can use JTable using object array to manupulate data but it has a limitation of defining number of rows of the array. Alternatively i want to use vector. Anyone help me how to convert to using vector.
    Regards.
    mortoza, Dhaka

    hi,
    you could either use javax.swing.table.DefaultTableModel because this class uses a java.util.Vector for data storage or you could implements your own TableModel by extending javax.swing.table.AbstractTableModel.
    best regards, Michael

  • I have got a 1500 Kinetic Systems CAMAC crate and 3922 controller. I want to use it with LabView inst

    alled in PCI-bus IBM PC, which does not have GPIB interface. Which way would be easier for developing my own instrument driver: a new GPIB controller + interface or 2915 Kinetic Sys. PCI-bus in-slot interface? Can the latter interface be used with LabView?
    Many thanks.
    Victor. I have got a 1500 Kinetic Systems CAMAC crate and 3932 controller. I want to use it with LabView installed in PCI-bus IBM PC, which does not have GPIB interface. Which way would be easier for developing my own instrument driver: a new GPIB controller + interface or 2915 Kinetic Sys. PCI-bus in-slot interface? Thanks

    alled in PCI-bus IBM PC, which does not have GPIB interface. Which way would be easier for developing my own instrument driver: a new GPIB controller + interface or 2915 Kinetic Sys. PCI-bus in-slot interface? Can the latter interface be used with LabView?Victor,
    I couldn't find an Instrument Driver for the 3932 crate controler. There is a driver for the 3988: http://zone.ni.com/idnet97.nsf/9b2b33e1993d877786256436006ec498/045f8392cc4d1b01862568ab005fbb49?OpenDocument
    If you look at the driver it isn't too complex. Well ... actaully there are certain differences when using the 3988 GPIB controller that the driver takes care of that relate to correctly passing commands (FAN).
    If the 3922 controller is similar then maybe you can use the 3988 driver and modify it to meet your needs. I'm not familar with the 2915 Kinetic system so I'm not sure what would be easier.
    If you have a GPIB board, then you could try using the 3988 driver with your 3922 controller and see if you can modify the driver to get things to work.
    I
    've only used the 3988 and that was quite three years ago but it might be worth a try.
    Best of luck,
    Kamran - NI

  • Problems using Vector in Flex Builder 3

    I've been using Vector with no problems in Flash Builder Beta, but when I try the same thing in Flex Builder 3, the compiler throws a fit when I use it. 
    public function PuzzleEvent(type:String, pieces:Vector.<Sprite>, bubbles:Boolean=false, cancelable:Boolean=false)
         //handle PuzzleEvent
    The other strange thing is, Flex automatically adds this line when I use vector:
    import __AS3__.vec.Vector;
    An import shouldn't be necessary should it?  Vector is in the top level package right?  With or without that import statement, I get compile errors.  Has anyone else had such problems with vector in Flex Builder?
    Dan

    The only way I was ever able to solve this problem was to use Flex builder Beta and now Flash Builder 4.  I did target flash player 10.0.0, but I still never could get it to work.  At least it works in Flash Builder 4.

  • Hi!!!I need your help!! Does anyone know if there is any Modbus lib or Modbus driver to use this en Labview BUT in LINUX?

    I am using Labview to comunicate with ADAM modules, but I want to comunicate with them using Modbus protocol. I don´t want to use "ADAM protocol" ASCII comands that the modules can understand.
    So I need a Modbus driver or Modbus libraries. The PROBLEM is that I am using LINUX!!!!!!!!!!!!!!!!
    I am looking forward to your answer!!
    Graci

    Bichillo wrote:
    > hi!!!I need your help!! Does anyone know if there is any Modbus lib or
    > Modbus driver to use this en Labview BUT in LINUX?
    >
    > I am using Labview to comunicate with ADAM modules, but I want to
    > comunicate with them using Modbus protocol. I don´t want to use "ADAM
    > protocol" ASCII comands that the modules can understand.
    > So I need a Modbus driver or Modbus libraries. The PROBLEM is that I
    > am using LINUX!!!!!!!!!!!!!!!!
    Please don't shout. It's deafening my ears!
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Ignition Switch to use in a Labview panel?

    Has anybody programed vehicle ignition switch to use in a Labview panel to interface to a simulator?

    Chris,
    I don't have experience in designing such systems, but here is one document that I think will help you in your design.
    Building Flexible, Cost-Effective ECU Test Systems
    I was able to find few other articles when I searched on Google for "ignition switch" and labview.
    Zvezdana S.

  • Using Vectors in Entity Beans

    Hello,
    Can I use vectors in entity and store them in Tables directly as binary objects.I have tried making that bean but facing problem in retriving data from table using EJB-QL.Here are code snippets:
    -------public abstract class CartEntityBean implements EntityBean {
         private EntityContext ctx;
         public abstract String getCartId();
         public abstract Vector getItems();
         public abstract void setCartId(String CartId);
         public abstract void setItems(Vector items);
    public String ejbCreate(String cartId,Vector items) throws CreateException {
              setCartId(cartId);
              return cartId;
    rest other methods omitted
    public interface CartHomeInterface extends EJBHome{
    public CartRemoteInterface create (String cartId,Vector items )throws CreateException,RemoteException ;
    public CartRemoteInterface findByPrimaryKey(String pk) throws FinderException, RemoteException;
    public Collection findmyItems() throws FinderException, RemoteException;
    I am using Cloudscape as Database.
    Please help weather I can use Complex objects in Entity Beans or Not

    this is no good idea to store the cart-items as a java-vector. you should create a entity bean cart and a entity bean cartItem. then create a cmr between the two entity beans.

  • Does anyone know how to use ELVIS in Labview to get current and voltage measurements?

    Trying to use ELVIS in Labview to get measurements with a NI myDAQ.

    I have changed from using the ELVISmx driver as I was unable to call on the digital multimeter of the myDAQ twice, I have set up a VI using the DAQ assistant with the myDAQ, I am using the AI0 port for a voltage reading and using the DMM for my current reading, the circuit is working as I am measuring the voltage on a resistor after the ammeter but I am unable to get a current reading in order for it to work. If I have something wired wrong please let me know, thank you. My circuit is a 12VAC power supply, going through a potentiometer to drop the voltage to 8VAC, which passes through a resistor, ammeter is in series after this and attached to another resistor to complete my loop, the AI0 for my volt meter is connected across the second resistor, I have the proper voltage reading when I run the VI, but am unable to get a current input. Thanks for the help.
    Attachments:
    Mikes Project2.vi ‏131 KB

Maybe you are looking for