取消
显示结果 
搜索替代 
您的意思是: 

Pulse Timing

Hi, I'm just getting back into LabView and haven't used it in a while.

 

I need to activate a digital output on my DAQ for a certain duration (~4ms) and am not sure on the best way to accomplish this.  I am using a lot of the outputs, except I only need 1 output to be active for that duration once the user presses a "go" or "ok" button on the front panel.

 

I was thinking of using a while loop, but I'm not sure on the syntax and whether this is the appropriate method to use.

 

Any help will be appreciated!

 

Thanks,
Colin

0 项奖励
1 条消息(共 10 条)
4,483 次查看
I figured I should attach a copy of my VI.  The one I need to activate is RLIGBT1 for a certain duration.
0 项奖励
2 条消息(共 10 条)
4,482 次查看

Hey,

Use two daq assistant for DIO one where you can set the ms time and other you just output.

Cheers

 

-Lab

0 项奖励
3 条消息(共 10 条)
4,448 次查看

I'm confused by what you mean.  Here's where I've gotten so far on my own.  I'm not sure what you mean though.  Will the one just outputting stop?  Should the DAQ assistants be in the while loop?  You lost me.

 

I'm usting LabView 8.2.1 and I'm attaching a screenshot of my current progress (who knows if it's anywhere near the right direction).

0 项奖励
4 条消息(共 10 条)
4,439 次查看
Sorry, I had a mispelling and forgot to attach the image.
0 项奖励
5 条消息(共 10 条)
4,431 次查看

Well I'm trying something new and am unsure on how it will work.

 

Can I do something like the attachment I posted?  I'm trying to add the numeric control to the tick count when the while loop is called and compare it to the current tick count, stopping the while loop when the current surpasses the original + duration.

 

Secondly, with this current configuration will the while loop only be activated when the Run button is called?  That's what I'm trying to go for.

 

One more thing, what can I input to the DAQ that will allow for it to be turned off when the while loop ends?  I figured I could use a boolean, but there's only an output so I can't see how to switch to false when the timer reaches it's threshold.

 

Thanks in advance,

Colin

0 项奖励
6 条消息(共 10 条)
4,409 次查看

Hey,

I see you want to run your DAQ when you press OK button, the best practice will be to use events or the simpler way is to sequence structure with blank while loop running and the OK button connected to Stop terminal of that while loop and in the second sequence structure you will have your regular DAQ code.

 

Keep us poted on it goes.

 

Cheers

Lab

7 条消息(共 10 条)
4,380 次查看

Thanks for the reply.  I think I get what you're saying but don't know how to implement it.  What port in the event structure would I attach the OK button to? 

 

And how would I turn the DAQ off after the say 4msec period I want it to be active for?

 

Thanks again,

boz

0 项奖励
8 条消息(共 10 条)
4,329 次查看

Hi Colin,

 

If going with the event structure, you don't actually connect the OK button directly, rather it is configured as a part of the event case.  Check out the following description of event structures for a little bit more information:

Event-Driven Programming in LabVIEW

 

If you want to turn off the digital lines of your DAQ device, you could explicitly write the lines to go low after breaking out of the loop.  You could also call DAQmx Reset Device.vi outside the loop.

 

 

Which DAQ device are you using by the way, and how much jitter is acceptable when generating the 4 msec pulse?  Currently you are using the Windows clock to time the pulse, so there would be non-trivial amount of variance in the pulse width.  Depending on the hardware you are using there may be other options.

 

 

-John

John Passiak
9 条消息(共 10 条)
4,306 次查看
I GOT IT.  I've got it doing everything that I need it to do.  Thanks to everyone who helped.
0 项奖励
10 条消息(共 10 条)
4,244 次查看