06-13-2014 10:00 AM
Check out the DAQ Change Detection Event...
Mike...
06-13-2014 10:00 AM - edited 06-13-2014 10:01 AM
If you try to simulate DI with buttons, your buttons need to be switch until released (like a car horn). Then you also need a little bit of code to detect the off-on transition.
Try this:
06-13-2014 10:05 AM
hi Alten,
actually ur solutions is much simpler , I will edit my vi and send you as I dont just have 2 inputs rather 6 but the the principal works the same.
Thanks 🙂
06-13-2014 10:06 AM
You can still use Events
06-13-2014 11:26 AM - edited 06-13-2014 11:27 AM
nolsqn wrote:actually ur solutions is much simpler , I will edit my vi and send you as I dont just have 2 inputs rather 6 but the the principal works the same.
What are the additional 4 inputs for? If you need to increment several numerics, you should use arrays.
(Does you application have anything to do with spinal tap? :D)
06-16-2014 07:35 AM
Hi Alten,
Sorry for late reply as I was away for the weekend. Actually the 6 inputs control 3 stepper motors to postion them acording to 11 pre selected positions. Labview actually recevie the DI from the DAQ card and then depending on the DI send a command to move the motor.
Best Regards
06-16-2014 07:55 AM
this soution also works prety well.
Thanks all
06-16-2014 11:43 AM
As I said, you should use Arrays of buttons and an array of number is the shift regsiter. Your curret code does not scale well. What if you need to rewrite it for four, five, two, ot 100 button pairs in the future? With scalabel code, all you need to do is change one number.
06-16-2014 02:26 PM
Here's what I had in mind. Changing to more or fewer button pairs is simply a matter of resizing arrays. No other code changes needed.
06-19-2014 07:27 AM
hi alten,
although I am prety sure we dont need to work with more bottons in the future so scalability is not an issue but using arrays is just more cooler and impressive 🙂 thanks a lot because this has given me way better techniques for future coding .
Best Regards,
Ali Asad