LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving csv data in one tick of while loop

Solved!
Go to solution

Hello everyone,

Im trying to save 3 numbers JUST ONCE into .csv file but because my program is running in while loop, data is saving too fast. Even if I try to click Button: True then False, to catch this one tick, its not working and it must not work anyway like this. Is this way to put some condition into case structure to link this with changing into false after another tick loop so data will save only once after I clicked button? Also Ive been thining about incrementing then decrementing some variable, but I cant manage it properly...

Any help will be useful! Thanks :D=)

0 Kudos
Message 1 of 11
(1,200 Views)
Solution
Accepted by topic author Krzysztof_Orzel

Hi Krzysztof,

 


@Krzysztof_Orzel wrote:

Im trying to save 3 numbers JUST ONCE into .csv file but because my program is running in while loop, data is saving too fast.


Then you need to program that feature!

Two options:

  • use a button set to "latch" switching mode
  • use a button set to "switch" switching mode, followed by PtByPtBooleanCrossing function to detect rising edges…

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 11
(1,187 Views)

I will try this and will give you an answer asap

0 Kudos
Message 3 of 11
(1,180 Views)

So I changed my boolean to "switch until released" but Its not what I want, I cant always catch data saving tick, I need 100% of sucess so If I click it will automatically switch off after next iteration of loop 

0 Kudos
Message 4 of 11
(1,173 Views)

Hi Krzysztof,

 


@Krzysztof_Orzel wrote:

So I changed my boolean to "switch until released" but Its not what I want,


I wrote "switch mode, followed by PtByPtBooleanCrossing to detect rising edges". It seems you didn't read my message carefully!

 

Btw. you failed to attach your code two times now: when you have problems with your code then you should attach (real!) code…

(Edit: please don't send PMs when you already got answers in the forum. PMs will not increase the speed/willingness I'm answering with.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 11
(1,164 Views)

The code is more complex I have interfaced my labview with solidworks assembly and Im moving created robot with labview softmotion module so It wont work anyway 😕 unless you know how to launch this 

0 Kudos
Message 6 of 11
(1,160 Views)

Hi Krzysztof,

 


@Krzysztof_Orzel wrote:

The code is more complex


The code is not complex, but messy…

Why do you need to bundle 3 values just to unbundle them right after???

 

See this:

(It's a switching button…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 11
(1,143 Views)

Yes I know its messy, well be grateful then that I didnt post my 11 Vi's which contains the real program with FT Sensor plugged in 😄 

Anyway I finally achieved what I wanted, thank you so much

I did this that way (picture), so whenever I switch to true then false data is saving only after another iteration

Thank you for your patience!

0 Kudos
Message 8 of 11
(1,127 Views)

:facepalm:

Best regards,
GerdW


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

I know, I know I sent the same picture be accident,

(bundling and unbundling are remainings after I was learning smth)

 

can I ask you last question, Im writing 3 numbers into csv file, every time in next row, If I want to read them later lets say to recreate movement how can I do this, how can I read row after row, 3 after 3 numbers, do I need arrays ?

0 Kudos
Message 10 of 11
(1,121 Views)