LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Real-Time: Disabling code conditionally when an RT executable

Hello,

When I build an executable in LabVIEW for Windows, I often enable/disable certain code using the "Application:Kind" property.  For example, it's common to disable the "Quit LabVIEW" function during development, but not in an executable.

Is there something analogous in Real-Time?  I know that property nodes are hit or miss in RT and are generally a bad idea, so is there a way to set up the conditional disable structure?

Thanks in advance,

Jim

0 Kudos
Message 1 of 9
(5,707 Views)
Hi Jim,

atleast for the Quit or Stop-problem I just use a simple case structure...
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 9
(5,704 Views)
Okay, GerdW, thanks... but that doesn't answer my question.  I'm not asking about the quit or stop function; I'm asking about Real-Time, specifically.

Is there a property that will work for what I'm trying to do?  (Keeping in mind that most properties in RT don't work)  I can't use a case structure if I don't have a property, which is why I'm wondering if I can use the conditional disable structure.  Of course, I could just manually disable stuff, but I really want to get away from that.



Thanks again,

Jim
0 Kudos
Message 3 of 9
(5,696 Views)

Does "App.TargetOS" help?

Ben



Message Edited by Ben on 11-30-2007 09:43 AM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 9
(5,690 Views)
Thanks, Ben.

Hmmm... I think I tried that one already, and I'm pretty sure that the OS was PharLap whether the VI was compiled or not.  I could try it again, though.  Maybe in my effort to be succinct I wasn't articulate in explaining what I'm trying to do (sorry about that).

Here are the details:
I found out the hard way that I can't get the strings from an enum using a property node in the RT environment.  It seems to work in the development environment, but as soon as I compile, the property node just gives me an empty array.  So I figured I had to put in arrays of constants, but it would be nice to also keep the property nodes there for development.  I'd like to be able to switch between the two programatically.  Thus, if it's compiled, I want to use constants.  If it's not compiled, I'd like to use the property nodes.

Does that clear any of it up?

Thanks very much for the answers thus far.

Jim
0 Kudos
Message 5 of 9
(5,682 Views)
Mr Jim wrote "I found out the hard way that I can't get the strings from an enum using a property node in the RT environment. "
 
Same here!
 
It drove me nuts for a while becuase if I had the FP open (loaded) the property node would work fine.
 
If you just want the equivelent string for the current value, then just wire the enum to a "format into string".
 
It was also possible to parse the type descriptor for the enum to get the list of strings.
 
The property I mentioned when combined with a check to see if it was an exe I thought could give you what you were after.
 
Just trying to help,
 
Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 9
(5,678 Views)
That's definitely a step in the right direction, Ben, and thanks for the suggestions. 

I use the "format to string" trick all the time with enums, but unfortunately I need the array of names this time.  I set up a server that accepts commands via TCP, and those commands are stored in an enum.  The way I check to see if the user entered a valid command is by doing a search on the 1D string array that I get from a property node.  It would have been super easy to change commands around through a typedef'ed enum and automatically update the array, but it doesn't look like there's any good way to do it in RT.

I digress... I'll have to try those properties you mentioned and see if those help.

Jim
0 Kudos
Message 7 of 9
(5,666 Views)

This used to work back in the LV 6.1 days for getting the strings in RT without using a property node.

I believe I have used that as recently as LV 7.1. Since LV 8 changed some data repesentaion stuff, you may have to use the LV 7.1 version of the flatten to string to get the type descritor.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 8 of 9
(5,660 Views)
That worked perfectly! Like you said, I had to use the old-school 7.1 flatten to string.  It doesn't really answer the property node question, but it solved my problem!  Thanks for your help, Ben.

Jim


0 Kudos
Message 9 of 9
(5,653 Views)