LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Update Waveform Chart and Indicator clearing

Got two issues with the attached VI. 

1.  Would like to get both charts in my VI to update at 2 Hz or more and scroll 2 minutes of data.  This VI could run for days at a time so no need to see it all, just last 2 minutes. 

2.  Is there a way to "zero" the indicator that I placed on the main page?  It resets when I start the VI, but if I stop recording I have to totally stop and restart the VI to reset the indicator.  FYI, the "Reset Cycles" boolean is intended to do that but it just isn't working.

 

Thank you.

0 Kudos
Message 1 of 4
(1,765 Views)

Hi Rich,

 


@Rich_Tennant_Tech wrote:

1.  Would like to get both charts in my VI to update at 2 Hz or more and scroll 2 minutes of data.


To update your charts at 2Hz you need to run the loop at 2Hz!

Right now you read 10 samples at 2Hz samplerate (both DAQAssistent) which takes 5s - or just 0.2Hz loop rate. Do that simple math on your own…

 

To show 2min of data your charts have to show atleast 2S/s*60s/min*2min=240 samples. So you just need to set the history buffer size of your charts to keep atleast 240 samples. This is quite simple when one works with plain datatypes (like scalar float values), but you decided to use the DAQAssistent ExpressVI with its evil DDT datatype: no idea what the result of this decision might be…

 


@Rich_Tennant_Tech wrote:

2.  Is there a way to "zero" the indicator that I placed on the main page?  It resets when I start the VI, but if I stop recording I have to totally stop and restart the VI to reset the indicator.  FYI, the "Reset Cycles" boolean is intended to do that but it just isn't working.


To "zero"/"clear"/"set to certain value" an indicator in the frontpanel you just need to write the desired value to the indicator. Simple dataflow - which is the basic principle of LabVIEW!

 

Which indicator do you actually want to "zero"? I guess you are talking about this part of your code:

What result do you expect from merging two values (one integer, one boolean) into a DDT wire - and displaying this DDT containing two signals in a scalar integer indicator? Did you notice that coercion dot and do you know its meaning?

Best regards,
GerdW


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

GerdW,

Thanks for the help.

1.  On the charts, one thing to keep in mind is that when a DAQ Assistant is used and "Continuous Samples" is selected, the number of samples isn't used per say, the assistant just uses it along with the Rate (Hz) to determine the buffer size not the number of samples.  So I'm still not sure of what needs to be done to get both charts operating at 2Hz ~ maybe dropping them into a case and running that at 2 Hz??

 

2.  There's only one indicator in the VI, so yes, the "Channels recorded" indicator is the one that needs to be cleared.  And my intent was to use the "Reset Cycles" boolean to do that.  I know that I do not have it right because its not working, this is why I posted for help.  Please note that I'm not even through my Core 1 online class yet, so connecting different data types that don't play nice is a problem that I still need to work out.  So again if you have a suggestion I all ears.

0 Kudos
Message 3 of 4
(1,683 Views)

Hi Rich,

 


@Rich_Tennant_Tech wrote:

1.  On the charts, one thing to keep in mind is that when a DAQ Assistant is used and "Continuous Samples" is selected, the number of samples isn't used per say, the assistant just uses it along with the Rate (Hz) to determine the buffer size not the number of samples.  So I'm still not sure of what needs to be done to get both charts operating at 2Hz ~ maybe dropping them into a case and running that at 2 Hz??

 

2.  There's only one indicator in the VI, so yes, the "Channels recorded" indicator is the one that needs to be cleared.  And my intent was to use the "Reset Cycles" boolean to do that.  I know that I do not have it right because its not working, this is why I posted for help.  Please note that I'm not even through my Core 1 online class yet, so connecting different data types that don't play nice is a problem that I still need to work out.  So again if you have a suggestion I all ears.


1. I would get rid of the DAQAssistents at all and use plain DAQmx functions - as explained here and in all those DAQmx example VIs coming with LabVIEW…

 

2. It doesn't make sense to "zero"/"clear" an indicator - due to "THINK DATAFLOW!" mantra. You need to reset the data source and not the data sink… To do so you need to reset the data hold/stored in this shift register: use a select node, with data from shift register at lower FALSE input and a zero at the upper TRUE input. The button (set to latch behaviour) goes to the selector input of the Select function:

 

IF button THEN data:=0 ELSE data:=data

 

 

Best regards,
GerdW


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