LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I need help export table excel

Solved!
Go to solution

 

I have the table exported to Excel, but I've been encountering some difficulties.

 

01 - When I start a pump, the Excel recording starts, but if I stop and start the pump again in a few minutes, it ends up recording in the file itself, but it doesn't overwrite.

 

02. I need to start the pump OR press another button to start the report, and when I click stop recording, it doesn't turn off the pump, it just stops recording the report. I've been encountering these difficulties with my program; I need help.

 

No mundo perfeito eu queria partir a bomba OU BT_IniciarRelatorio e pararRelatorio.

 

E ao clicar em IniciarRelatorio OU PartirBomba, ele automaticamente criar um outro arquivo excel e alimentar com as variaveis.

0 Kudos
Message 1 of 17
(295 Views)

 


@Felipe_Alves17 wrote:

Sem%20t%C3%ADtulo.


 

 

It is impossible to debug code pictures full of express VIs and dynamic data, because we cannot see how they are configured.

There is no toplevel loop visible. How are you running this? (hopefully not using the "continuous run" mode!)

 

Please attach your VI, make sure all controls have typical default data, and tell us exactly how you expect it to work.

0 Kudos
Message 2 of 17
(272 Views)
Thank you for your quick response. I apologize for not including the VI in the post. Here it is.

My goal is: BT_partirBomba OR BT_iniciarRelatorio (this condition will start generating the report).

BT_pararRelatorio (this will stop recording the report without turning off the pump).
0 Kudos
Message 3 of 17
(248 Views)

Your timeout case has an infinite timeout and will never execute. The only time the While loop goes to the next iteration is after you change one of the switches. Any other time, the event structure blocks execution. The value of the switch seems irrelevant. Shouldn't they be latch action?

 

Can you explain step-by-step how you are running it, how you interact with it, and what you expect to happen.

 

There is a lot of questionable code, for example your case structure just returns the input unchanged. You can delete it, leaving just the wire and nothing will change.

0 Kudos
Message 4 of 17
(239 Views)

I just posted a six-month late (I missed the original Topic's post) reply to "CMH and Continuous Measurement" on this Forum.  It discusses a Design Pattern called the Channel Message Handler to create something like a State Machine that lets you use Front Panel Controls like "Start" and "Stop" buttons, as well as Settings for DAQ devices, to set up data acquisition and simultaneous display of the data (using a Stream Channel).  You should be able to find this earlier Post and my response -- feel free to download the attachment I posted which includes a nine-page PDF that walks you through this demo.

 

Note that this illustrates an important advantage of LabVIEW, concurrent programming.  There are three loops running in parallel -- a "top" loop called the "Event Handler", a While Loop enclosing an Event Structure that waits for rectangular button pushes on the Front Panel (do you know why I underlined "rectangular"?), the main Loop which is the Channel Message Handler acting as a State Machine, doing sequential/repetetive sections on code going one "state" at a time, and finally a "Consumer" loop that gets "data to be displayed" (or saved to disk) when the State Machine reads a "chunk" of data.

 

Feel free to adapt it to your situation, but first, take the time to run it and learn how it works (the documentation should help).

 

Bob Schor

0 Kudos
Message 5 of 17
(222 Views)

I removed the Case, which made no difference; it actually made sense.

So, I want pressing BT_ligarBomba (Bomb ON) to turn on the pump and start recording the field variables, but pressing BT_pararGravacao (Stop Recording) to stop recording without turning off the pump.

I'm relatively new to LabView, and I'm encountering these difficulties that a seal might solve in LADDER.

0 Kudos
Message 6 of 17
(214 Views)

I'll take a look at your schedule, maybe I can adapt it to my activity and be able to complete it.

0 Kudos
Message 7 of 17
(213 Views)

You still don't have a timeout wired for the timeout structure, and placing a wait inside it makes no difference.

Also, if your timeout would ever trigger (once correctly wired!), it would immediately reset both shift register values to false. I doubt that's what you want.

0 Kudos
Message 8 of 17
(198 Views)

@Felipe_Alves17 wrote:

I removed the Case, which made no difference; it actually made sense.

So, I want pressing BT_ligarBomba (Bomb ON) to turn on the pump and start recording the field variables, but pressing BT_pararGravacao (Stop Recording) to stop recording without turning off the pump.

I'm relatively new to LabView, and I'm encountering these difficulties that a seal might solve in LADDER.


So what are all possible states of the system?

 

  1. Idle (no pump, no recording)
  2. Pump on and recording
  3. Pump on and not recording

And the following state transitions:

 

  • We can go from 1 to 2
  • We can go from 2 to 3
  • We can go from 3 to 1
  • We cannot go from 1 to 3

 

You are simulating 5 values. Is that independent of the pump and should always happen (what rate)

0 Kudos
Message 9 of 17
(195 Views)
Solution
Accepted by topic author Felipe_Alves17

Here's a quick draft to give you some ideas.

 

altenbach_0-1752345491903.png

 

0 Kudos
Message 10 of 17
(183 Views)