Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7923933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T17:29:41+00:00 2026-06-03T17:29:41+00:00

When using Zaber’s LabVIEW driver to control their devices, it sometimes returns strange responses

  • 0

When using Zaber’s LabVIEW driver to control their devices, it sometimes returns strange responses to commands. For example, sending the Move Absolute command might return a Set Target Speed response or a Manual Move Tracking response, instead of the expected Move Absolute response. What causes that, and how can it be avoided?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T17:29:42+00:00Added an answer on June 3, 2026 at 5:29 pm

    The Cause

    The most common cause of this problem is that you used the Write Command VI to send a command, but never read the response. That response sits in the serial port’s receive buffer until you read it. If you later use the Request Command VI, it will write the new command and then read the response from the old command that’s still sitting in the buffer.

    That can confuse your code if you’re using the response data values to perform a calculation, but it can be even worse when you are requesting a movement command. The way that the Request Command VI knows when the movement has finished is that the device sends back a response. If there’s already a response in the buffer, then it looks like the movement finished immediately. Your VI will look as if it’s skipping movement commands.

    Here’s an incorrect example that shows how the problem can happen. The Move Relative command will not finish before the Move To Stored Position command is sent. All three of the following examples can be downloaded from our web site.

    Wiring diagram of responses handled incorrectly

    Another way to cause this kind of problem is to send a command to multiple devices using device number zero and only read the first response. (Each device will send its own response.) You can also cause problems if you use the manual control knob or a joystick while a VI is running. That movement will generate a bunch of responses when your VI wasn’t sending anything.

    Solution 1: Request Command VI

    The simplest solution is just to make sure that you read every response to every command. If you use the Request Command VI for each command, it will handle most situations properly.

    Here’s a corrected version of the previous example that now uses the Request Command VI.

    Wiring diagram of responses handled correctly

    If you send a command to all devices using device number zero, then you’ll have to adjust the response count so it knows how many responses to wait for.

    In more complicated scenarios like moving two devices at the same time, you can use the Write Command VI in combination with the Blocking Read Response VI to make sure that you receive all the responses. See the simultaneous requests example for more details.

    This solution won’t help if you are using the manual control knob or a joystick while the VI is running.

    Solution 2: Clearing the Buffer

    Maybe you’ve got a complicated VI that already has a bunch of writes and you don’t want to clean them all up, or maybe you want to use the manual control knob or a joystick while the VI is running. Perhaps the response pattern isn’t completely predictable for some other reason. If you can’t avoid getting extra responses in the buffer, you can clean them out when the craziness is over. Just use the Read Response VI (not the blocking one) and keep reading as long as it finds responses.

    Here’s the same example that now clears out the buffer. It pauses for ten seconds so you can use the manual control knob to generate some extra responses.

    Wiring diagram of responses cleared from the buffer

    One trick with this solution is knowing when the craziness has ended. Ideally, the devices should not be moving, and you should wait at least 20 milliseconds before you start clearing out the buffer. That gives time for the devices to process the last command and send a response. If the devices are still moving, then you’ll get an extra response when they finally finish.

    Solution 3: State Machine

    If your VI is really complicated or unpredictable, the state machine pattern can be a robust approach. Instead of closely tying each request with its response, the VI keeps track of a global state, and deals with each response separately. See Zaber’s Write Commands and Read Responses VI for another example.

    This approach is also useful if you have parallel loops sending commands. You can’t have two loops reading from the serial port at the same time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When writing a LabVIEW VI to control Zaber devices for a long test, can
Using C# (the .NET framework), I'm looping through all the TimeZones and their AdjustmentRules...
Using online interfaces to a version control system is a nice way to have
Using LINQ on collections, what is the difference between the following lines of code?
using (var file_stream = File.Create(users.xml)) { var serializer = new XmlSerializer(typeof(PasswordManager)); serializer.Serialize(file_stream, this); file_stream.Close();
Using Nunit, I want to be able to write a test fixture that will
Using a restful resource in Rails, I would like to be able to insert
Using Flex 3, I would like to take an image snapshot such as this:
Using PHP, I can convert MySQL data or static table data to csv, Excel,
Using C# for ASP.NET and MOSS development, we often have to embed JavaScript into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.