LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview footswitch control

Hi I am new to this forum and wanted to ask how to take digital input from external switches I am making a project which needs to control different sections of a labview project design file via a footswitch ,the switches i will be using are momentary switches ,also do i send the signals from the switches via the rs-232 port or is there an alternative to this I have hit a brick wall at this point in time and any help at all would be very much appreciated,cheers.
0 Kudos
Message 1 of 11
(4,810 Views)

Do you want control Labview while you are developing with footswitch(s) or is it some application you want to develop, there you use footswitch(s) as a tool for controlling the program actions. I guess it is the last option you want. But you were somewhat vague on this point



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 2 of 11
(4,803 Views)

Hi PodgeRambo,

 

Thank you for contacting National Instruments. You will not be able to read the Digital signals straight into a serial port. This is mainly due to the RS-232 port being a communication port and as such, you need to translate the Digital input into a signal that a Serial port could understand. 

 

I have made a short list of the options that are available to you:

 

1. Construct an RS-232 interface device that can talk to your PC and relay the states of the switches through to your code on your PC. You will then need to modify your code so that you can read the RS-232 port. I would strongly discourage this idea, it will be very time consuming and will cause you no end of grief.

2. Buy a Multifunction DAQ device to read the state of the Digital signal. National Instruments produces a huge variety of different Multifunction devices and if all you need to do is read a digital line then something like a 6008 or 6009 will do the job. The other great advantage with this approach is that it is very easy to integrate this with your existing LabVIEW application and will reduce your development time. 

 

I would recommend phoning the UK office on 01635 523 545 to speak to one of the Inside Sales Engineers about your application.

 

I hope this helps,

 

Thanks,

Andrew McLennan
Applications Engineer
National Instruments
0 Kudos
Message 3 of 11
(4,765 Views)

Hi sorry for taking so long to get back to you, yes the footswitch will control the program actions. I was wondering if there is a way to recieve the signals sent from footswitch.I thought I could use the rs-232 port but I would have to convert the digital signals from the footswitch to a signal that the rs-232 port will understand , the price of the daq device to do this is a bit much so if you can recommend any other options I would greatly appreciate it

Thanks.

0 Kudos
Message 4 of 11
(4,730 Views)

The 6008 is the least expensive DAQ device from NI. There are other devices from other vendors but the support and LabVIEW integration will not be the same.

 

If you have a parallel port on the pc, you can use that for simple digital I/O. There is an example that comes with LabVIEW that shows how to read the port.

0 Kudos
Message 5 of 11
(4,715 Views)

You could wire the request to send through the footswitch and back to the clear to send on the RS-232 port.  Use software for managing the comm port to exert a request to sent (this would "enable" the footswitch)...then when the foot switch was depressed (assuming that it is normally open), a clear to send would appear.  Connect the ground on the comm port to the ground on the foot switches frame...

 

That might work ... no guarantees...just what I would try.

 

Hummer1

 

0 Kudos
Message 6 of 11
(4,703 Views)

If A NI 6008 or 6009 is to expensive. Then I would go for a micro controller solution with RS232 link. I should be very simple to whip something up. Of course you must invest some time in this. So in total the cost will be pretty much the same, if not more expensive.



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
Message 7 of 11
(4,682 Views)

Hi,

 

Something I did once was to pull apart a cheap USB keyboard. The circuit board inside was very small (approx 1cm x 3 cm). The keys are arranged in a matrix of rows and columns, and it was easy to find which key connects to where with a multimeter.

 

If I remember I used the 'page up' and 'page down' keys and simply connected my switches across the appropriate PCB edge connector terminal.

 

It was then a simple task of an event structure looking for a key down event. You don't have to bother with rs-232 or expensive digital I/Os, and it's debounced for you (as long as you have a suitably long keyboard repeat delay!!).

 

 

Hope this helps,

 

Regards,

Sebster.

Message 8 of 11
(4,673 Views)

Hi Sebster,

 

> Something I did once was to pull apart a cheap USB keyboard ...

 

That is a slick idea!

 

The only caveat is that your vi would have to have focus to get the keystrokes (which can be dealt with). But given that, it's pretty cool.

 

steve

----------------------------------------------------------------------------------------------------------------
Founding (and only) member of AUITA - the Anti UI Thread Association.
----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 9 of 11
(4,661 Views)
hi Coq Rouge,Yeah I am using a microcontroller in the footswitch and I think there is a uart in this so I think that will convert the digital voltages from the switches to the understandable voltage levels for the rs-232. Also I am going to connect a guitar to the footswitch. The footswitch will control the actions of the program and the program will add different effects to the guitar signal through the matlab script node. Can i run the guitar signal through the microcontroller and the rs-232.
0 Kudos
Message 10 of 11
(4,621 Views)