From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Triggering Encoder Signal To Read Frequency

Hey,

as a part of my master thesis i had to switch to another measurement system which requires LabVIEW to run correctly after the original system broke down.  Therefore I am totally new to LabVIEW.

 

Our test rig is monitored by different analog sensors and two encoders. It also sends a digital trigger signal every 15 minutes to the system to start the measurement.  The main goal is that the data after each trigger signal is saved in a file there each column represents one sensor.

 

I am trying to trigger an encoder signal with a digital edge but constantly receiving the error that the device (USB-6363) does not support the task of triggering. For the analog signals it is working fine (upper part of attached VI).

 

We tried another method there LabVIEW constantly plots the data and only writes it to a file when the trigger signal occurs but without success (not in attachment). 

 

If someone has an idea how I could solve this problem, i would highly appreciate it. 

Thanks,

Rene.

 

Setup:

LabVIEW 2019 SP1

NI USB-6363 BNC

0 Kudos
Message 1 of 5
(2,667 Views)

I can't look at your code unless you back-save, preferably to LV 2016 or earlier.

 

If I understand correctly, I'd configure the analog task for retriggerable finite acquisition and then configure the encoder tasks to use the AI task's sample clock.  Then they won't need to be triggered, you just need to start the encoder tasks *before* starting AI.

 

Else, you'll need to look into "Arm Start" triggering for the encoder tasks, which adds a level of complication you probably don't need.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 2 of 5
(2,626 Views)

OK, the first order of business (unfortunately for you) is to Learn LabVIEW.  Find someone who knows it pretty well and "apprentice yourself" to her (or him) for a few days -- if you are a Master's Thesis student, and they just changed Measurement Systems on you, you want to get up to speed quickly, and almost nothing beats "one-on-one".

 

Here are some comments:

  • Do you really want to take one second of data (finite samples, 1000 points at 1 kHz) every 15 minutes (the rate of your trigger pulse)?
  • The Error Message means that the Counter/Timers have no "Trigger" input.  The Analog routine can be triggered, but how does that help you? 
  • Is there anything else in the 6363 that can respond to a Trigger signal?  Could you use that as a "Start" for both the Analog and Counter Tasks?  Do you know how to start two LabVIEW  routines at the same time?
  • If the answer to the last Question is "No", find a LabVIEW Guru and get an explanation of the Principle Of Data Flow!!!

Bob Schor

0 Kudos
Message 3 of 5
(2,616 Views)

Hey Guys,

 

thank you for the feedback and critical questions. 
We finally solved the problem for our application (see attachment, uploaded it in V2016). 
We were not able to fit the analog tasks and the frequency tasks into one case structure. Fortunately we have two NI USB-6363 devices. Therefore I can use one for the analog tasks and the other for the frequency (encoder) tasks. Both devices are running simultaneously. 

 

We do not have any LabVIEW experts in our house. For this reason our VI does not look 'professional' but it is doing what it is supposed to.

 

If someone has ideas for improvement it would be highly appreciated.

 

0 Kudos
Message 4 of 5
(2,545 Views)

My ideas for improvement would require an awful lot of LabVIEW and DAQmx background knowledge which I can't distill into the time and space I have here.

 

DAQ Assistants and Express VI's make it easy to get started but then leave you stuck near the starting gate.  Regular DAQmx and analysis functions would open up an awful lot of important options, but also require a lot more learning time.

 

This would *definitely* be possible to do on a single 6363 board, though you'd probably still need separate loops for your AI task and your encoder frequency measurement tasks.

 

The "solution" you have now has an important flaw you should be aware of.  Your various tasks are not sync'ed in time.  Hopefully you can still correlate the data during post-processing, but I honestly don't know how timestamping information might get handled by the DAQ Assistants, the blue "dynamic data" wire, and the file writing Express VI.  There's a possibility you might be losing any chance of correlating the measurements you took.

 

My recommendation: carefully consider the data you collect now.  Figure out a way to evaluate whether you can accurately *correlate* your measurements in time during a post-processing step.

 

I understand and appreciate that learning LabVIEW and DAQmx isn't a goal of yours, you just needed to dabble about with hardware long enough to solve a particular problem.  The main trouble with such dabbling is when something *actually* works just a little bit different than how you *think* it works, due to lack of expertise in the field.  That's why I brought up the business about sync and data correlation.  Those are things that can potentially set you up to make wrong interpretations and decisions because you get data that looks believable but which is actually not accurate in a fairly subtle way.

 

So it's pretty important to set up a controlled experiment that lets you properly evaluate your ability to correlate the data.  True sync (at the hardware capture level) is simply not gonna happen with your DAQ Assistants.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 5 of 5
(2,532 Views)