Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

array, continuous vector stream, manually updating

Hello,
I have got a continuous stream form a counter/timer card of an array. Now, when I press a button, I want to save the actuall values (x1, y1, z1) in another array. Pressing the button a second time, (x2, y2,z2) should be saved in this second array, so land until i stop the main loop manually.
How can I realize that!
Thanks.

0 Kudos
Message 1 of 9
(4,875 Views)
So, here is the problem again, with .vi. So, I am reading continuously an encoder, and want to write a set of data to file by pressing a button. For this, I use a Shift register, and case statement. But it is always replacing the column instead of appending, why? I mean, I think the 'false' case is responsible for that, because of the built array, but i am not sure. Someone might help me.
Thank you guys.

0 Kudos
Message 2 of 9
(4,860 Views)
hello josef_slg,

you set the constant "append to file?" at the write-VI to "false", which means that the file is replaced. if you set this constant to "true", the data will be appended.

kind regards,

robert h
NI germany
0 Kudos
Message 3 of 9
(4,860 Views)

I don't have LV on my network PC and can't see exactly how you're writing to file.  However, I'm not aware of any natural way to append *columns* to a 2D array of file data.

2D arrays are generally handled row-wise, so it's much more natural to append *rows*.  You may need to pass your data through "Transpose 2D Array" before writing so that what you think of as columns will be stored on disk as append-able rows.  (Of course, you'd also need to remember and reverse this transpose when you read your file.)

- Kevin P.

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 4 of 9
(4,847 Views)
Hello Roberth, you are right, but this doesn't solve the problem. I still read wrong data somehow, but continuous data with another vi is correct. so the problem is that the 'false' case has also a 'build array' function, which gives me wrong data. And without wiring this 'build array' in the fasle statement, i get an error regarding 2d string to 2d double. I can solve this with 'random numbers' which are just 1d, but I need 2d. So, please replace my counter input with an updating 'particular' array and run the vi, you will see, that it won't save the data correctly.
Thanks in advance for your help.
Dankeschoen.

0 Kudos
Message 5 of 9
(4,845 Views)
sorry, I forgot the .vi. Still some issues... you might explain it with an example.
At the moment, I am not able to write correctly, depending on my inputs, to file. it should be the case statement guys.
Please check.
Thank you


0 Kudos
Message 6 of 9
(4,842 Views)
hello josef,

in your configuration the position of the encoder is returned by the read VI. so you can read a single double.
this value can be stored in an array, which again can be written to the file. i attached the modified VI. if that doesn't fit your application you could provide further information on what exact signal you must save.

kind regards,

robert
Message 7 of 9
(4,834 Views)
Hello Robert, that is exactly what I want, well done.Thank you.  I will apply this to 6 encoders now.
Just another few questions. What is the default sampling rate (counter sampling) for this pci6602 counter timer card. I mean, in my while loop, I got an output of 1kHz, but my encoders are going to send signals up at 230kHz depending on the rotation speed. So what frequency is used to sample these counters as default ?
And can you recommend a 'LabView Bible' for engineers?
Vielen Dank nochmals fuer die schnelle und gute Hilfe.

Josef
0 Kudos
Message 8 of 9
(4,828 Views)
hello josef,

basically, if you read an ecnoder, the counters don't sample the input, they just count the edges. so if the encoder signal is within the specification of the device, all pulses will be recognized. when you read from the counter the actual position is returned to your software, no matter how fast you execute the read.

of course you could also do a buffered counteroperation, which is described here:
Buffered Event Counting
in this case you transfer the data from the counter continously to the memory, but you need an additional clock.

there are several books on LabVIEW, like basics and advanced programming.
there are also several trainingscourses, which you can attend.

kind regards

robert
0 Kudos
Message 9 of 9
(4,814 Views)