BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Rube Goldberg Code

Merge errors on for loop.png

It always get's a bit ugly though.

0 Kudos
Message 1921 of 2,635
(11,035 Views)

wiebe@CARYA wrote:

Merge errors on for loop.png

It always get's a bit ugly though.


You could autoindex the error out and then use Merge Error after the loop with the previous error and the error array.  No need for the shift register then.  I am not going to claim anything about performance in either case.

 

In most of my cases, I don't want anything to run inside of the loop if any of the iterations has an error, so I will use the shift register to cover the empty array issue and then the termination terminal to stop the FOR loop if one of the iterations has an error.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 1922 of 2,635
(11,029 Views)

While or error 

 

Do that Nice Tim


"Should be" isn't "Is" -Jay
0 Kudos
Message 1923 of 2,635
(11,026 Views)

@sebster wrote:

So what is the solution here then?

 

On the one hand you would want the error to move through each iteration of the for loop, but on the other hand a zero-sized array wouldn't carry the error from one side to the other.

 

 


Oh, you are on the Breakpoint..... no solutions here.

 

Just really good information 

 

Put the error chain on a shift register and  | Or * leave the loop on error

 

 

*1I could not find"/" on my NOT as smart as me phone


"Should be" isn't "Is" -Jay
0 Kudos
Message 1924 of 2,635
(11,018 Views)

For critical code, how about wrapping in a case structure, selector wired to error in, and operating on a branch of the reference? In this case the reference is immutable, so no harm, no foul.

 

fl-references.png

Obviously, you can customise the For Loop depending on your error handling requirements:

 

- Conditional stop on error

- Input tunnel to allow all operations to complete

- SR on error tunnel to halt operations on error

- Auto-indexing output tunnel and merge error to catch errors

---
CLA
0 Kudos
Message 1925 of 2,635
(11,007 Views)

@crossrulz wrote:

wiebe@CARYA wrote:

Merge errors on for loop.png

It always get's a bit ugly though.


You could autoindex the error out and then use Merge Error after the loop with the previous error and the error array.  No need for the shift register then.  I am not going to claim anything about performance in either case.


Yes, but building large arrays of error clusters is heavy on CPU and memory.

 

The shift register is only heavy on the CPU.

0 Kudos
Message 1926 of 2,635
(11,028 Views)

@thoult wrote:

For critical code, how about wrapping in a case structure, selector wired to error in, and operating on a branch of the reference? In this case the reference is immutable, so no harm, no foul.

 

fl-references.png

Obviously, you can customise the For Loop depending on your error handling requirements:

 

- Conditional stop on error

- Input tunnel to allow all operations to complete

- SR on error tunnel to halt operations on error

- Auto-indexing output tunnel and merge error to catch errors


But when the first iteration returns an error, subsequent iterations are skipped.

 

A case around everything is useful, but it's a different use case.

0 Kudos
Message 1927 of 2,635
(11,020 Views)

Literally a different use case 🙂

 

As for the skipping, that was the point about making the input tunnel just a plain tunnel, rather than SRed.

---
CLA
0 Kudos
Message 1928 of 2,635
(11,013 Views)

Today is a special edition, this time an official (non NI) driver for Horiba CCDs:

http://sine.ni.com/apps/utf8/niid_web_display.download_page?p_id_guid=EA250B95CF70036AE0440021287E6E...

 

Well, it is less funny when I have to rewrite the whole driver (or at least functions we need) for our Horiba CCD. Actually I also requested the LV driver from their website, but I think more or the less what I got is the same what is available under the above link. Nice or not nice, I could not stop myself giving feedback to the company by email. I advised them to hire an NI alliance partner to develop a proper LabVIEW driver. This recent one is just a joke! Actually due to some improper initialization steps, it even could not establish connection with the CCD 🙂 I guess an intern/student made it? Or someone who even do not know about clusters. But the whole driver is an endless source of RG code 🙂

 

Setup CCD_BD.png

Message 1929 of 2,635
(10,915 Views)

@Blokk wrote:

I guess an intern/student made it?


That is the norm for drivers...

 

Spoiler
Why would you let the interface to your product, that determines the entire experience of customers, be made by someone who knows what he's doing?
Spoiler
That would be silly because it might cost as much as even a few k$. Better let a complete noob make it! That still costs a few k$ and months of development, but at least you have some crappy driver to represent your high tech device that costs millions to develop. Fortunately the code monkey leaves the company when done, so nobody can be held accountable!
Message 1930 of 2,635
(10,906 Views)