LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

periodic recording data

Hello everyone ,


I want to save the data from the first see periodically, I did this code but in this case I record nothing on the 2 files, could you please help me and tell me where Did I make the mistake?

thanks in advance

 

0 Kudos
Message 1 of 12
(644 Views)

Hi Amelie,

 


@ameletudiante99 wrote:

could you please help me


Could you please help us to help you by downconverting your VI to an older LabVIEW version?

(Most suggest LV2021 or older, I prefer LV2019.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 12
(633 Views)
0 Kudos
Message 3 of 12
(613 Views)

Hi Amelie,

 


@ameletudiante99 wrote:

tell me where Did I make the mistake?


Please say "THINK DATAFLOW". Say it loud!

 

What do you think happens in your loop:

  • When does the inner loop stop (with respect to DATAFLOW)?
  • When does the outer loop read the local variable "boolean" (with respect to DATAFLOW)?
  • Why do you think all those bended wires help to improve code readability?
  • Why do you think did I use shift registers in this image?
  • Why do you think it is a bad idea to have "default if unwired" tunnel(s) in this case structure inside your loop?

Please take the Training resources offered at the top of the LabVIEW board - and repeat say "THINK DATAFLOW!" as long as you don't understand the meaning and implications of those two words!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 12
(591 Views)

Hello GerdW,

 

  • Inner Loop: It stops when its specific condition is met, such as when a "stop" button changes a boolean variable.

  • Outer Loop: It reads the local variable after the inner loop completes its execution because LabVIEW manages data flow sequentially.

  • Bundled Wires: They improve readability by visually grouping similar data connections, reducing clutter on the block diagram.

  • Shift Registers: They are used to store values between iterations of a loop, ensuring continuous data management over the long term.

  • Default Tunnels: Within a case structure inside a loop, they can cause errors if default values exit without specific conditions being met, disrupting expected data flow.

I've tried to apply your advice and understand better now. However, I'm struggling to correctly program a shift register for handling loop exits.

 

thank you

 

 

0 Kudos
Message 5 of 12
(570 Views)

Hi,

 

You should use debug tools while learning LabVIEW, especially the step-by-step mode in that case.

 

PinguX_0-1718358645039.png

 

By doing so, you will get this :

 

PinguX_1-1718358763971.png

(don't mind the errors, I deactivated all others DAQmx calls)

 

The colorized wires and VIs have been fully executed.

Grayed-out wires and VIs are still executing.

0 Kudos
Message 6 of 12
(562 Views)

yes I tried but I still don't understand,

I can't fix it, I'll try something else thanks

0 Kudos
Message 7 of 12
(551 Views)

Good morning ,


I acquire several parameters at 100 kHz per second; to limit the file size I only need to record half the time on certain parameters, so I want to record 50000 points only of the 100000 points;

I tried to code a Boolean variable which changes state every 0.5s to activate recording periodically but the program does not work, I cannot correct it? I saw that we can also use a timer but I don't know how to repeat it periodically? can you help me with this?

thanks in advance

0 Kudos
Message 8 of 12
(546 Views)

Hi Amelie,

 


@ameletudiante99 wrote:

Inner Loop: It stops when its specific condition is met, such as when a "stop" button changes a boolean variable.

Outer Loop: It reads the local variable after the inner loop completes its execution because LabVIEW manages data flow sequentially.

Bundled Wires: They improve readability by visually grouping similar data connections, reducing clutter on the block diagram.

Shift Registers: They are used to store values between iterations of a loop, ensuring continuous data management over the long term.

Default Tunnels: Within a case structure inside a loop, they can cause errors if default values exit without specific conditions being met, disrupting expected data flow.


  • The inner loop will either run forever or stop immediatly - due to DATAFLOW!
  • The outer loop reads the local variable independently from the inner loop, so your sentence is WRONG - due to DATAFLOW!
  • Your "default if unwired" tunnel does what you described: what do you do to handle the default data? (Is it correct to have default data after that tunnel?)

I repeat: you need to learn DATAFLOW basics: do the Training resources as offered at the top of the LabVIEW board!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 12
(545 Views)

Hi Amelie,

 

please don't create new threads for the same problem!

It's still about missing DATAFLOW in your VI…

 


@ameletudiante99 wrote:

I tried to code a Boolean variable which changes state every 0.5s to activate recording periodically but the program does not work, I cannot correct it?


Why do you need the loop inside and a boolean "variable" at all?

Why don't you read 50k samples per iteration and save the data only each second (aka even or uneven) iteration???

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 12
(541 Views)