12-18-2017 08:56 AM
@Ben wrote:
you can just right click and choose "duplicate case".
I do this a lot (of course, not copying the variables but only the respective unbundle/bundle nodes or other functions), to keep code clean, which, I call "code mirroring", since the different functions/SubVIs remain on the same coordinates when we Mouse+ScrollWheel through the different cases of the State Machine case structure without getting eye-pain.
PFA the VI to see what I mean.
01-04-2018 10:56 AM
01-05-2018 07:52 AM
A colleague called me over to help him with a jig that he fired on for the first time since the Christmas holiday. The test software was written by a former colleague, and whilst I don't officially support it, I have been dragged over to have a look at it occasionally, holding my head in my hands as I do.
I managed to trace back the error code being reported to the RS232 barometer. A hastily written test panel showed it was responding correctly, so flicking through the code found me here:
I understand that there was a failure mode whereby the device returned odd string values (units are in Pa, so typically should be 101 000 or so), hence the attempt at a trap for unexpected values. I have never seen anyone use a GTE comparison on a string to check this, as only the first two characters are compared. Values between 100 kPa and 170 kPa are passed correctly; values between 17 kPa and 100 kPa are not.
As atmospheric pressure is hovering around 98/99 kPa, which is hardly unexceptional around here, and there is plenty of turbulent air in the vicinity of the barometer, it's a teeny tiny bit of an oversight. I'm just surprised they've never seen the issue before!
01-05-2018 08:11 AM
I had no idea you could even do a GTE comparison of strings. Is it just comparing the ASCII values?
01-05-2018 08:16 AM
Comparisons on string behave strangely. It checks the first character of both strings, if greater, result is true, if less, result is false, if equal, check second characters. Repeat.
I'd agree, it makes a lot more sense to convert to numeric first then do the comparison.
"I won't be wronged. I won't be insulted. I won't be laid a-hand on. I don't do these things to other people, and I require the same from them." John Bernard Books
01-05-2018 01:43 PM
That's merely the easiest of the Rubes to show.
The top level VI as a whole reminds me of a favoured series of XKCD comics:
01-08-2018 04:55 AM
@Jacobson-ni wrote:
I had no idea you could even do a GTE comparison of strings. Is it just comparing the ASCII values?
How else would the sort 1D array work on strings?
01-09-2018 11:47 AM - edited 01-09-2018 11:47 AM
The task is to create a histogram of about 1M random numbers from 1..69.
We could do it with four FOR loops with the inner FOR loop pumping hot air most of the time (seen here)....
Or we could do it all in a single loop ....
01-16-2018 05:26 PM
We ordered an evaluation kit for a particular component, and the manufacturer provided a nice GUI to test it. I was excited to discover that the code for their application is available for download on their website. Then I looked at the code and found this unusual approach to stopping a queued state machine:
01-16-2018 06:15 PM