LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Engine Data Acquisition System

Hey, thanks for that info. It all makes sense now. Yes both my sensors are connected to the same DATA card (NI USB 6343). I'll try that clock method what u told me and see what I can get. Is it OK if my pressure sensor DAQ assist is set to continuous samples instead of On demand? Will it affect my data then??

0 Kudos
Message 11 of 26
(1,924 Views)

@Michael_78 wrote:

the shift register works but will grow in memory size until the application crashes!  limit the number of times the loop can run, maybe a for loop instead of while loop to be safe.


Very true - several people had posts on the forum just today with this issue. I don't agree a For loop is the appropriate solution though - if running for a long time something like a Producer/Consumer

 should be considered. 

 


@Michael_78 wrote:

 Wire the AI Sample Clock to the counter clock source, instead of OnboardClock.


It is 🙂 or perhaps inverted, I'm not sure which way you mean. But the snippet shows a shared clock with regular timing.


GCentral
0 Kudos
Message 12 of 26
(1,924 Views)

@JerryD4299 wrote:

Hey, thanks for that info. It all makes sense now. Yes both my sensors are connected to the same DATA card (NI USB 6343). I'll try that clock method what u told me and see what I can get. Is it OK if my pressure sensor DAQ assist is set to continuous samples instead of On demand? Will it affect my data then??


Set them both to be continuous, with the same timing and number of samples, but add the extra info to advanced timing tab as described a couple of posts back.


GCentral
0 Kudos
Message 13 of 26
(1,923 Views)

So if my encoder is reading in 2500 pulses per rev should I try to set my pressure sensor to read data at a rate of 2500 something. Coz I'm not sure that the DAQ assist for the Crank Angle has a box for samples to be read or something.

0 Kudos
Message 14 of 26
(1,920 Views)

When I opened your VI, double clicking the crank angle DAQ Assistant gave me a dialog with "on demand" at the bottom.

You should be able to change that to continuous and then the samples and rate open up/unlock.


GCentral
0 Kudos
Message 15 of 26
(1,916 Views)

Ok budd, Ill try that and see what I can get. Thanks for the help. I knew I was doing something wrong.

0 Kudos
Message 16 of 26
(1,915 Views)

I edited my post, i read the clock setup wrong- my brain assumed AI at the top and Counter at the bottom Smiley Embarassed

 

As for the For loop, i meant this to be only for a quick test but safer, not in the final application.  whichever way it is done care needs to be taken not to put gigasamples in the X-Y chart!

0 Kudos
Message 17 of 26
(1,913 Views)

I don't have LV 2017 or later to modify in place, but there's one small detail to address in the nice example from msg #6.  When multiple tasks share a sample clock, it's important to make sure all the *derived* tasks start first and the master task starts last.  Here, the Ctr task derives its timing from the AI task, so the code should be sequenced to make sure the Ctr task is started first and the AI task is started last.  Below is an incomplete snippet showing one way to enforce this sequencing.

 

 

-Kevin P

 

start master task last.png

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
Message 18 of 26
(1,898 Views)

Hey man, here is my updated VI. I went ahead and set the sample type to continuous for the Crank Angle DAQ assist, and also specified ai/sample clock under Advanced Trigger. Do u mind having a look and telling me if its right? I'm new to lab-view and my school gave me this project to begin with. 

 

Thank you. 

0 Kudos
Message 19 of 26
(1,873 Views)

Simple answer: Looks like it should work now to me.

 

However, you removed the Stop button (probably because of my confusion due to overlapping wires in the previous image) and so now you can't choose to stop the loop. You should probably re-add a Stop button and connect it to the Stop inputs of both DAQ Assistants.

 

Once you're happy that it's working as you want, you can try implementing it in more "low-level" code using the DAQmx VIs, if you have the time. I'm sure I or others here can check your progress/final VI and if you want to do more complicated things with LabVIEW in the future then knowing how to avoid the Express VIs (particularly the DAQ Assistant) will be very helpful.

 

As a starting (but not finishing) point, you can try right clicking on the DAQ Assist nodes and choosing "Generate DAQmx Code". This will use scripting to create equivalent (but messier) code to what you have with the DAQ Assistants. You'll probably need to rearrange with respect to loops (you'll want both Reads to be in the same While loop, and only have one While loop (not nested, which is what is auto-generated when I tried it just now)), and you might want to move things around to tidy them up.


GCentral
0 Kudos
Message 20 of 26
(1,867 Views)