VISI display advice and guidence.

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

anzacinexile
Posts: 44
Joined: Tue Apr 01, 2014 9:10 am
Has thanked: 15 times
Been thanked: 17 times
Contact:

VISI display advice and guidence.

Postby anzacinexile » Tue Jan 21, 2020 1:07 pm

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

mnf
Valued Contributor
Valued Contributor
Posts: 700
Joined: Wed May 31, 2017 11:57 am
Has thanked: 63 times
Been thanked: 403 times
Contact:

Re: VISI display advice and guidence.

Postby mnf » Tue Jan 21, 2020 2:19 pm

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

Code: Select all

int X[24];
or a 2 dimensional array to cover all 4 displays
And to iterate over using a loop

Code: Select all

 for (i = 0; i < 24; i++) ....


Linked list might be better if only a few 'columns' are populated at a time.

Are you working in C or Flowcode?

Martin

anzacinexile
Posts: 44
Joined: Tue Apr 01, 2014 9:10 am
Has thanked: 15 times
Been thanked: 17 times
Contact:

Re: VISI display advice and guidence.

Postby anzacinexile » Tue Jan 21, 2020 5:34 pm

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

mnf
Valued Contributor
Valued Contributor
Posts: 700
Joined: Wed May 31, 2017 11:57 am
Has thanked: 63 times
Been thanked: 403 times
Contact:

Re: VISI display advice and guidence.

Postby mnf » Tue Jan 21, 2020 6:59 pm

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

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1128
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 521 times
Contact:

Re: VISI display advice and guidence.

Postby Steve001 » Tue Jan 21, 2020 8:47 pm

Hi Chris

Is it a 4D systems unit ?

John did an excellent tutorial on them :-

https://www.matrixtsl.com/mmforums/viewtopic.php?f=26&t=15212

Dose this help you ?

Steve
Success always occurs in private and failure in full view.

anzacinexile
Posts: 44
Joined: Tue Apr 01, 2014 9:10 am
Has thanked: 15 times
Been thanked: 17 times
Contact:

Re: VISI display advice and guidence.

Postby anzacinexile » Wed Jan 22, 2020 3:51 pm

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

mnf
Valued Contributor
Valued Contributor
Posts: 700
Joined: Wed May 31, 2017 11:57 am
Has thanked: 63 times
Been thanked: 403 times
Contact:

Re: VISI display advice and guidence.

Postby mnf » Wed Jan 22, 2020 6:51 pm

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...

array.JPG
array.JPG (50.71 KiB) Viewed 1148 times


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
These users thanked the author mnf for the post (total 2):
LeighM (Thu Jan 23, 2020 8:42 am) • anzacinexile (Thu Jan 23, 2020 3:43 pm)
Rating: 10%
 

anzacinexile
Posts: 44
Joined: Tue Apr 01, 2014 9:10 am
Has thanked: 15 times
Been thanked: 17 times
Contact:

Re: VISI display advice and guidence.

Postby anzacinexile » Thu Jan 23, 2020 3:42 pm

Fantastic Martin, many thanks - and thanks to all for your time in answering my many dumb questions
Chris