Page 1 of 1

VISI display advice and guidence.

Posted: Tue Jan 21, 2020 1:07 pm
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

Re: VISI display advice and guidence.

Posted: Tue Jan 21, 2020 2:19 pm
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

Re: VISI display advice and guidence.

Posted: Tue Jan 21, 2020 5:34 pm
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

Re: VISI display advice and guidence.

Posted: Tue Jan 21, 2020 6:59 pm
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

Re: VISI display advice and guidence.

Posted: Tue Jan 21, 2020 8:47 pm
by Steve001
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

Re: VISI display advice and guidence.

Posted: Wed Jan 22, 2020 3:51 pm
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

Re: VISI display advice and guidence.

Posted: Wed Jan 22, 2020 6:51 pm
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 1127 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

Re: VISI display advice and guidence.

Posted: Thu Jan 23, 2020 3:42 pm
by anzacinexile
Fantastic Martin, many thanks - and thanks to all for your time in answering my many dumb questions
Chris