LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Run the sub diagram continuesely event though event structure work on timing

I want to generate my first diagram output voltage continuously, but my event structure has timing so it is controlling my first diagram also .

 

See my attached vi.

i want to measure the Analog output voltage continuously of my first diagram, but my event structure has timing for other digital output signal, so i can see my voltage only when timing is changing. 

 

so please send me a vi how i can get this issue resolved.

0 Kudos
Message 1 of 10
(1,179 Views)

Hi Holas,

 


@Holas1505 wrote:

I want to generate my first diagram output voltage continuously, but my event structure has timing so it is controlling my first diagram also .

 

See my attached vi.


Ok, so the question is: why do you want to use an event structure at all?

Why not simply read the stop button inside the loop?

 

On your VI: you really should learn from the example VIs provided by NI in the example finder!

  • NEVER delete the label of a control! You may hide it on the frontpanel, but NEVER delete…
  • All the DAQmx configure functions belong BEFORE the loop!
  • All the DAQmx close functions belong AFTER the loop!
  • You might use DAQmx scales to convert your current reading into a pressure value…
  • Left to right wiring is STRONGLY preferred!
  • Why are there local variables of "Input" (and others) when you can simply use wires! THINK DATAFLOW!
  • Think about using a producer-consumer scheme instead of placing ALL code into "One Big Loop"! Especially that logging stuff using RGT functions should be placed in its own loop…
  • Why is the timing using orange wires when your event structure expects blue wires? Think about using the right datatypes when creating code…
  • What's the point of that case structure when you simply add 0 or 1?
  • What's the point of formatting the timestamp into strings using two different functions?
  • Why do you need an "Input" indicator when is shows the very same data as "Pump on"?
  • Use BuildArray to build an array instead of InsertIntoArray"!
  • Do you really need to save to file with each iteration?
  • Do you really need to show the labels of functions? Use the context help window instead…

Using AutoCleanup after applying some changes to your code:

Best regards,
GerdW


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

Dear Gred,

 

Thank you for your guidance , i am new to labview so not knowing about some features.

Now, i will make changes as per your suggestion.

 

Event structure i have use for ON and OFF cycle.

 

Thanks 

0 Kudos
Message 3 of 10
(1,106 Views)

@Holas1505 wrote:

Event structure i have use for ON and OFF cycle.


No, you don't "have to use" the event structure!

You can, but you could also use a simple wait function instead…

Best regards,
GerdW


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

But i want to stop the timing when i press stop, so if i will use wait function than it will wait till the time is complete.

0 Kudos
Message 5 of 10
(1,058 Views)

Dear Gred,

 

Some more query, as i have already attached my VI.

 

Done some changes as per your suggestion.

 

1. i want to save report whenever i need.

2. i want to all the sub diagram from one stop button.

3. i want my output to be off whenever i press stop button.

 

Can you help me with example.

0 Kudos
Message 6 of 10
(1,056 Views)

Hi Holas,

 


@Holas1505 wrote:

Dear Gred,

Done some changes as per your suggestion.


Now there are even more terminals with deleted/hidden labels! You still use wrong datatypes, unneeded locals instead of wires, InsertIntoArray instead of BuildArray, ... And additionally you stop a DAQmxTask inside a loop, but still try to read from the task in the next iteration!

You also seem to have trouble to write my (nick)name correctly.

 


@Holas1505 wrote:

1. i want to save report whenever i need.

2. i want to all the sub diagram from one stop button.

3. i want my output to be off whenever i press stop button.


  1. Please define "whenever I need"! When you want to save only on request then there should be a case structure around the RGT functions...
  2. Then you shouldn't use 3 buttons as you do right now. Use only one button - and anything from locals, notifiers, queues, channels, ...
  3. When you want your "output off on STOP" then you should switch off the output signal AFTER the loop has finished and BEFORE the DAQmxClose function. THINK DATAFLOW!
Best regards,
GerdW


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

Dear GerdW,

 

soory for wrong spell before.

 

Can you share example with VI if possible!! as i am new to LabVIEW somethings doesn't understand properly.

 

Thanks

Holas

0 Kudos
Message 8 of 10
(1,005 Views)

Hello,

 

I want to off my DAQ output whenever i press stop button of my while loop.

 

Attached vi for reference.

 

Pls share vi for changes.

 

Thanks

0 Kudos
Message 9 of 10
(1,004 Views)

Hi Holas,

 


@Holas1505 wrote:

I want to off my DAQ output whenever i press stop button of my while loop.


See message #7…

 

(Please stick with your thread instead of starting new ones for the same question.)

Best regards,
GerdW


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