Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Event Structure

Hi,

U have me in a bit of confusion!

what is the hardware that you are using?

Are you trying to make a DAQ card to work like a DMM or do you have a High speed digitizer?

do get let me know

Regards

Dev

 

0 Kudos
Message 11 of 63
(1,932 Views)

Hi Dev:

 

I am very sorry. I should give you the infomation. I have two boards.One is 6250 and another one is 5112. If you think is not enough, please let me know with no doubt.

So, would you please let me know if I add one or two push buttons, you perferadding it in the case structure, not event structure. I really need your suggestion. Because without your suggestions, I don't think I can finish the project.

In your previous mail, you said the following:

"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"

Attached is my first picture file that indicated two segment. One is some time that is before DAQmx read vi and the other part is 1/10 seconds inside the loop. Am my understanding correctly? That is what you were talking about in the paragraph above. Please verify me here.

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.

What did you mean here? Did you mean that your program did not need to take count of the second before the DAQmx read vi. I don't understand. Could you pleas explain to me? Thanks!

 

Regards,

John

 

0 Kudos
Message 12 of 63
(1,929 Views)

Hmm, now i get i idea.

first, i will answer you have asked.

Attached is my first picture file that indicated two segment. One is some time that is before DAQmx read vi and the other part is 1/10 seconds inside the loop. Am my understanding correctly? That is what you were talking about in the paragraph above. Please verify me here

The acq i have posted will work for your PCI 6250.

In that VI, the virtual channels are configured,sample clock is set(these VI's two execute only once), the configured channels are scanned using DAQmx read continously inside the while loop and data is displayed every 1/10th of a second.

Here, you configure your channels and set ADC timing clock sequences just once and keep acquiring continously.

But in your old VI, you used to configure the channels and acquire from them on each loop iteration and that is not how continous acq should function.

What did you mean here? Did you mean that your program did not need to take count of the second before the DAQmx read vi. I don't understand. Could you pleas explain to me? Thanks

Yes, you do not have to programatically take count of second before each DAQmx read.

This is because, DAQmx Read will time itself and read data for a 1/10 sec period and update the data on the front panel after an interval of every 1/10 sec.

About adding a few more boolean buttons, yes you may add them but do take care of the program flow.

regards

Dev

 

 

 

0 Kudos
Message 13 of 63
(1,925 Views)

Hi Dev:

Thanks for your quick response.  I really need that.

The following message is what I need you to verify and answer: 

Attached is my first picture file that indicated two segment. One is some time that is before DAQmx read vi and the other part is 1/10 seconds inside the loop. Am my understanding correctly? That is what you were talking about in the paragraph above. Please verify me here

The acq i have posted will work for your PCI 6250.

In that VI, the virtual channels are configured,sample clock is set(these VI's two execute only once), the configured channels are scanned using DAQmx read continously inside the while loop and data is displayed every 1/10th of a second.

Here, you configure your channels and set ADC timing clock sequences just once and keep acquiring continously.

But in your old VI, you used to configure the channels and acquire from them on each loop iteration and that is not how continous acq should function.

That means the reason that takes time to count before the DAQmx read in my old VI is because I put the program in the timeout event case. The virtual channels need to configure each time of each loop and the acquiration of data is also need to take time. But in your vi, I don't need to take consideration of the time of the virtual channels and ADC timing clock because I set the parameters before I hit the run button in the program. Am my understanding correct?

What did you mean here? Did you mean that your program did not need to take count of the second before the DAQmx read vi. I don't understand. Could you pleas explain to me? Thanks

Yes, you do not have to programatically take count of second before each DAQmx read.

This is because, DAQmx Read will time itself and read data for a 1/10 sec period and update the data on the front panel after an interval of every 1/10 sec.

About adding a few more boolean buttons, yes you may add them but do take care of the program flow.

What do you mean? Do you mean I may add them in event structure. or case structure? Can you specify to me here directly? If the answer here is event structure, does it mean event structure is not necessay to apply everything in case structure feature. It is simply becasue of the example above that event structure can not take the time count out when executing the new program you gave me above.

Also, I would like to ask how come I can not turn the enable button on of my fixture using your program. I have already define the digital line on MAX, but it works on my sample I attached here, It did not work in your program. I don't understand why? What did I do wrong? Could you tell me please?

0 Kudos
Message 14 of 63
(1,924 Views)

Hi,

That means the reason that takes time to count before the DAQmx read in my old VI is because I put the program in the timeout event case. The virtual channels need to configure each time of each loop and the acquiration of data is also need to take time. But in your vi, I don't need to take consideration of the time of the virtual channels and ADC timing clock because I set the parameters before I hit the run button in the program. Am my understanding correct?

Yes that's right
 

What do you mean? Do you mean I may add them in event structure. or case structure? Can you specify to me here directly? If the answer here is event structure, does it mean event structure is not necessay to apply everything in case structure feature. It is simply becasue of the example above that event structure can not take the time count out when executing the new program you gave me above.

To make adding of new butons easier, I have implemented my logic event structure too. Have a look at attached VI. In it you can add other event cases for any boolean buttons you include.

This has one limitation. when the acquisition sub VI is running, the program control will be with that sub vi and if you press a button on the main event at that time, it will not take effect till the sub VI stops running.

Also, I would like to ask how come I can not turn the enable button on of my fixture using your program. I have already define the digital line on MAX, but it works on my sample I attached here, It did not work in your program. I don't understand why? What did I do wrong? Could you tell me please

Seems like i was not passing true value to boolear write, now u check it out in the attached VI.

regards

Dev

 

0 Kudos
Message 15 of 63
(1,917 Views)

Hi Dev:

 

I tried the attached vi. The enable button turn on and the mean read the value. After that, I press the reset botton on sub vi programl. The enable button will not go back to the reset button. Why?

 

I need you quick response. Thanks! I am very appreicate your help

0 Kudos
Message 16 of 63
(1,910 Views)

Hi Dev:

 

I just tried pressing enable button again. The light did not work. Do you think I should put some wire between the button and the digital input like my old file

0 Kudos
Message 17 of 63
(1,907 Views)

Hi,

i made that enable switch's mechanical property as latch when released from its original switch when pressed.

So, i am passing constant true value to the boolean state to write.

If you want to connect the switch directly, change the mechanical action of the switch to 'switch when pressed' and at the end of the event, reset the  boolean state of enable button to default false by using a property node.

hope this helps

regards

Dev

 

 

0 Kudos
Message 18 of 63
(1,905 Views)

Hi Dev:

 

I am sorry, your program works. I tried a lot more. It works.

I found the reset button is only stop the sub vi. the main vi is running. is that right?

I don't understand that part. See attated

0 Kudos
Message 19 of 63
(1,903 Views)

Hi,

Yes u got it right.  The reset is used to stop the sub VI.

In your 'New current meter.Vi', whenver you were pressing reset button, you were setting this boolean line true in that event case.

I did that digital write in the sub VI to do the same action you were doing in your VI, when you press reset button.

Regards

Dev

 

 

 

0 Kudos
Message 20 of 63
(1,899 Views)