05-10-2016 02:04 PM
@PeterFoerster wrote:So how do we improve on that? Easy: We replace the data type of the User Event with Array, to make it more scalable.
I would have used an enum. Then you wouldn't have to do the search to figure out which one changed.
But still, RT = no font panel. Therefore I have to ask where is the command parser from the Windows System telling your RT to do whatever those buttons did?
05-11-2016 01:44 AM
Well, it was a Linux RIO, so there is a Front Panel. However, in this case we just used front panel communication, since it is just the configuration program and it doesn't have to run deterministically.
05-11-2016 05:39 AM
@PeterFoerster wrote:Well, it was a Linux RIO, so there is a Front Panel.
That is only on the 903X series cRIOs. And if you have those, why not just enable the front panel usage and then you have all of your events!
06-07-2016 04:21 PM - edited 06-07-2016 04:22 PM
Getting a time string aparently involves the following:
Of course there are probably simpler alternatives 😄
06-09-2016 02:53 PM
@altenbach wrote:
Getting a time string aparently involves the following:
- unbundle
- built array
- autoindexing for loop
- shift register
- empty string diagram constant
- state machine with
- multicase case structure
- number to string conversions
- string concatenations
- etc.
Of course there are probably simpler alternatives 😄
Answering the why in your image Christian.
NO SYNTAX!
The top version does not require looking up any secret codes.
SIlly Wizard (smiley-wink)
Ben
06-11-2016 03:00 AM
@Ben wrote:
@altenbach wrote:
Getting a time string aparently involves the following:
- unbundle
- built array
- autoindexing for loop
- shift register
- empty string diagram constant
- state machine with
- multicase case structure
- number to string conversions
- string concatenations
- etc.
Of course there are probably simpler alternatives 😄
Answering the why in your image Christian.
NO SYNTAX!
The top version does not require looking up any secret codes.
SIlly Wizard (smiley-wink)
Ben
You might need a "Trixie Belden" secret decoder ring.
Time format code are both in the help file and, available from the numeric FP object property editor.
Pshht. secrets that are given away in cereal boxes.....
06-13-2016 01:38 AM
I've gone the middle road on several occations with Date/time rec --> Format into string before learning those special specifiers. 🙂
/Y
07-15-2016 02:13 PM
My own blunder, can't learn unless you're willing to accept criticism! Especially from the great altenbach!
This is my code to find the indices of the array the OP wanted between 1 and -1 ..
Here is the simpler and order of magnitude faster route posted by altenbach, most simple one but also more posted that are better for memory allocation and speed here..
07-28-2016 04:33 PM
Stumbled across this in some legacy code today. I'm assuming there used to be something useful where this is, but given the state of this code I wouldn't bet on it.
08-01-2016 03:28 AM
@ChrisK88 wrote:My own blunder, can't learn unless you're willing to accept criticism! Especially from the great altenbach!
This is my code to find the indices of the array the OP wanted between 1 and -1 ..
Here is the simpler and order of magnitude faster route posted by altenbach, most simple one but also more posted that are better for memory allocation and speed here..
Regardless, I would probably still tend to use In Range and Coerce in place of the Absolute / Less than pairing. The snippet's perfect when all you ever want to do is return indices for values within symmetrical limits, but if you suspect there's a possibility of wanting to compare for assymetrical limits, it's preferable to do so now so that the limits can be updated later on without changing code.
At the same time, the snippet answered the question that was asked, and that's just me projecting my requirements for scalability onto someone else 🙂