Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Event Structure

Hi:
 
I have a question on event structure. I have a timeout event struture and enable event structure. Attactment is a sample1 that shows if the shift register does not store -1, it will execute the timeout event. I would like to ask if I have a timeout event which take the average in 1/10 second, what value should I put in enable event structure in the shift register in order to take average in every 1/10s.
0 Kudos
Message 1 of 63
(5,033 Views)

Hi,

From your VI, I understand this.

Once you press enable, you want to do an acq and calculate mean every 100th milli sec

The sampling rate you have selected and number of samples to read will result in data getting acquired for 100 milli sec or 1/10th  of a sec.

so, once you press enable, you will want this config and acq to be happpening 10 times in a sec, or 100 mSec per acq.

To achieve this, the timeout case event should be executing continously after pressing enable.

so the timeout will be 1 milli sec.

But, even this should not really give accurate 1/10th sec acq, the reason being you are creating a virtual channel and start each time before doing a DAQmx read and this also takes some finite time.

so, think of a way to get over this.

regards

Dev

 

0 Kudos
Message 2 of 63
(4,962 Views)

Hi,

 

I still don't understand timeout here. could you explain to me first. I am in an urgent, could you pls reply to me promply. I appreicate your help

0 Kudos
Message 3 of 63
(4,959 Views)

Hi Dev:

 

I think I had some idea. You mean in the eable event structure, the timeout is set 1 in the shift register. Am I correct?

0 Kudos
Message 4 of 63
(4,958 Views)

Hi Dev:

 

I am sorry. I think I would like to make thing easy, so I need to answer your suggestion again here. Is it important to count the finite time. because I just to need to make it like DMM. The value is stable and it can stay there for a minimum of 2 seconds.

0 Kudos
Message 5 of 63
(4,971 Views)

Hi,

i am trying to send an attachment

And it is failing, 😞

plz wait till i am able to send it

regards

Dev

0 Kudos
Message 6 of 63
(4,952 Views)

Hi,

 

Take a look at attached VI( meter_1 is the main VI and one acq is the sub vi)

 

I have tried to do the same what your current meter VI does, but with different logic.

 

It does what you want to achieve  without the use of events..

 

When you press enable, first the 'enable digital port' is set and then a sub vi opens which does continous acq with an iteration every 1/10 of a sec.

 

On this sub vi, pressing reset, stops acq and sets the 'reset digital port' and returns to main screen

 

Hope this helps

Regards

Dev
0 Kudos
Message 7 of 63
(4,953 Views)

Hi Dev:

 

Thanks.

In your previous mail, do you mean your example will skip the 1ms timeout in shift register of the event structure when pressing the enable button on or off, that way i can get an accurate 1/10th sec acq. Am I correct?

If so, I would also like to know if I add one or two push buttons, you perfer adding it in the case structure, not event structure, I need your suggestions.

Attachment is what I am trying to do right now, I have add  niScope EX Multi Record vi in it.

 

0 Kudos
Message 8 of 63
(4,927 Views)

Hi,

Your attachment is missing!

This is what  i tried to demonstrate in my VI.

"In the Vi you  developed using event structure, you will not read input every 1/10 of a sec, since when flow goes to the time out case, first your virtual channel is created, then sample clock is set and start acq is given and all this takes some time to happen.After this, DAQmx read for 1/10 to of a second. Totally, this timeout condition will take more than 1/10 of second to finish. and your objective is not achieved.

The 1 msec time out ensures that teh time out condition is executed almost continously till you press reset and make it -1"

However in the attached VI where i have not used case structure, continous AI read happens every 1/10 of a sec without configuring AI for each loop.

Hope this answers your doubt.

regards

Dev

 

 

 

0 Kudos
Message 9 of 63
(4,922 Views)

Hi Dev:

 

I am very sorry. I thought I did my attachmet because I remebered I did it one more time. Anyway, I am attating my file. Please take a look and give me some suggestions. Thanks!

 

0 Kudos
Message 10 of 63
(4,920 Views)