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

Highlighted

** LabVIEW Champion. It all comes together in GCentral **

**What does "Engineering Redefined" mean??**

07-20-2010 11:13 AM

Options

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

Here is one involving X-Controls.

Xcontrols are a bit complicated to configure, so it might not be clear what it means if the "data changed?" boolean in the **action cluster** is set to true.

For example, there is an event case name "Data Change", and the programmer might think that "data changed?" needs to be set to TRUE in that event case. (After all, if you write to a terminal, the data changes in some way, right? 😉 ...wrong! 🐵

Bad idea, but you might never notice a problem until you do some profiling:

If "data changed?" is set to TRUE in the "Data Change" event of an xcontrol, writing to a plain local variable of the xcontrol in the main program actually fires any "value changed" event associated with the xcontrol, same as if you would write to a value(sgnl) property. This can lead to unexpected behavior. 😉

Highlighted
Options

07-26-2010 08:29 PM

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

Wow! I just learned one that threw me for a loop! I rarely use the Expression Node, so when I tried to generate a simple parabola out of instinct I tried "x^2 + 2*x". You can imagine I was shocked to see the following drunken graph:

Apparently, the '^' operator is the XOR operator, not "to the power of" like I expected. This was clearly evident for such a simple formula, but could be much more insidious in a complex formula.

See here for the original thread where I ended up using "x*x + 2*x" as the example.

Highlighted
Options

07-27-2010 09:21 AM

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

JackDunaway wrote:

Apparently, the '^' operator is the XOR operator, not "to the power of" like I expected. This was clearly evident for such a simple formula, but could be much more insidious in a complex formula.

See here for the original thread where I ended up using "x*x + 2*x" as the example.

Not sure if you discovered it in your research, but ** is "to the power of". i.e. "x**2 + 2*x"

--

Tim Elsey

Certified LabVIEW Architect

Tim Elsey

Certified LabVIEW Architect

Highlighted
Options

** LabVIEW Champion. It all comes together in GCentral **

**What does "Engineering Redefined" mean??**

07-27-2010 11:14 AM

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

The few syntax differences (formula node vs. parser) are a bit of a weak point and can be confusing.

Here is a list of some differences.

excerpt from the help:

The parser in the Mathematics VIs supports all elements that Formula Nodes support with the following exceptions:

**Variables**—Only*a*,*a*0, ...,*a*9, ...*z*,*z*0, ...,*z*9, are valid.**Logical, conditional, inequality, equality**—?:,, &&, !=, ==, <, >, <=, and >= are not valid.**Functions**—atan2, max, min, mod, pow, rem, and sizeOfDim are not valid. You can use these functions in a Formula Node or use their corresponding LabVIEW functions.

...

The following table lists cases where Formula Nodes and the parser in the Mathematics VIs use different syntax.

Element | Formula Node | Parser VI Routine |
---|---|---|

pi | pi(1) =, pi(2) = 2, 2pi or 2(pi) return an error | |

Exponentiation | ** | ^ |

The precedence of operators is the same for the Mathematics VIs as in Formula Nodes. Refer to Formula Parsing VIs for more information about specific Formula Parsing VIs.

The parser in the Mathematics VIs uses the following syntax:

function (argument)

Highlighted
Options
Have you ever heard of "Coerce to Type"? You may not realize you need this function to squash bugs waiting to happen in data type conversions and typecasts.

08-11-2010 10:59 PM

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

Highlighted
Options

04-11-2011 02:05 AM - edited 04-11-2011 02:08 AM

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

I try to configure a case structure in a way that one case matches all the input strings started with "CurrentMeasurement" (and others.)

This results TRUE, if the input = "CurrentMt" and also TRUE if input = "Currenteasurement". But FALSE for "CurrentMeasuremen"

So what is the rule? In the help I find only hints for string ranges, for example stringe begin with a and b should be "a..c"

Mitulatbati

Highlighted
Options

** LabVIEW Champion. It all comes together in GCentral **

**What does "Engineering Redefined" mean??**

04-11-2011 02:38 AM

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

@mitulatbati wrote:

I try to configure a case structure in a way that one case matches all the input strings started with "CurrentMeasurement" (and others.)

This looks like a normal question looking for help, so please post it as a new thread in the LabVIEW forum.

Highlighted
Options

04-14-2011 04:02 PM

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

@mitulatbati wrote:

I try to configure a case structure in a way that one case matches all the input strings started with "CurrentMeasurement" (and others.)

You just gave me an idea for the idea exchange. What if the string could be a regular expression?

=====================

LabVIEW 2012

LabVIEW 2012

Highlighted
Options

04-14-2011 04:46 PM

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

If an event structure is registered for an event but does not have a case for that event then firing that event will still reset the timeout timer for the structure.

Some people consider it a bug and others consider it to be expected behavior.

There is an interesting debate on Lava about this.

Anyone know why creating a snippet converts a control reference into a control?

=====================

LabVIEW 2012

LabVIEW 2012

Highlighted
Options

___________________

Try to take over the world!

04-15-2011 03:22 AM

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

@SteveChandler wrote:

Anyone know why creating a snippet converts a control reference into a control?

Because NI wants to encourage people to use the Code Capture Tool which doesn't have this issue and can back-save your snippet as well?

___________________

Try to take over the world!