Hi
I'm looking for some guidance and advice please as I'm hungry to learn but have got little experience with C.
I've got a project where I'm talking to a VISI display with 4 spectrum gauges where I'm trying to simulate 4 moving graphs. I can drive the display OK but as each spectrum has 24 columns each, to try and declare 4 x 24 variables and then drive the display with 96 component calls with each display update is rather inelegant to say the least. In researching possible solutions I'm thinking that a linked list is the way to go (linked lists are dynamic but arrays are static - correct????).
Here lies my problem and 2 questions. Is this the correct way forward and can anyone point me towards a learning solution that doest assume an in-depth knowledge of C please?
Thanks for any suggestions
Chris
VISI display advice and guidence.
-
- Posts: 55
- Joined: Tue Apr 01, 2014 9:10 am
- Has thanked: 16 times
- Been thanked: 18 times
-
- Valued Contributor
- Posts: 1208
- Joined: Wed May 31, 2017 11:57 am
- Has thanked: 70 times
- Been thanked: 440 times
Re: VISI display advice and guidence.
Arrays would probably be the way to go here...
You could use a linked list but I'm not sure it would be worth the extra code - the memory savings would be negligible.
So it is easy to have or a 2 dimensional array to cover all 4 displays
And to iterate over using a loop
Linked list might be better if only a few 'columns' are populated at a time.
Are you working in C or Flowcode?
Martin
You could use a linked list but I'm not sure it would be worth the extra code - the memory savings would be negligible.
So it is easy to have
Code: Select all
int X[24];
And to iterate over using a loop
Code: Select all
for (i = 0; i < 24; i++) ....
Are you working in C or Flowcode?
Martin
-
- Posts: 55
- Joined: Tue Apr 01, 2014 9:10 am
- Has thanked: 16 times
- Been thanked: 18 times
Re: VISI display advice and guidence.
Thanks for getting back Martin, much appreciated.
I wish I could write in C but I'm not yet at that level that's why I find Flowcode such a fantastic tool
Regards
Chris
I wish I could write in C but I'm not yet at that level that's why I find Flowcode such a fantastic tool
Regards
Chris
-
- Valued Contributor
- Posts: 1208
- Joined: Wed May 31, 2017 11:57 am
- Has thanked: 70 times
- Been thanked: 440 times
Re: VISI display advice and guidence.
Hi Chris,
If using Flowcode then use an array on the first instance. You can do linked lists - but it needs a bit of C to work properly. Can you post some snippets of code or pseudocode showing what you need to do?
Martin
If using Flowcode then use an array on the first instance. You can do linked lists - but it needs a bit of C to work properly. Can you post some snippets of code or pseudocode showing what you need to do?
Martin
-
- Valued Contributor
- Posts: 1189
- Joined: Wed Dec 31, 2008 3:37 pm
- Has thanked: 460 times
- Been thanked: 523 times
Re: VISI display advice and guidence.
Hi Chris
Is it a 4D systems unit ?
John did an excellent tutorial on them :-
viewtopic.php?f=26&t=15212
Dose this help you ?
Steve
Is it a 4D systems unit ?
John did an excellent tutorial on them :-
viewtopic.php?f=26&t=15212
Dose this help you ?
Steve
Success always occurs in private and failure in full view.
-
- Posts: 55
- Joined: Tue Apr 01, 2014 9:10 am
- Has thanked: 16 times
- Been thanked: 18 times
Re: VISI display advice and guidence.
Thanks guys for the responses, helps in a big way.
This is not the first time I've used 4D systems displays but it is the first to use the spectrum. In the early days I discovered Johns excellent article but my lack of knowledge is more to do with the program not the hardware as such.
Now for the really dumb question. In Flowcode, is an array the same as a lookup table because it's the only pre-built thing in Flowcode that looks like an array. The only learning resource I found is at http://www.cplusplus.com/doc/tutorial/arrays/ but is there any others that can be recommended.
As always, cheers guys for putting up with my stupid questions
Chris
This is not the first time I've used 4D systems displays but it is the first to use the spectrum. In the early days I discovered Johns excellent article but my lack of knowledge is more to do with the program not the hardware as such.
Now for the really dumb question. In Flowcode, is an array the same as a lookup table because it's the only pre-built thing in Flowcode that looks like an array. The only learning resource I found is at http://www.cplusplus.com/doc/tutorial/arrays/ but is there any others that can be recommended.
As always, cheers guys for putting up with my stupid questions
Chris
-
- Valued Contributor
- Posts: 1208
- Joined: Wed May 31, 2017 11:57 am
- Has thanked: 70 times
- Been thanked: 440 times
Re: VISI display advice and guidence.
FC allows arrays - with a syntax very similar to C...
So when creating a variable - add the number of elements for the array in square brackets after the variable name...
To declare an array of 10 bytes..
Note that to access them arrays are 0 based (so x[0] .. x[9] here)
Using a loop - use a loop count of number of elements (10 here) and use 'count using a variable' - to give an 'index' (this is why loop counters are often 'i') to the array.
Martin
So when creating a variable - add the number of elements for the array in square brackets after the variable name...
To declare an array of 10 bytes..
Note that to access them arrays are 0 based (so x[0] .. x[9] here)
Using a loop - use a loop count of number of elements (10 here) and use 'count using a variable' - to give an 'index' (this is why loop counters are often 'i') to the array.
Martin
-
- Posts: 55
- Joined: Tue Apr 01, 2014 9:10 am
- Has thanked: 16 times
- Been thanked: 18 times
Re: VISI display advice and guidence.
Fantastic Martin, many thanks - and thanks to all for your time in answering my many dumb questions
Chris
Chris