Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/08/2018 in all areas

  1. Firstly, you are using a Formula Node, not a MathScript Node. But that will do what you need just fine. Secondly, look at the built-in help to explain the operators. Right click on the Formula Node, then Help, and then look for the allowed operators. You'll see the ones you need, including >> (right shift), << (left shift), & (and), ^ (exclusive or), and | (or). Note that ^ is not "to the power of". That should make completing this fairly straight-forward.
    3 points
  2. To answer your question: No, its not an array. I think GregSands already provided good help to this particular question: Of course this is only useful if you work with the Formula Node, just like you did with the other solution. That being said, before you continue writing anything in LabVIEW please take your time to understand what your expressions are doing. Try to make it simpler to understand. For example, instead of trying to get this entire expression to work, start with one portion of it, like the first part: z = 3 >> x You have to answer the same questions as before: What do you expect this expression to return for z? There are a lot of resources on the internet that also explain very well what these expressions do. You just need to know what to search for, so here is a translation table for you: >> Arithmetic Shift Right << Arithmetic Shift Left ^ Bit Exclusive Or & Bit And | Bit Or I suggest you try and understand what each of these expression does before combining them into longer expressions. Here is a full list of operations with their names for the Formula Node: http://zone.ni.com/reference/en-XX/help/371361P-01/lvhowto/precedence_of_operators_in/ I'm not an expert with Formula Nodes, but this should be possible to do without MathScript. From what I can tell the "x²" probably isn't allowed in the Formula Node, so maybe use "pow(x,2)" instead? If you get an error message please post the entire message here, maybe someone knows why this error happens.
    2 points
  3. It appears you need help with the math expression. The LabVIEW help topics of "Formula Node" and "Precedence of Operators in Formula Nodes and Expression Nodes" should help. Have you read these?
    2 points
  4. If you are using a formula node then it's just a matter of setting up the inputs and outputs of the node and typing in the formula. LabVIEW has very good help that installs with it, but there is a little tutorial here. The first formula has one gotcha but the error message tells you what the issue is. The second formula is a little wonky in that it looks like x-squared is being squared. Make sure you read the help on the formula node.
    1 point
×
×
  • Create New...

Important Information

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