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

LED phidget programming help required

Heyya

 

I am a very new user in labview and for my project I need to control an LED phidget. Currently I am able to initialize the phidget and set in values to which LED to light up.

What I require is i only want the particular LED to light up for a matter of 10 sec and then switch off. Currently the LED lights up but does not go off and stays on indefinitely and on selecting another LED number the earlier one continues to stay light up. Anyone any ideas for solution to this problem.

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

You need to post your code so people can see what you've done so far. 

 

Ed

Edward Motts
Certified LabVIEW Associate Developer
0 项奖励
2 条消息(共 8 条)
4,302 次查看

Try the attached VI and see if that is what you are trying to do.

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

You make a couple of mistakes and use some overly complicated constructs.

 

 

  • Your reset is one iteration behind, you should compare the current value with the previous and not the previous with the one before that.
  • An equal followed by a Invert is the same as "not equal".
  • Why do you need the second diagram constant of an FALSE array, one is probably enough (branch the wire!).
Here's a quick draft, it is in no way complete. 🙂

 

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

All valid points. Let's make it easier for him to set the array size too.

 

Timed LED lightingMOD_BD.png

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

Let's make the visible LEDs auto-adjust too....

 

Timed LED lightingMOD_BD.png

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

 


djpal wrote:

I am a very new user in labview and for my project I need to control an LED phidget.


 

OK, a phidget is something physical, so apparently you have LED hardware and switches. What kind of DAQ hardware are you using? Are you using digital IOs? How are you setting the value that determines which LED to light? (A bank of switches with one switch for each LED? a rotary selector, etc.)

 

It would really help if you could show us the code you have so far. Also, what is your LabVIEW version?

 

I any case, what has been posted here so far are virtual implementations. You should be able to re-use part of the code. All you basically need is to translate the physical input to a number and the boolean array to something that light the LEDs accordingly.

 

Better code only updates the digital output if the value actually has changed, and not 10x/sec. An event structure might be a better choice for that reason (See attached, LabVIEW 2010).

 

At the moment, your specifications are full of holes and many scenarios need to be better defined:

 

  • What should happen if a second LED is lit while the first one is still on?
  • What should happen if the wait time is changed while a LED is already lit?
  • Can multiple LEDs be ON, each with it's own timeout?
  • ...

 

 

 

 

 

 

 

0 项奖励
7 条消息(共 8 条)
4,271 次查看
0 项奖励
8 条消息(共 8 条)
4,264 次查看