LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programming Advice

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!

0 Kudos
Message 11 of 22
(1,060 Views)

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


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 12 of 22
(1,046 Views)

multi channel CSV.PNGWould something like this be the type of management you're talking about? And just add a build array function for each channel I use?

0 Kudos
Message 13 of 22
(1,025 Views)

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.


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 14 of 22
(1,020 Views)

sorry .. the image confused me .. its not sooo wrong 😉

but unfortunate in design. i will make a new snippet


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 15 of 22
(1,012 Views)

Okay, sorry about that. I wasn't aware of the snippet function before but I'll use that.

0 Kudos
Message 16 of 22
(1,009 Views)

narf-fjord-zort.png

 

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


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 17 of 22
(1,003 Views)

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.

0 Kudos
Message 18 of 22
(986 Views)

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


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 19 of 22
(982 Views)

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


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 20 of 22
(975 Views)