Hi,
I am using some old code from V8 FC and ECIO40, moving a project to V9 and the dsPIC ECIO40P16.
IC code blocks, do I need to declare any new variable at the start of each code block?
Could I declare/initiialise these variables at the start of the flowcode in thier own code block?
thanks, J.
C Code Declarations
-
- Posts: 229
- http://meble-kuchenne.info.pl
- Joined: Sun Dec 20, 2020 6:06 pm
- Has thanked: 92 times
- Been thanked: 58 times
-
- Matrix Staff
- Posts: 1552
- Joined: Sat Dec 05, 2020 10:32 am
- Has thanked: 214 times
- Been thanked: 362 times
Re: C Code Declarations
If your variables are only needed within the C code block itself, then declaring them there should be ok.
However, if you want to access the same variable in different places within your program, then you can declare them in the defines section of the "supplementary code" feature. This is in the "Build..Project options" screen.
To initialise them, you will probably want to do this in a C code icon at the start of your "main" flowchart.
However, if you want to access the same variable in different places within your program, then you can declare them in the defines section of the "supplementary code" feature. This is in the "Build..Project options" screen.
To initialise them, you will probably want to do this in a C code icon at the start of your "main" flowchart.