LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Switching output on/off with 2 pulse inputs

I am an undergrad and pretty new to using labview. Basically what I want to do is essentially create a latching relay. I want the pulse from input channel 1 to switch on the output channel then I want the pulse from channel 2 to switch the output channel off. 

0 Kudos
Message 1 of 8
(3,644 Views)

Because you are a student and new to LabVIEW, we will offer suggestions and help you understand the program, but we will not deliver a solution to you.

 

You did not ask a question.  What part of this is causing you trouble?

 

You refer to input and output channels. Are you connecting to devices outside the computer? If so, how are you making those connections?  What kind of DAQ device are you using?

 

Are you having trouble with the logical behavior?  Try using LV boolean pushbuttons on the front panel as inputs and a boolean indicator on the panel as output.

 

When you have tried something and have questions, please post your VI with your questions.

 

Lynn

0 Kudos
Message 2 of 8
(3,630 Views)

I am using a DAQ board. NI USB-6341. This is for a research project that I am doing and I have never used labview previously other than pre-created files or creating simple data acquisition files. So, basically, I am kind of in over my head since the professor doesn't want a mechanical latching
relay but for it to be run by labview instead. What have to run is a solenoid that switches the direction of my air cylinder when the limit
switches get tripped. I have the limit switches the first two analog inputs and I have the signal that is driving a mosfet which ultimately drives the 
solenoid on my output channel. Now I know how I could do this if the trigger signals were constant as it would just be a simple greater than type 
operation I could use to drive the output but since it is momentary I do not know how to approach this.

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

OK.  With this much better description we now know where you are having difficulty.

 

Let us summarize:

1. Inputs are two channels of analog voltages obtained from limit switches which have momentary actuation due to motion of system.

2. Output drives a transistor which switches a solenoid.

3. Desired function is to reverse direction of solenoid when one of the limit switches actuates.

4. You know how to program the inputs and output, but are unsure about how to handle the logic.

 

Tip 1. Take the time to work through the on-line LabVIEW tutorials.  What you learn will help you put together your own programs and prevent a lot of errors which would take more time to fix than the time you will spend on the tutorials.

Tip 2. Plan and design your program carefully before you start to try to write the program.  Think about what it will do for every possible combination of inputs and input transitions.

Tip 3. The Shift Register will be your friend.

 

What you do not know, have not mentioned, or have not thought about which will cause problems:

1. When you start the system, which way will the cylinder move first?  Consider the cases where both limit switches are not actuated as well as cases where either one is actuated.

2. Switches tend to "bounce," meaning that the contacts may open and close multiple times over a few milliseconds each time the mechanical actuator is tripped. Make sure your logic can handle this without repeatedly trying to opreate the solenoid.

3. When you stop, make sure the solenoid is in a safe state so that the cylinder does not continue to move after the program runs.

4. Along with 3, consider having a manually actuated safety switch or valve so that the cyclinder can be stopped if the program or computer crashes while running. Never rely solely on computer software running on a desktop operating system for safety. If you do, someone will get hurt.  It could be you.

 

Lynn

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

I am still pretty lost. All I really have set up is the data in and data out. I just cant seem to figure out how to make the logic work. I think I could do the logic for it in regular programming language but when it comes to the boxes and stuff on labview I am so lost and can not figure out how to get it to do what I want it to do. Although I am not even sure what I want it to do is even the correct approach.

0 Kudos
Message 5 of 8
(3,598 Views)

The "boxes and stuff" in LabVIEW are the commands and functions and the wires are the data.  The connections represent the logic or algorithm.

 

Since these are things which are confusing you, you really need to do the tutorials as I suggested in Tip 1 of my previous post.

 

When you have finished that, then look at Tip 2.  Since you think you could program the logic in another language, you should be able to generate a flow chart, state diagram, or other description of the logic.  You can use that to define your LabVIEW program.

 

Lynn

0 Kudos
Message 6 of 8
(3,584 Views)

So after some searching around I found thisrelay VI Now I am not sure if I have this on my version of labview or not but it looks like this would work perfeectly. All I would have to do is create some sort of DC voltage for the input within labview. I could trigger the on off with my limit switches. I still would have to do some logic to control when it is not between the two limits at start up.
So, what do you think?

0 Kudos
Message 7 of 8
(3,569 Views)

The help says that is for the FPGA module.  It is not in my Full Development System.  I did find a Relay Express VI in the Signal Manipulation palette.  It is just a single pole, normally open relay.  If you open the block diagram, you could get some ideas about implementing a relay.  Then you could modify it to perform the set/reset function you want.

 

Lynn

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