04-09-2013 10:10 AM
hi,
I want to control starter kit 2.0 manually, using wi-fi. I have uploaded the code on the robot, but when I press the keys it does not work. I have put an event case with cases (attached in this post there is the code), but it goes straight to the 'Timeout' case for some reason. Does anyone know what the problem could be?
Thanks
A.
04-09-2013 11:01 AM
There are some missing SubVIs here - making it more difficult to look at your code.
I am a little confused at why you are using a timeout in your event structure - configure an event for "Stop" value change - then there is no need to poll. Try also turning off 'discard missed periods' in the timed loop. Have a look towards the bottom of this help file for the effects of enabling/disabling this mode.
04-09-2013 11:06 AM
Another quick one - is this running on your host PC (Windows) or on the RT target?
I would only use an event structure for dynamic events on real-time, as the front panel does not really exist (it runs on your PC and does the variable communications in the background). But someone may correct me on the use of events.
Ideally you would have a Host VI running on one side (inclusive of all user interface functionality) - and pass the variables (control parameters, results) via network-published shared variables (you can host these on either the host or target). The target will then read the state of the controls, and act accordingly.
04-09-2013 11:08 AM
Thanks for the reply!
I know your confusion about the 'timeout' event, I have it too! but it won't let me run the program if there isn't a 'timeout' event (i don't know why).
The missing VIs are just the robotics palettes, there is no issue with that in the VI.
Alex
04-09-2013 11:11 AM
I am running this one on the RT target, as later I want to put a reading for the sensor and a deadreckoning map.
I have done another robotics project using a host VI on my PC and a receiver VI on the RT targer and that worked fine! But in that case I could only see the sensor reading on the receiver VI that was uploaded on the RT target! I am tryng to integrate those into one program now.
Thanks
Alex
04-09-2013 09:42 PM
AlexP88 escribió:
I am running this one on the RT target, as later I want to put a reading for the sensor and a deadreckoning map.
I have done another robotics project using a host VI on my PC and a receiver VI on the RT targer and that worked fine! But in that case I could only see the sensor reading on the receiver VI that was uploaded on the RT target! I am tryng to integrate those into one program now.
I have understood that the event structure has restrictions when working in real-time (RT). For this to work you need to create dynamic events, here's an example. ------> http://digital.ni.com/public.nsf/allkb/42B70D2D0C4B568586256E2F0051441D
04-10-2013 10:39 AM
Hi,
Thanks for your reply!!! It was very helpful! I have done the changes, but I cannot find the user event for 'pressing keyboard' or somehting like that. In the normal event case, the event 'key up' and 'key repeat' generate a VKey input which is used for the case structure!
I have attached the new code, maybe ypu have any further suggestions?
Thanks again!
Alex
04-10-2013 01:18 PM
Hi Alex .
The dynamic events do not work that way, the dynamic events are no longer responding to the controls on the user interface, on the contrary respond to events generated by programming, you observe the example you said before? Detail the function "Generate User Event", in the first cycle, this is the function to generate the event. Now as personal advice, you should use another type of structure for control the robot in real-time (RT). A state machine for example. Or definitely use a "Host" on your computer.
04-10-2013 02:37 PM
Hi,
I can control the RT using 2 VIs (one for host and one for receiver), but the problem is I have a deadreckoning map that I am using to see where it goes. Now, I can only see it when it is on the receiver VIs that is uploaded on the RT and I am using the host VI to control. It is really hard to do so as I have to switch between screens... I am making the hos VI window smaller so it fits on my screen, this way I control it now.
I was planning to use 1 screen that is why I asked for some solutions on this forum, but it seems to be very hard 😞
Thanks a lot for your help!
A.