07-06-2017 11:10 AM
Is the double-precision array constant outside of the while loop used as a zeroed-out array so that way you have an array to build upon?
Also, since I don't know the size of my second channel will I need to replace it in another while loop or should I connect the iteration of the while loop to the loop count of the for loop?
And thanks for helping out!
07-06-2017 01:08 PM
yes,
you have to initialize the shift register with the datatype you want it to be,
the empty DBL-array does that.
(use probes on wires and/or highlight execution with retain wire values to follow what goes on)
you can get all things in one loop, you would have to build some sort of management,
like get from chan0 every iteration, from chan1 only every second iteration.
the build array function for chan1 would then be inside a case structure.
you are welcome
07-07-2017 08:56 AM - edited 07-07-2017 08:57 AM
Would something like this be the type of management you're talking about? And just add a build array function for each channel I use?
07-07-2017 09:07 AM - edited 07-07-2017 09:09 AM
no.
try to create snippets (menu "Edit"->"Create Snippet") so it is easyier to use.
you've got it quite wrong in fact.
have a look where your data goes.
07-07-2017 09:14 AM
sorry .. the image confused me .. its not sooo wrong 😉
but unfortunate in design. i will make a new snippet
07-07-2017 09:17 AM
Okay, sorry about that. I wasn't aware of the snippet function before but I'll use that.
07-07-2017 09:25 AM - edited 07-07-2017 09:31 AM
the sequence-structure is not mandatory, it is a personal preference to have the WAIT and reading of STOP value at the end.
you could get rid of the first frame, and just by having the wires go through the structure it would be defined to run at the end
07-07-2017 09:47 AM
Okay, I see now. But what is the purpose of the case structure if there's a true constant wired to it?
Also, I'm using a RT wait until next multiple for controlling my sampling rate. Is that fine to use that? Because I noticed you're using the regular wait function.
07-07-2017 09:51 AM - edited 07-07-2017 09:52 AM
i use the standard wait, because unless something is time critical, i think it doesn't matter.
the TRUEs are your condition, if and when to read from the datasource
07-07-2017 10:02 AM
as exercise:
let your last vi/image and mine run side by side and compare what they do, with highlight execution, retain wire values and probes.
specifically look what data will be at the end of each loop-iteration written to the shift registers.
generally, try to keep your lines straight, group blocks of code that belong together, and keep the code clean in general, it makes debugging and finding logical/data-flow errors much easier to spot