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

Post Reply
anzacinexile
Posts: 55
Joined: Tue Apr 01, 2014 9:10 am
Has thanked: 16 times
Been thanked: 18 times
Contact:

VISI display advice and guidence.

Post by anzacinexile »

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: 1188
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

Re: VISI display advice and guidence.

Post by mnf »

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: 55
Joined: Tue Apr 01, 2014 9:10 am
Has thanked: 16 times
Been thanked: 18 times
Contact:

Re: VISI display advice and guidence.

Post by anzacinexile »

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: 1188
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

Re: VISI display advice and guidence.

Post by mnf »

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: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: VISI display advice and guidence.

Post by Steve001 »

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
Success always occurs in private and failure in full view.

anzacinexile
Posts: 55
Joined: Tue Apr 01, 2014 9:10 am
Has thanked: 16 times
Been thanked: 18 times
Contact:

Re: VISI display advice and guidence.

Post by anzacinexile »

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: 1188
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

Re: VISI display advice and guidence.

Post by mnf »

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

anzacinexile
Posts: 55
Joined: Tue Apr 01, 2014 9:10 am
Has thanked: 16 times
Been thanked: 18 times
Contact:

Re: VISI display advice and guidence.

Post by anzacinexile »

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

Post Reply