LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Case structure and event structure with an indicator (boolean) condition

Solved!
Go to solution

@SEGIO wrote:

The problem is that I don't know how to close TDMS file completely, because I want to replace this TDMS file by the TDMS file generated in next acquisition.


ok, you still did not answer the questions completely ( about cycling,terminate, user interface?)...this vi will (step by step):

 

  • goto case statement 'acquisition1' and write data for 2 mins. , then close file in T/F case statement, goto case statement 'wait'
  • wait for 5 mins goto case statement 'acquisition2'
  • generate TDMS random data for 2 mins, goto 'wait'
  • cylcle through 'wait' and 'generate random data'.....

by the way,it is always a good practice to type def your case statement enums incase you have to add more statement commands...Smiley Wink

 

Spoiler
acquisition[1]_BD.png

 

Message 11 of 37
(1,047 Views)

I don't know why you put an other state (acquisition 2). I've implemented your program and I can't see that last file is replaced. It's like acquisition has finished and it doesn't go on.

Otherwise, why I can not do that like this (open file and close file in case structures, in acquisition state), and leaving only 2 states (acquisition and wait)?

screenshot2.png

Thank you for your help

 

0 Kudos
Message 12 of 37
(1,030 Views)

@SEGIO wrote:

I don't know why you put an other state (acquisition 2). I've implemented your program and I can't see that last file is replaced. It's like acquisition has finished and it doesn't go on.

Otherwise, why I can not do that like this (open file and close file in case structures, in acquisition state), and leaving only 2 states (acquisition and wait)?

 

Thank you for your help

 


  • i added acq2 because you wanted "to replace this TDMS file by the TDMS file generated in next acquisition."
  • your vi is constantly opening a TDMS reference, because the elapsed timer outputs a false for 2 mins...not good!, leave it on the outside of the while loop

if you write a step by step explanation of sequences of what exactly you want done here...we can better understand your intentions Smiley Wink

Message 13 of 37
(1,023 Views)

Ok...I understand, thanks. But I've implemented your program and it doesn't work as I would like to, because the file created is not replaced. Have you run it?

 

 

0 Kudos
Message 14 of 37
(1,015 Views)

ok...is this what you want?

 

  • case acqusition: create or replace file, write to file for 2 mins, close file
  • case wait: for 5 mins
  • case acquisition: replace file???...., write to file for 2 mins, close file
0 Kudos
Message 15 of 37
(1,010 Views)

Yes, I'm sorry. And know I've seen that in case acquisition 2 there isn't close file, maybe it's the reason of it's not working.

 

Sorry and thanks 

0 Kudos
Message 16 of 37
(1,007 Views)

Have a look at the .llb that I've upload, it's yours but changing acq2 and adding a signal generated. The problem as you can see is that the second acq is not done, I can only see the first tdms file generated.

 

Thanks 😉

0 Kudos
Message 17 of 37
(998 Views)

i see what you are doing...i am trying to understand you here Smiley Wink

 

is what you are doing is what i had mentioned in the previous post?...replace the file at every acquisition, then wait?

0 Kudos
Message 18 of 37
(993 Views)

I want to make an acquisition of 2 minutes. Then stop 5 minutes (at this time I want to send the file generated previously using FTP). After this 5 minutes, start an other acquisition of 2 minutes replacing the file that was created in the first acquisition (because I've sent this file from to RT to PC, so I don't mind if it's replaced). And I want to do that infine times until I put stop 😉

0 Kudos
Message 19 of 37
(990 Views)

see if this is what you want...

 

Spoiler
acquisitionMOD_BD.png

 

Message 20 of 37
(981 Views)