LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Digital Input

Hi....all

I am working on the identifiaction of stator coils, I have 5 types of
Staor coils and I have to identify these different coils using NI 6515
DAQ Card, I am using LabVIEW 8.0.

But the problem is that as these 5 coils have different connectors
which will give me a HIGH(DI) to my DAQ Card if that particular coil is
connected.....so my problem is that I have to acquire a DI(Digital
Input)....for 5 such coils simultaneously....and as only one coil will
be connecting at a time, which will lead to failure for other codes for
left 4 coils and it will stop the program running.....so could anybody
suggest me what can I do in such a case when I have to acquire only the
connected input and run the simultaneous code for that and leave
others.....so that program doesnt terminates.


With Regards
James

0 Kudos
Message 1 of 8
(3,498 Views)
I'm not quite sure I understand the problem. Are you acquiring data from 5 separate digital input lines and you don't know which of the 5 might be connected? If you read all 5 and have data on at least one line, do you need to know which specific line is true? Since the digital read will return either a number or an array of Booleans (it depends on how you've configure the DAQmx Read), it would seem that the only failure condition would be if the number returned is 0 or if all elements in the Boolean array are false. If I'm totally misunderstanding the problem, could you provide more details?
0 Kudos
Message 2 of 8
(3,483 Views)

Thanks Dennis for your reply,

Yes you are correct I will be acquiring the data from 5 DI lines and at one time only 1 coil will be connected so that will give me 1 and as soon as I get 1(High) on that line I should proceed further and if no coil is connected i will be getting 0 and a messege will appear that no coil is connected.

Although if I use the Read Digital Channel example from NI examples and just use 5 lines and array of 5 boolean elements , will that work with my problem..????

  1. Another problem I want to discuss is that I have to glow some LED indicators having rating 24V DC on the front panel ...so If I use the Write Data Port example from NI  and I make a constant Boolean of High(1) the data to write on the channel.........so will my indicator glow ?? I am using 6515 card and LV 8

With regards

James P. Martin

Message Edited by ramzi on 06-20-2006 04:37 AM

0 Kudos
Message 3 of 8
(3,458 Views)

Yes, you can use an array of five elements and then do a search array to see which element is true. I think I would set the DAQmx Read to return a number and just wire the output to a case statement. You would have case values of 0,1,2,4,8,16 that would represent none detected, bit0 high, bit1 high, etc.

The 6515 can output 30V so assuming you connect the digital output to the LED correctly, it should glow.

0 Kudos
Message 4 of 8
(3,448 Views)

Hi Dennis

I also want to ask another thing that , in the proposed machine I have a Reset and emergency botton which acts as digital inputs to my DAQ Card, so whenever the operator presses the Reset button it means the machine was stopped during some fault and also my LV program has also stopped so by pressing the Reset my all values will be initialised and by pressing emergency button my LV program as well as the machine should stop......but  I am in a fix that these two inputs can occur any time during the test .......(means that any operator can press emergency button anywhere between the test cycle) so where can I entertain that Emergency Digital Input in between my LV code such that my machine and LV program should stop.

 

with regards

James

0 Kudos
Message 5 of 8
(3,430 Views)
There's a couple of ways that you could do this. You could put the digital read in the timeout event of an event structure. As long as you don't have any events with while loops in them (not recomended), you would check the status at the timeout value. You could also have a separate while loop that does nothing but read the inputs. You could then pass results to the main loop via a queue or even local variables.
Message 6 of 8
(3,419 Views)

James:

Regarding your ESTOP- If possible, your estop should directly disable the equipment electrically. Do not use it solely as an input to the DAQ card for your program to monitor and stop the equipment. If your program hangs or Windoze crashes and you need to shut down the equipment in an emergency, it won't happen.

I suggest you get an ESTOP that has two sets of contacts (poles). One is used to remove power or disable the equipment, the other is wired to the DAQ card to monitor that it has been pressed and take the appropriate actions in software.

Just my opinion and firsthand expereince.

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
Message 7 of 8
(3,415 Views)
Just as an addition to what AKTDM said, if you need government safety approval for your test setup, you might have a hard time passing it unless you have a hardware E-STOP as well.

I know we've been required to do that here for some time.  It also takes a lot of the pressure off the software, since you know no matter what they equipment will be shut off.
Message 8 of 8
(3,410 Views)