11-16-2016 02:05 PM
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?
Solved! Go to Solution.
11-16-2016 02:23 PM
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.
11-16-2016 02:30 PM
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?
11-16-2016 03:15 PM
@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.