Jump to content

Shift register terminals as default for error clusters and reference


Recommended Posts

QUOTE(Tomi Maila @ Nov 20 2007, 03:46 AM)

When wiring error into a loop, the most common use case is to have a shift register to pass the error from iteration to iteration. Hence shift registers should be the default terminal type for error clusters when wired to a loop.

And refnums, too :)

Link to post
Share on other sites

QUOTE(Tomi Maila @ Nov 20 2007, 03:46 AM)

When wiring error into a loop, the most common use case is to have a shift register to pass the error from iteration to iteration. Hence shift registers should be the default terminal type for error clusters when wired to a loop.

And refnums, too :)

Link to post
Share on other sites

QUOTE(Tomi Maila @ Nov 20 2007, 03:46 AM)

When wiring error into a loop, the most common use case is to have a shift register to pass the error from iteration to iteration. Hence shift registers should be the default terminal type for error clusters when wired to a loop.

And refnums, too :)

Link to post
Share on other sites

QUOTE(Jim Kring @ Nov 20 2007, 03:00 PM)

And refnums, too :)

Why would you need refnums to be shift registers? Unless you're closing the reference within the loop and replacing it with a not-a-refnum constant, I'd expect they would pass through a loop unmodified, and I don't think there would be a benefit to using a shift register over a tunnel (although I don't think there would be a disadvantage, either, which might be enough to make your point).

Link to post
Share on other sites

QUOTE(Jim Kring @ Nov 20 2007, 03:00 PM)

And refnums, too :)

Why would you need refnums to be shift registers? Unless you're closing the reference within the loop and replacing it with a not-a-refnum constant, I'd expect they would pass through a loop unmodified, and I don't think there would be a benefit to using a shift register over a tunnel (although I don't think there would be a disadvantage, either, which might be enough to make your point).

Link to post
Share on other sites

QUOTE(ned @ Nov 20 2007, 10:17 PM)

Why would you need refnums to be shift registers? Unless you're closing the reference within the loop and replacing it with a not-a-refnum constant, I'd expect they would pass through a loop unmodified, and I don't think there would be a benefit to using a shift register over a tunnel (although I don't think there would be a disadvantage, either, which might be enough to make your point).

Because if for loop is never executed (N=0), the reference is not passed trough the loop, but a default NULL reference is returned at the other end of the loop instead.

Tomi

Link to post
Share on other sites

QUOTE(ned @ Nov 20 2007, 10:17 PM)

Why would you need refnums to be shift registers? Unless you're closing the reference within the loop and replacing it with a not-a-refnum constant, I'd expect they would pass through a loop unmodified, and I don't think there would be a benefit to using a shift register over a tunnel (although I don't think there would be a disadvantage, either, which might be enough to make your point).

Because if for loop is never executed (N=0), the reference is not passed trough the loop, but a default NULL reference is returned at the other end of the loop instead.

Tomi

Link to post
Share on other sites

QUOTE(Tomi Maila @ Nov 20 2007, 03:21 PM)

Because if for loop is never executed (N=0), the reference is not passed trough the loop, but a default NULL reference is returned at the other end of the loop instead.

Tomi

Ah, right. I've been bitten by that one before, and now my solution is usually to fork the wire outside the for loop.

Link to post
Share on other sites

QUOTE(Tomi Maila @ Nov 20 2007, 03:21 PM)

Because if for loop is never executed (N=0), the reference is not passed trough the loop, but a default NULL reference is returned at the other end of the loop instead.

Tomi

Ah, right. I've been bitten by that one before, and now my solution is usually to fork the wire outside the for loop.

Link to post
Share on other sites

QUOTE(Tomi Maila @ Nov 20 2007, 12:46 PM)

When wiring error into a loop, the most common use case is to have a shift register to pass the error from iteration to iteration. Hence shift registers should be the default terminal type for error clusters when wired to a loop.

EDIT: The same should apply for all reference types.

I agree absolutely.

Did you already suggest this on NI's site?

Link to post
Share on other sites

QUOTE(Tomi Maila @ Nov 20 2007, 12:46 PM)

When wiring error into a loop, the most common use case is to have a shift register to pass the error from iteration to iteration. Hence shift registers should be the default terminal type for error clusters when wired to a loop.

EDIT: The same should apply for all reference types.

I agree absolutely.

Did you already suggest this on NI's site?

Link to post
Share on other sites

QUOTE(ned @ Nov 20 2007, 03:17 PM)

Why would you need refnums to be shift registers? Unless you're closing the reference within the loop and replacing it with a not-a-refnum constant, I'd expect they would pass through a loop unmodified, and I don't think there would be a benefit to using a shift register over a tunnel (although I don't think there would be a disadvantage, either, which might be enough to make your point).

Another reason (except the N=0 issue which I think was changed at some point around 7.x) is that wiring the refnum out of the loop defaults to autoindexing for the for loop which is almost never what it should do. Using shift registers solves that too.

Rolf Kalbermatter

Link to post
Share on other sites

QUOTE(Tomi Maila @ Nov 20 2007, 03:46 AM)

When wiring error into a loop, the most common use case is to have a shift register to pass the error from iteration to iteration. Hence shift registers should be the default terminal type for error clusters when wired to a loop.

EDIT: The same should apply for all reference types.

I can't count how many times I've pointed out a tunneled error cluster in a co-worker's code and each time it's the same response -- "Ack! I forgot about that..."

The majority of times, a shift register is definitely the right choice, so I agree totally it should be the default.

PS. Sometimes I am the co-worker :laugh:

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.