serial script communication to XY table
i sending position , relay switch commands xy table using script in hyperterminal. feasable run such sketch arduino standalone device, without pc?
this example of commands sent hyperterminal.
set_rack(1,40)
set_rack(2,40)
set_rack(3,40)
move_sample(1,1)
relay_write(a,1)
relay_write(a,0)
move_sample(1,2)
relay_write(a,1)
relay_write(a,0)
move_sample(1,3)
relay_write(a,1)
relay_write(a,0)
move_sample(1,4)
relay_write(a,1)
relay_write(a,0)
move_sample(1,5)
relay_write(a,1)
relay_write(a,0)
move_sample(1,6)
i using uno board , , have tried connecting rs232 pins 0 , 1 through rs232 interface board.
i have tried following sketch utilising "serial print" command without success ( shortenened version)
this example of commands sent hyperterminal.
set_rack(1,40)
set_rack(2,40)
set_rack(3,40)
move_sample(1,1)
relay_write(a,1)
relay_write(a,0)
move_sample(1,2)
relay_write(a,1)
relay_write(a,0)
move_sample(1,3)
relay_write(a,1)
relay_write(a,0)
move_sample(1,4)
relay_write(a,1)
relay_write(a,0)
move_sample(1,5)
relay_write(a,1)
relay_write(a,0)
move_sample(1,6)
i using uno board , , have tried connecting rs232 pins 0 , 1 through rs232 interface board.
i have tried following sketch utilising "serial print" command without success ( shortenened version)
code: [select]
const int a=5000;//set delay
const int b=5000;//set delay
const int c=5000;//set delay
//
void setup() {
//initialize serial , wait port open:
serial.begin(9600);
}
void loop() {
// prints value unaltered, i.e. raw binary version of
// byte. serial monitor interprets bytes ascii,
serial.print("set_rack(1,40)");
serial.print("set_rack(2,40)");
serial.print("set_rack(3,40)");
serial.print("move_sample(1,1)");
delay(a);
serial.print("relay_write(a,1)");
delay(b);
serial.print("relay_write(a,0)");
delay(c);
serial.print("move_sample(1,2)");
delay(a);
serial.print("relay_write(a,1)");
delay(b);
serial.print("relay_write(a,0)");
delay(c);
serial.print("move_sample(1,3)");
}
quote
is feasable run such sketch arduino standalone device, without pc?
yes if table has usb input need usb host interface on arduino. there shields this.
Arduino Forum > Using Arduino > Project Guidance > serial script communication to XY table
arduino
Comments
Post a Comment