C++ in LabView

I don’t really like LabView, but it is the only thing that seems to be working on our bot. WindRiver just does not work. Besides, the rest of the team is using LabView. Someone said that we could code C++ in LabView, but I have no clue how to do it. There are a few problems we are having with the labview software that I could fix in a heartbeat in C++. Anyone know how to open a C++ editor in LabView.

Nope, I’m afraid your someone is mistaken. While formula nodes can do formulas and math like C, you cannot do what your asking. Try looking up Formula Nodes and seeing if they can do what you want.

you can do library calls to DLL’s compiled in c++, but i dont think thats actually what you want to do.

… we are having with the labview software that I could fix in a heartbeat in C++. Anyone know how to open a C++ editor in LabView.

If you describe what it is, I suspect it won’t more than 2 heartbeats in LV either. As for doing C++ code, keep in mind that LV is compiled directly to machine code. There is no C++ generation in between, and no translator. It is possible for LV to call into .out binary files, and there are white papers that describe it, but it is not for the faint of heart. The topic would be Calling External Libraries from LabVIEW.

Greg McKaskle

This is sad – sad because it’s so not true.:frowning:
Still, from reading these forums, I gather that this is the prevalent opinion.

Wind River is getting a completely undeserved black eye for their sponsorship.
This is largely a result of very poor documentation supplied to the teams.
I have to wonder if they’ll even bother with FIRST next year.

The other day, I saw a thread in which someone proclaimed that they ‘hated’ Labview. The poster was cautioned that this might lead to unspecified fallout from NI. I really doubt it.

Thanks. Just realized why WindRiver is not working. I forgot to add the while loop to make it execute every time. That would be a problem.

there is “C” in labview, its more like a type of pseudo"c";

an if looks like

if(b==1)
z=2;
else if(b==2)
z=3;
else
z=4;

That is your standard syntax, you have to press enter between logic test and result, but since the formula node is made for math you can do stuff like.

if((B*A)>a>(B*D))
z=1;

if(B>a)
z=(15=c);

Thats perfectly okay.
oh and you declare variables

int32 x;

int (bit count, 32/16/8 variable), character (English letter, caps matter);

yes thats it, no boolean, no 4 bits, not 64 bits…

Your switches look something like this

switch (x) 
{

case 1:
break;

case 2:
break;

case 3:
break;

case n;
break
}

It is nice for some hardcore decision making that would force you to use a couple dozen triangles in Labview, it is also useful for compacting math script. Just make sure you syntax is right, Labview counts by statements not lines, so an error on line 14 could be on line 52, and your error message will be missing semicolon, or missing parth… So descriptive, an error really means got back through your code with a very very very very very very fine tooth comb, and space stuff out, as far as i can from using the “C” in labview, labview likes to have everything just so, and you mess with it a little bit and BOOM 14 errors…

Sadly i don’t know that much about doing more complex stuff in the formula node/C node, just basic stuff. Me and a programming mentor spent about 3 hours just figuring out the syntax for that, I caution you to try more complex items, but i also wish you the best of luck.

good luck

cody