LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Motion and Measurement with User Input Example Search

Hi All,

 

I'm looking for examples of similar projects to the one i'm working on.  Basically I want LabVIEW to perform a simple stage move and then release a latch while measuring displacement from a displacement sensor.  Specifically, i'd like to set the parameters of the stage move, and allow a user to command the latch release.

 

I have a Newport XPS-D8 motion controller (using .NET LabVIEW controls), a Keyence laser displacement sensor, and an NI cDAQ controlling latch opening with a 10 V signal.  I have the VI's to run each piece of equipment on their own, but i need to put them all together.  From my searching, it looks like a Queued Message Handler, or a State Machine example would work, but i'm having trouble finding an example that would be specific enough to help me.

0 Kudos
Message 1 of 4
(3,026 Views)

Any tips or advice would be helpful also!

0 Kudos
Message 2 of 4
(2,986 Views)

This is an excellent illustration of one of the (mostly-ignored) Golden Rules of Software Development -- "Write the Documentation First".

 

     Don't worry about how you will control or sequence all of the devices that you have.  Instead, concentrate on what you want to do.  Here are some sections your Document should cover:

  • Describe the various sensors, along with a description of what they are measuring and at what data rate you need to interrogate each of them (they might not all be the same)
  • Describe what communication protocol your sensors use (VISA/Serial, TCP/IP, USB, etc.). 
  • Describe the general operation of the system when it is running, concentrating on how the various sensors and controls interact with each other.
  • Describe the minimum set of Controls you need on your Front Panel.  It might come down to two:  Start, and Stop.
  • Describe the outputs you need in general terms.  Again, don't concentrate on how to get the data, just on what you need to see.

Once you have the general layout of "what" you want to do, you may see that it follows a natural (single) sequence -- Initialize/setup, Start, Run/Display, Shut Down.  This suggests a single sequence, possibly best realized by having one VI do each of these four tasks, sequenced by using the Error Line and "parameter wires". 

 

If you need to start, stop, and restart, a State-Machine-like implementation, such as the Queued Message Handler (from NI) or the JKI State Machine, might be more appropriate.  Knowing in advance "what" you want each State to do will be very helpful in creating your code.  Note that there are "examples" of the Queued Message Handler -- start LabVIEW, go to New Project, and choose Queued Message Handler to build one.

 

Bob Schor 

Message 3 of 4
(2,945 Views)

Thanks, Bob,

 

I'm not sure if you were prompting me to send you this information or if you were simply suggesting that I do this as a helpful exercise for myself.  I had already done that, but my lack of experience with LV is the thing currently holding me up.  I'm pretty good at looking at examples and being able to customize them for my own use, but the examples that I've found for QMH and State Machines are too simple or designed for a completely different application.  Is it uncommon for people to post projects/sample vis for others to see?  It seems like the only examples I can find are textbook ones from NI.

 

Anyways, here's the writeup, that you maybe requested...

 

Devices:

  1. Newport XPS-D8 using .NET controls (TCP/IP)
  2. Keyence LK-G5001 Laser displacement sensor (TCP/IP)
  3. Micro-Epsilon DT6500 capacitive displacement sensor (TCP/IP)
  4. NI cDAQ 9185 with an NI 9269 (TCP/IP)

Test sequence:

  1. Initialize all connected equipment (button)
    1. Error if anything doesn’t connect
  2. Home stage (button)
  3. Clamp actuator using NI cDAQ; output voltage 10V (button)
  4. Move Newport stage to user indicated value (button) -> start recording Micro-Epsilon sensor
  5. Once in the final position, begin recording Keyence sensor displacement
  6. Wait for user input to release NI cDAQ 10 V latch (button) while recording Keyence and Micro epsilon signals
  7. Write displacement values to file (button)

 

User Control Panel:

  1. Newport
    1. Input IP Address
    2. Input displacement rate
    3. Input total displacement
    4. Home stage button
    5. Start test button [initialize recording of Micro epsilon sensor]
  2. Keyence
    1. Input IP Address
    2. Input acquisition frequency
    3. Display waveform graph
  3. Micro-Epsilon
    1. Input IP Address
    2. Input acquisition frequency
    3. Display waveform graph
  4. NI cDAQ
    1. Input IP Address
    2. Send voltage button (to clamp)
    3. Turn off voltage (release clamp) [Initialize recording of Keyence sensor]
0 Kudos
Message 4 of 4
(2,928 Views)