LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Lab view start stop on switch

I want to have labview run a loop after I hit a switch. The switch will be connected to my SCB-68 board that is connected to GBIP board in the computer( I think?). I just have a monemtary contact switch that I will connect to one of the channels on the board.

I can't get my vi to see the switching action. Am I supposed to use a counter icon,DI read icon. I don't know.

Any help on this would be really helpfull.
0 Kudos
Message 1 of 9
(3,562 Views)
Not sure about the origin of your problem without having a look at your vi.
That could be related to the mechanical action of your switch.
Do you know that the behaviour of boolean controls can be modified ? If not, try Right clik> Mechanical action.
See the attached vi for a quick tour...

Hope this helps...

CC
Chilly Charly    (aka CC)
0 Kudos
Message 2 of 9
(3,557 Views)
There is no such thing as a GBIP board. There is a GPIB board but there is no way to connect your SCB-68 to it. The SCB-68 is a connector block that is connected by ribbon cable to a DAQ board. We need to know where you've connected all of the pins of the switch to which pins on the connector block and which DAQ board you're using. A DAQ board might have analog inputs, analog outputs, and digital I/O. What LabVIEW function you use will depend on where you connected the switch. I would suggest that you wire the switch to the digital I/O so that when the swtich is open, you have a logic one being sensed and when you close the switch, you sense a logic zero. You would use Read From Digital Line in a loop to monitor the digital line you've wired the switch to.
0 Kudos
Message 3 of 9
(3,527 Views)
Hoops ! Feeling nuts. Some we should be reserved for a good sleep !

CC
Chilly Charly    (aka CC)
0 Kudos
Message 4 of 9
(3,510 Views)
I apologise. The SCB-68 connector block is connected to a DAQ card on my computer that is running Labview 7.0 Express. My vi opens and closes some valves, records some pressures and performs some small calulations. However my experiment requires me to run and rerun the vi many times while making small manual adjustments. Since the equipment is far from the computer I would like to have the small switch in my hand that I can restart a loop that will contain tasks I stated above.
I agree with your suggestion that the switch should be connected to a digital I/O channel, which I have on the SCB-68. So you are suggesting I have two loops. One containing the measurement tasks and another that is continously reading the switch channel. Then when this loop reads a zero pass that to the first loop to start it. Is this correct? The switch loop will use a Read From Digital Line.

Thanks for the help.
0 Kudos
Message 5 of 9
(3,501 Views)
That's about it. The only caution is that your loop with the read digital has to run fast enough to catch your momentary switch. If that becomes a problem, what I've done in the past is wire up a one-shot IC to the switch and have it output a pulse of some known duration.
0 Kudos
Message 6 of 9
(3,499 Views)
Ok now I am confused about some basics.
What is the differance between "channel" and "port". I am connecting the little switch I have to DIO7 on the SCB-68 block. So my understanding of the Read From Digital Line is that I would enter 1 for my device and 7 for the channel. Since I am not using channel names this is concidered a port number.
That is what I have done. But when I run the vi I get an error:

Error -10007 occurred at DIO Port Config
Possible reason(s):
NI-DAQ LV: A channel, port, or counter is out of range for the device type or device configuration; or the combination of channels is not allowed; or the scan order must be reversed (0 last).

I don not know what this means. How can the channel be out of range, it is just reading a on/off state. And I am not combining any channels.
0 Kudos
Message 7 of 9
(3,481 Views)
When you don't use channel names, the port number refers to the grouping of digital I/O. For example, if you have 24 digital I/O, they might be arranged with 8 lines in a group. For DIO7, you would want to specify group 0, port width of 8, and use 7 as the line number.
0 Kudos
Message 8 of 9
(3,477 Views)
Thank you very much!
I got is working now.
0 Kudos
Message 9 of 9
(3,473 Views)