07-09-2009 02:59 PM
I have a USB- 6009 DAQ , A Microsoft sidewinder 2 joystick , and several relays/ Using these I would like to get some sort of robotic arm control. Ive wired the robotic arm so that once the relay switch closes it should begin to move using an outside power supply. The relays operate at 5V. At this point ive used the initialize joystick function- my idea was to use the axis values to see if there's a change and if there was it would trigger an value change event case thus leading to another check-seeing if the joystick motion was greater than 1000(arbitrary I thought it was a good motion point).
When I run the VI it never registers an event, this may because I have not used a event reference but im not sure. I thought if i ran the vi and moved the x-axis it should output the 5 V. Right now its connected to a voltmeter and is not responding.
My questions are
Any reccomendations on how such programming should be done?
Why does my idea fail?
Any suggestions?
Ill appreciate any and all help I can get as I am just now starting to get a grasp on Labview
Thank you
07-09-2009 03:16 PM
A couple problems with your code.
1. When a value is sent to a terminal of an indicator or a local variable of an indicator, it does not fire the value change event. You would need to wire to the Value Change (Signalling) property node of that control or indicator.
2. Your lower event structure is inside out. The event structure will only run once. The event structure should be inside the while loop rather than outside the while loop. You don't need a timeout case because the event structure will never timeout since nothing is wired to the timeout node. When you flip is right side out. You should have another event case that handles the stop button.
07-10-2009 08:35 AM
07-10-2009 10:35 AM
At this point Im still not getting a value change...
I m not sure how exactly the value signal property node works. Ive read some websites on this topic but none seem to explain the property nodes usage clearly.
07-10-2009 11:23 AM
07-10-2009 11:31 AM
07-10-2009 11:34 AM
Thanks for the help. Probably shouldve mentioned before hand that I am using labview 8.5 and cannot open lv 8.6.
07-10-2009 12:09 PM
07-10-2009 12:55 PM
Ive now done several edits with all of your help and I believe the logic is going correctly. When I run the program it goes and does not enter the event until I move the joystick . However when I do move the joystick and enter the loop it does not broadcast the 5V digital output that I want instead I get this error message
Measurements: Write cannot be performed, because the number of channels in the data does not match the number of channels in the task.
When writing, supply data for all channels in the task. Alternatively, modify the task to contain the same number of channels as the data written.
Number of Channels in Task: 1
Number of Channels in Data: 16
Task Name: _unnamedTask<C>
Does this mean I have to create several channels? If so is that done through Max or the create task viin labview? I think this is the last error I need to solve...hopefully.
thanks again
07-10-2009 01:14 PM