Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

measuring analog input at particular time

Hi there,

 

I am having some problem with accessing value through local variable. I am measuring analog analog inputs continously but I want to access value of analog input only at some particular time.

 

 

Explaination: Digital output p0.7 goes high only for 2 secs,It can be seen in VI. I want to record ai at that time only and after that It should not change until execution comes back to same point. Similarl case happens for P0.4

 

I am to measure the analog inputs but not able to store them without being changed in my decision loop.

 

Please have look at VI and assist me how to solve the problem.

 

Best Regards,

Anurag

0 Kudos
Message 1 of 5
(3,046 Views)

Hi anuvohr,

 

to help you, it is neccessary that you reduce your VI and resize it. Your VI is as large as a wallpaper because you don't adjust any function blocks. Please post the second version with only one analog and one digital channel. It would also be helpful if you can give use some information about the used hardware. What do you want to archive? I can't see any synchronisation between the differnent tasks but I think that is something which you want to do.

 

Regards, Stephan

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

Hi Stephan,

 

Thanks for your reply...,first of all sorry for messy program.

 

What I am trying to do is following:

1.I am using digital output to activate base of transistor. Which goes high for 2seconds. 

2.I am measuring analog input voltage all the time beacuse I have some default o/p voltage on transitor output.

3. My requirement is to record the output of the transistor when DO goes high and to keep it until it goes high again.

4.For that purpose,I have made timer loops through sequential statements. Which access value of analog input only when DO goes for 2seconds. Otherwise nothing for 5seonds before and 4seconds after that.

 

I am using USB6289 with BNC2120 connector.

 

I don't have option rather to make such huge programs because I have to deal with 16 such transistors. and many more things beside that.

 

I hope,I am able to give clear view regarding my problem.

Please have a look at new program.

 

Regards,

Anurag

0 Kudos
Message 3 of 5
(3,023 Views)

Hi Anurag,

 

first of all, I would change the way you generate the digital signal which goes high for 2 secondes, than low for (I think) 2 seconds, than again to high ...

The way which you use will work, but it is not the best way to generate the signal very well. I would recommend to you, that use the digital task with a clock cycle of 2 seconds. This approach will be much better and easy to maintain later.

I attached an example for this part of your programm. Please take a look at the VI and modify it, so that it will work for you. After that, you could take the next step.

Point #3 in your discription is a little bit difficult to understand. Do you want to start your data aquisition with the change of the digital signal from low to high and stop the aquisition with the change from high to low?

 

Stephan

0 Kudos
Message 4 of 5
(3,008 Views)

Hi Stephan,

 

Thanks for the corrections,but I am getting some issues with the program you suggested. "It is giving an error that external clock source must be provided for the task." I tried it with using internal clock but still not working.

 

Digital signal first remains low for 5seconds,then goes high 2seconds,then goes low for 4 seconds. Then again the same sequence follows in next iteration of the loop. I hope its not confusing for you. 

 

 

#Point 3: Yes,thats also possible to acquire analog inputs when digital output goes high. Because I need the value at that for making some decision loops.

 

Thanks for your help

0 Kudos
Message 5 of 5
(3,003 Views)