LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

System dependant cases? [1 project for myRIO and cRIO without code changes]

Solved!
Go to solution

 

Im working on a project with Realtime and FPGA that can be run on the myRIO or a cRIO with appropriate I/O-modules. Lets say Im working on myRIO and everything is running fine. Now when I want to test it on the cRIO I need to change the specific I/O-constants and a few details (like conversion from fxp to int because the input module uses a different data type).
Of course all of that needs to be done in reverse order when Im switching back.

What Im looking for is a case structure or something that checks the system its running on during compile time and uses the appropriate case (which simply could contain the correct I/O-constant for that system). That way I could create a project for every system, use the same VIs and when the code is running or compiling its automatically choosing the correct IOs.

[In C one probably would do something like this:

#if defined (__AVR_ATmega16__)
...
#elif
...
#endif

 ]
Do you know of something that could help me?

0 Kudos
Message 1 of 4
(2,669 Views)
Solution
Accepted by topic author 1hdsquad

Look at the Conditional Diagram Disable Structure.  I am not completely sure it will do exactly what you are asking for (not sure how specific the target variables are), but it is the closest thing.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 4
(2,660 Views)

Thank you, that seems to be what I was looking for!
So for example I would use the Conditional Diagram Disable Structure, use 'FPGA_TARGET_CLASS' as condition and then I could switch between 'MYRIO_1900' or 'CRIO_9038'. Is that correct?

0 Kudos
Message 3 of 4
(2,654 Views)

@1hdsquad wrote:

Thank you, that seems to be what I was looking for!
So for example I would use the Conditional Diagram Disable Structure, use 'FPGA_TARGET_CLASS' as condition and then I could switch between 'MYRIO_1900' or 'CRIO_9038'. Is that correct?


That sounds right.  I have not done that myself.  I mostly just use the Run_Time_Engine == TRUE with the CDDS.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 4
(2,634 Views)