Controlling the Aviosys IP9203 stepper motor controller

Control an Aviosys IP9203 stepper motor controller from a Linux bash script

- Use Blassic basic to prepare and then run a bash command

There is a useful Windows .exe program here - it uses UDP to talk to port 7070 of the control card

Japanese site
Google translation

I used Wireshark to sniff the LAN and see what the html form was requesting

I need to send

So use the Linux bash script -

curl -d "PinNo=P5_M0&P50M_STEP=100&P50M_TIMER=1&P50M_TIMER_CNTL=0&Apply=Apply"

This sets the values of the html POST form via a Linux command line
these set -
P50M_TIMER_CNTL=0 for one way P50M_TIMER_CNTL=1 for the other

The Blassic program below takes 3 arguments
- step, timer, direction
and creates the string that a browser would normally send to the 9203 when filling in the form on the built in web page

' /var/www/cgi-bin/servo_board/stepper1.bas 100 1 1
' This program sends a bash command like -
' curl -d 'PinNo=P5_M0&P50M_STEP=100&P50M_TIMER=1&P50M_TIMER_CNTL=1&Apply=Apply'
' this "fills in the boxes" of the POST table on the Aviosys 6203 web page
' curl "pretends to be" a browser but from a command line

Step$ = PROGRAMARG$(1) 'Send the number of steps as the first argument - 10 100 etc
Timer$ = PROGRAMARG$(2) 'Send the timer delay as the second argument - 1 10 etc
Direction$ = PROGRAMARG$(3) 'Send the rotation sense - 0 or 1

' next bit all on one line up to -

s$ = "curl -d "+CHR$(39)+"PinNo=P5_M0&P50M_STEP="+Step$+"&P50M_TIMER="+Timer$+"&P50M_TIMER_CNTL="+Direction$+"&Apply=Apply"+CHR$(39)+" > /dev/null 2>&1"

' - here

' so now ask bash to send this string out using curl


' "> /dev/null 2>&1" means "do not show the returning web page from the 9203"


Please email me here - if you have better information on the 9203 and especially if you can control the 9200 card on its own
Aviosys give very little data - the best I can find is here -