LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-Scope updating waveform display

Still working through how to use Ni-Scope with our new USB-5132

 

I have a VI that seems to be working but only works once. That is the very first sweep is displayed on the waveform display but it is never updated. Watching my code execute it looks like it should be updating the screen every time the loop runs, but it doesn't. Nothing fancy going on here I am just looking at a 60hz sine wave. I can pull either probe off the circuit and the waveform display never changes from the very first sweep.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 1 of 18
(2,961 Views)

Did you try auto trigger?

 

Snap12.png

 

mcduff

0 Kudos
Message 2 of 18
(2,958 Views)

PS I would refactor your program to a State Machine that includes an event structure, like the JKI State Machine. Smiley Wink

0 Kudos
Message 3 of 18
(2,957 Views)

Auto trigger makes no difference.

 

Also I use state machines all the time but I never could figure out how to use the JKI state machine. This is probably the third time I even used an event structure since its inception. if it's not too obvious already I don't really understand how to use them.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 18
(2,929 Views)

Give me a few minutes to get to my PC and I'll take a  look. 

 

Sometimes even real experts need to see the code.


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 18
(2,919 Views)

I have not used NI-Scope much at all, so these are suggestions:

  1. Your timeout is short 1 ms, I know your acquisition is 100 us, but updating your display at 1kHz is insane, change it to 100ms to start.
  2. There is no "start" in your code or anything I see that sets it to acquire continuously.
  3. Do you need a start for each new acquisition?

I'll let the expert, Sir Jeff, figure out the remedy.

 

mcduff

PS Event structures are extremely powerful. I highly suggest learning them.

Message 6 of 18
(2,917 Views)

See comments in code:

 

Fetching does not Initiate an acquisition that was your primary issue.

I addressed some other things as well

  • Timeout case was queueing up every 1mSec there was no user activity (Regardless of acquisition length) that was bad...
  • Dup Code in unnecessary initialization case and config value change case (Fixed by using a singleton timeout as an event in the configure case)
  • Exit latching boolean would never unlatch (See Comment in exit case)

For a Developer that never used NI SCOPE before and is new to events- I'ld give it a solid C+ with a suitable boost for asking the right questions here!


"Should be" isn't "Is" -Jay
Message 7 of 18
(2,916 Views)

Here is a great link for User Events, which can be combined with normal events.

 

https://github.com/JackDunaway/LabVIEW-User-Events-Tips-Tricks-and-Sundry

 

Not to hijack the thread, but the examples are tremendous.

0 Kudos
Message 8 of 18
(2,909 Views)

@mcduff wrote:

Here is a great link for User Events, which can be combined with normal events.

 

https://github.com/JackDunaway/LabVIEW-User-Events-Tips-Tricks-and-Sundry

 

Not to hijack the thread, but the examples are tremendous.


You should try working on s project he had a hand in architecting...nice job if you can get it.


"Should be" isn't "Is" -Jay
0 Kudos
Message 9 of 18
(2,906 Views)

@JÞB wrote:

See comments in code:

 

Fetching does not Initiate an acquisition that was your primary issue.

I addressed some other things as well

  • Timeout case was queueing up every 1mSec there was no user activity (Regardless of acquisition length) that was bad...
  • Dup Code in unnecessary initialization case and config value change case (Fixed by using a singleton timeout as an event in the configure case)
  • Exit latching boolean would never unlatch (See Comment in exit case)

For a Developer that never used NI SCOPE before and is new to events- I'ld give it a solid C+ with a suitable boost for asking the right questions here!


 I can't look at your code at home as I only have the Home Edition (2014) here. But I think I know what you are saying. As I said I never really understood event cases. Anyway what I am after here is basically making an oscilloscope. The end user needs the ability to analyze the waveform by "tweaking knobs" the same way they normally would with an oscilloscope. I know duplicate code with the first call was wrong. I originally started with a producer/consumer to with a event structure in the producer to handle the scope controls. (QMH?) But had trouble with the initializing the instrument before the producer started acquisition, and the first call thing was a band-aid that I carried over this morning .

 

As for NI-Scope, It should not even be called that. I know how to operate an oscilloscope, I have been automating oscilloscopes or years. But I have never had to set the time base on any oscilloscope by calculating the right sample rate and number of records I need to acquire to see 5 cycles of any given frequency.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 10 of 18
(2,891 Views)