From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

start the program when an external limit switch change its position

i have a DAQ card 6036E and have a limit switch.
my problem is:
when certain contact of limit switch is open, certain loop is work, and when the contact change its status the first loop stop and a second loop starts.
for details
 
    limit switch contact open & i press start of the program
         
           loop one stars which is 10V analog output
 
                   the limit switch contact closed
 
                          loop one stops and loop two starts which is (digital out + 5V analog out)
 
thank you
 
 
0 Kudos
Message 1 of 5
(2,642 Views)
Hi Yasser,

 

Thank you for posting in the National Instruments forums.  I am having a hard time understanding what you would like to happen and what is actually happening. 


It sounds like the program starts out correctly.  With the loop open, the first loop is working.  Now are you saying that when the loop closes, you want the first loop to keep going and the second loop to start? 


It would help if you post a screenshot of your code which will make it easier to see what is going on.  Then we can continue from there.

Thank You,

Nick F.
Applications Engineer
0 Kudos
Message 2 of 5
(2,609 Views)

Hello Nick F,

Thank you very much for your reply and i am so sorry for less details of my previous message so, here more discussion:

I control the position of a reobatic arm, at starting of the program the arm may be in any position so i must move the arm to a referance position by making a program to give analog 5V through analog output pin of the DAQ to the to the DC motor controller card to then to the motor which drive the arm, when the arm arrives to its referance position  hitting a limit swich which will give a digital signal to digital input pin of the DAQ, here, my object is to stop the obove program (or loop) to stop the arm, at the same time i want to run another program or another while loop on the same program which is an LV example (control single channel.vi) (which is an PID controller program to move the arem to a desired position.

that's all

please reply me quickly

thank you 

0 Kudos
Message 3 of 5
(2,593 Views)
Hi Yasser,

If the trigger that you are sending is going high and staying high, then you can use a pause trigger to stop the output and then stop the task before the trigger goes low again. 

You can find an example for this by going to the example finder in LabVIEW.  Click on the Help menu and then Find Examples...   You can find the example Hardware Input and Output >> DAQmx >> Analog Generation >> Voltage >> Cont Gen Voltage Wfm-Int Clk-Pause Trigger.vi. 

If the trigger is just a pulse, then let me know and we will have to find something else to make this work.
Thank You,

Nick F.
Applications Engineer
0 Kudos
Message 4 of 5
(2,575 Views)

Hello Yassar,

 

I'm trying to do the same thing with a limit switch.  Did you find the solution to your problem? 

 

Thanks

 

Jose

0 Kudos
Message 5 of 5
(2,523 Views)