10-10-2023 08:58 PM
I am looking for some ideas on what might be the best way of sending two different arrays based on the button trigger that is pushed. The ideal goal would be when an initiate button is pushed it will trigger the top array in the picture to send commands to a UDP address. After that array finishes I would hit a start button and the second lower array would start sending the information to the same UDP. The major problem I face is if the UDP address is not getting continuous values it will close and the device we are sending this information to will go back to a parked position. If I want it to stay at a neutral position I have to always be sending it zeros or a movement command. Appreciate any ideas!
Solved! Go to Solution.
10-11-2023 12:56 AM
Hi Lunar,
@LunarSurface13 wrote:
The ideal goal would be when an initiate button is pushed it will trigger the top array in the picture to send commands to a UDP address. After that array finishes I would hit a start button and the second lower array would start sending the information to the same UDP.
If I want it to stay at a neutral position I have to always be sending it zeros or a movement command. Appreciate any ideas!
Use a state machine!
10-11-2023 12:46 PM
@LunarSurface13 wrote:
I am looking for some ideas on what might be the best way of sending two different arrays based on the button trigger that is pushed. The ideal goal would be when an initiate button is pushed it will trigger the top array in the picture to send commands to a UDP address. After that array finishes I would hit a start button and the second lower array would start sending the information to the same UDP. The major problem I face is if the UDP address is not getting continuous values it will close and the device we are sending this information to will go back to a parked position. If I want it to stay at a neutral position I have to always be sending it zeros or a movement command. Appreciate any ideas!
You show an useless image of some very messy partial code that shows several "arrays" (some as diagram constants and some from a file read) and no "buttons" in sight (which seems to be the point of your question). There is also no UDP communication shown, so how exactly are you expecting us to help you?
In the subject you are talking about sending two different arrays, but in the body text you talk about the major problem with UDP communication. Also define what you mean by "continuous".
UDP is a connectionless protocol and as long as somebody is listening at the target IP, it will be received. So maybe the problem is on the other side if that's not the case.
I recommend:
10-11-2023 05:07 PM - edited 10-11-2023 05:08 PM
oops i was wrong
10-11-2023 08:34 PM
We have this code running a motion profile on a motion platform. Very simple code that grabs a text file and sends the movements over UDP and it also grabs joystick inputs. I need to add an additional movement before the motion profile begins. I need to slowly ramp up the heave movement of the motion platform from a parked position to a neutral position so that when the code is initiated it does not try to jump to the neutral in less than a second.
I am going to try to rap all of this into a state machine so I can add a neutral button for the initial heave movement and then still have a start and stop button for the motion profile movement.