I need help to add the following to a simple VB6 program.
I am getting information on request from a closed loop stepper motor that is running off a Arduino zero (search: MKS SERVO42A).
The information is being sent via the com port. Another Freelancer has helped me setup the first part where I am able to send a request to the Arduino and have the arduino make the changes required. However I know need to be able to read and use some information that is being sent from the arduino.
Commands sent from the VB6 program do prompt a reply from the Arduino. Most are just confirmations and I have no need of them. They can just be ignored.
However 2 requests for information from the VB6 program, returns information that I need.
I am unable to format the responses from the Arduino. The requested data I need will be interspersed between the commands that can be ignored.
Here the are:
The string sent is: readpos
The return is for example : encoder -110.15 [There is a space between "encoder" and the value]
The value that follows "encoder" is anywhere between 50000.00 and -50000.00. There is no "+" when the value is positive. So the received string is of a varied length.
I need to extract that value for use. So I would like that value to appear in a Textbox which is cleared and refreshed each time the request is made. (Which is 30ms on the timer)
The same is needed for the following request.
The string sent is: geterror
The return is for example : error 10.87 [There is a space between "error" and the value]
The value that follows "error" is also anywhere between 50000.00 and -50000.00. There is no "+" when the value is positive.
This received string is then also of a varied length.
I need to extract that value for use. So I would like that value to appear in another Textbox which is cleared and refreshed each time the request is made. (Which will be on the same 30ms on a timer)
The timer is not yet in the program and will be added later.
I am able to send and receive successfully in a VB6 program called Visual Basic Terminal. So the Arduino does work. However I need to be able to get the above to work for my project. I am not stuck on using the VB6 program that was created for me, but I am including it (attachment MSComm) - the send function does work as I asked. I just cannot receive data, although we made an attempt.
I will also include as an attachment the VB terminal program that allows both Send and Receive. (Attachment - VBTerminal)
I need to work in VB6 because of another program that will link to this one, which is only available in VB6.
I think that about covers it. I cannot pay more than $100 unfortunately.
11 pekerja bebas membida secara purata $120 untuk pekerjaan ini
Ready to make the necessary modification to the VB6 program to let you get the pos, err values from the response to com port, display it on screen on 2 text box. And refresh it with each request