Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Acquire values only when digital output is high.

Solved!
Go to solution

Hi there,

 

I am working with testing of transistor,whose gate is controlled by digital output from USB6289,connected with BNC2120.

 

Test plan:

 

1.Transistor's gate is activated for 5seconds, with P0.0 for e.g.

2.Then everything remains off for 1seconds.

3.P0.1 is used as digital output to activate the circuit which pass the curent through in reverse direction,P0.1 goes high for 3seconds,PS: Gate is switched off.

4.The same cycle repeats again.

 

My question is to store values at output of transistor when P0.0 and P0.1 goes high,and those values should not change until my respective digital outputs again go high.

 

I can access output of transistor by continiously reading my power supply values.

and  in on off state I want to read through AI0 because at that time my power supply is off,So that I can activate the circuit to pass current in reverse direction.  

 

Again my question is to acquire the output value through power supply when P0.0 is high and store it until transistor gets switched on again.

and same for P0.1,acquire output value through AI0, when P0.1 is high and store it until it goes high again.

 

 

I hope,I am able to explain my problem clearly.

Please help me out.

Regards

Anurag

0 Kudos
Message 1 of 11
(3,486 Views)

@anuvohr wrote:

Hi there,

 

I am working with testing of transistor,whose gate is controlled by digital output from USB6289,connected with BNC2120.

 

Test plan:

 

1.Transistor's gate is activated for 5seconds, with P0.0 for e.g.

2.Then everything remains off for 1seconds.

3.P0.1 is used as digital output to activate the circuit which pass the curent through in reverse direction,P0.1 goes high for 3seconds,PS: Gate is switched off.

4.The same cycle repeats again.

 

My question is to store values at output of transistor when P0.0 and P0.1 goes high,and those values should not change until my respective digital outputs again go high.

 

I can access output of transistor by continiously reading my power supply values.

and  in on off state I want to read through AI0 because at that time my power supply is off,So that I can activate the circuit to pass current in reverse direction.  

 

Again my question is to acquire the output value through power supply when P0.0 is high and store it until transistor gets switched on again.

and same for P0.1,acquire output value through AI0, when P0.1 is high and store it until it goes high again.

 

 

I hope,I am able to explain my problem clearly.

Please help me out.

Regards

Anurag


a simple shift register, boolean logic, a state machine w/timer  and daqmx read/write will do what you want....

0 Kudos
Message 2 of 11
(3,475 Views)

Hi Apok,

 

Thanks for your reply,can you suggest me any literature or demo program for it. I don't have any idea about it. 

 

The thing is I know how to how to take DO and access Analog Input through DAQmx functions. The only problem storing values for those particular instants.

 

Rest I can access evrything in general,it is working perfectly. The problem is storing those values.

 

Waiting for your kind reply.

 

 

Regards,

Anurag

0 Kudos
Message 3 of 11
(3,463 Views)

Hi anuvohr,

 

here you can find some information about Shift Registers, Case Structures and many other LV functions.

 

Getting Started with NI LabVIEW Student Training

http://www.ni.com/white-paper/7466/en

 

hope this helps.

 

If you need further information please let us know.

 

Regards,

Daniel

Message 4 of 11
(3,453 Views)
Solution
Accepted by topic author anuvohr

think about what states (subject matter:statemachine and Determining When to Use Sequence Structures) you want to happen from t0....t(n-1), whether DAQmx is generating DO outputs and/or AI inputs are being acquired and what needs to happen (timed out event), before you transition to the next "state."

 

type def an "enum" with your different states:

  • initialize
  • wait (user initializes set times(sec) for states, or whatever and presses "start button")
  • t0 (generate DigOutputs, store acquired AnalogOutput data (number to string output) on shift register, before moving on to next state >> user "set time" must elapse (note: Use the Wait function to control the loop execution rate and allow the processor to respond to external events and system tasks and avoid using any of the Wait functions to time a software operation...)
  • ...
  • t(n-1) if "end (requirement made)" >>goto "stop", "else (requirement not made)" >>goto whatever "state."
  • stop
  • write data (string) text file.

 

 

Message 5 of 11
(3,427 Views)
  • please supply a timing diagram for both DO's starting at t0...t(n-1) and the time(sec) between them
  • how  many times to cycle or what condition must be met to stop program or user stops program....
  • record data of both AI's when both DO's are logic hi
  • do you need recorded data file of AI's or are you going to use the data elsewhere?

 

 

0 Kudos
Message 6 of 11
(3,381 Views)

Hi Daniel and Apok,

 

Thanks a lot for your guys. Really helpful links.

 

I am working on it,I will try to complete it today itself, I will upload it if there are some issues.

 

 

@Apok:I will provide timing diagram too.

 

Regards,

Anurag

0 Kudos
Message 7 of 11
(3,367 Views)

Hi Anuvohr,

 

Please let us also know if it works now.

 

Thank you.

Regards

Daniel

0 Kudos
Message 8 of 11
(3,365 Views)

Hi Daniel and Apok,

 

Thank you guys for great help,it works the way I want it to work.

 

Small help: I want to do it for 16 transistors one after another but I don't want to make in one state machine.

 

How shall i do it?? 16 different state machines with some wait states between them or 16 sequential state machines??

 

Which method will be good?? Only point It should work one after.

 

I want it seprate it because if one of the transistor based on some of decisions fails,I will be switching it off permanently.

 

One more issue How to save all the data for one state machine??

 

Best Regards,

Anurag 

0 Kudos
Message 9 of 11
(3,344 Views)

play around with this....Smiley Wink

 

simulatedVI.png

Download All
0 Kudos
Message 10 of 11
(3,341 Views)