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
Highlighted

 

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
(1,306 Views)
Highlighted
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
Message 2 of 4
(1,297 Views)
Highlighted

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
(1,291 Views)
Highlighted

@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
Message 4 of 4
(1,271 Views)