11-02-2015 08:14 PM
Hi,
This program needs to control the cursor in the x-direction (left and right) and the y-direction (Up and down). The data is being acquired via a DAQ and accelerometer. Hence, if I tilt the accelerometer left/right, the cursor should move left/right--same as up and down.
The set cursor position library function does not seem to allow me to do this. I know I will also need to add some boolean structures and other things, but I am overall unsure if the set cursor position is the best function for me to use. Any suggestions?
Thanks
11-02-2015 08:55 PM
When you say Cursor, do you mean the cursor for the chart or the cursor of the Windows?
Waveform chart has no cursor. Use a graph instead.
11-02-2015 11:01 PM
Hello,
Sorry, I should have been more clear. I need to control the actual windows cursor, not just the cursors that you can set up on waveform graphs.
Thanks
11-02-2015 11:39 PM
Are you sure that's a good idea? Taking control of the main way to interact with a computer seems to be a very bad thing to me.
11-02-2015 11:49 PM
Hello,
It is for potential applications for people with paralysis from the neck down. Do you have any suggestions?
11-03-2015
01:06 AM
- last edited on
05-06-2025
05:04 PM
by
Content Cleaner
It is easy what you want to do in LabVIEW, see this previous post about it:
This gives you an example, but of course you need to alter it to fulfil your current needs. Note that, you must program a key combination (in the example it is ctrl+shift+Q) so you are able to stop the VI executing, you cannot use your mouse in this case naturally 🙂
edit: the example is a png snippet, you can drag&drop into a block diagram and you get the VI too...
11-03-2015
01:21 AM
- last edited on
05-06-2025
05:04 PM
by
Content Cleaner
Ok, I just had a look at your VI in your first post. As I see you are quite a beginner in LabVIEW. You miss the basic principle of dataflow too. You have your positioning library call OUTSIDE the while loop, it will only execute when the while loop finished iterating.
Other big problem is that you need at least 2 parallel while loops here. One for the DAQmx (you also set up this task in a wrong way, see the shipped DAQmx examples with LV!), and another loop, a "consumer loop". So you need to acquire data, send it via a Queue to a consumer loop, where you do your data processing + mouse cursor positioning. I guess later you also want to simulate programmatically mouse clicks...?
I suggest you to start learning LabVIEW, at your current level this is going to be too painful. Check if you have access to online material Core 1-2 (and 3)?
Also have a look the DAQmx Producer/consumer examples.
http://www.ni.com/example/31192/en/
11-03-2015 07:29 AM
@Paige5 wrote:
Hello,
It is for potential applications for people with paralysis from the neck down. Do you have any suggestions?
Oh! In that case, it's a very good idea. I'm hoping that we can help you get this project going. 🙂
11-03-2015 10:51 AM
Hi,
Thank you, this is very helpful. Why are you multiplying by 1024 and 768? I assume this is for sampling purposes? Also, I have attached a screenshot here. I want to only read in values from the index array if the value differs from the threshold, but the boolean value will only be 0 or 1. Is there a way to use a comparison function without immediately outputting a boolean value?
I know these are simple questions, but I am doing my best to learn and appreciate your help. Thanks!
11-03-2015 11:00 AM