Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

01-17-2018 12:15 PM

Options

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hello everyone. I am new in the community. I was having trouble understanding the above vi.

Why do I get 2 rows ?

When I ran this vi , while loop count was 1. Then why did I get 2 rows?

Thank you.

Solved! Go to Solution.

Solution

Accepted by mayur95

01-17-2018 02:04 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Solution

Accepted by mayur95

01-17-2018 02:31 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

@mayur95 wrote:

When I ran this vi , while loop count was 1. Then why did I get 2 rows?

Remember that the loop iteration counter starts at 0. So a count of 1 means you iterated 2 times. Therefore, 2 rows.

There are only two ways to tell somebody thanks: Kudos and Marked Solutions

Unofficial Forum Rules and Guidelines

Solution

Accepted by mayur95

01-17-2018 03:54 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

There's a little tidbit I wanted to emphasize. The first call to Elapsed Time will result in an auto-reset behavior and consider that instant as t=0. It will run in parallel to DAQmx Read and finish pretty much instantly while DAQmx Read has to wait around 5 seconds for its samples. The next iteration starts about 5 seconds later and that's the reason Elapsed Time will return a True (at least 4 seconds have passed) and terminate the loop.

Even if you sequenced the functions in the loop so that DAQmx Read was called first, waited a full 5 seconds, and *then* you called Elapsed Time, it would *still* return a False on the first call. It wouldn't set t=0 to be the beginning of the loop iteration, it would still be the instant that Elapsed Time first executed.

-Kevin P

01-17-2018 11:28 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Thanks for the reply.

So , in all this vi should take almost 10 sec to complete , right?

Solution

Accepted by mayur95

01-18-2018 03:15 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

mayur95 wrote:So , in all this vi should take almost 10 sec to complete , right?

It will take at least 10 seconds.

There are only two ways to tell somebody thanks: Kudos and Marked Solutions

Unofficial Forum Rules and Guidelines

01-18-2018 05:58 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Thank you Sir.

05-11-2019 08:36 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

This algorithm is not robust as you keep playing with the rate and number of samples per channel it fails to make sense. Please have a look at the attached file, if rate is set at 5 as I should have 6 rows then ?

The first run makes a valid result, now try playing with the user inputs. As you see the algorithm failing to be consistent.

It's as if its failing to reset....well anyone could give it a try !

Highlighted
Options

There are only two ways to tell somebody thanks: Kudos and Marked Solutions

Unofficial Forum Rules and Guidelines

05-11-2019 04:28 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

@cobbPP wrote:

if rate is set at 5 as I should have 6 rows then ?

It is looking for 4 seconds to have passed since the first loop iteration began. If you are running at 5 Samples/second, then each loop iteration should be 1 second ( (5 Samples) / (5 Samples/second) = 1 second). Assuming everything is ideal, you will have read elapsed times of {0, 1, 2, 3, 4}, which will give you 5 rows. Of course, you have weird software timing in the mix as well, which could add some time. Probably not enough to mess this up though.

There are only two ways to tell somebody thanks: Kudos and Marked Solutions

Unofficial Forum Rules and Guidelines