Transmitting commands unsing RS232
-
I need to send the commands to control robotic arm from workstation(GUI). Commands are in 8 bit stream data. i am unable to understand how to insert bit format in serial->write("") . I am not good at C++ programing. Please can some one explain me how to do it.
Thanks in advance. -
-
@AnilReddy
Hello,
QSerialPort::write
will useQByteArray
as an argument, so that's 8bit stream data. Maybe if you provide a command you want to send, it'd be easier to provide assistance? Also, there's theQSerialPort::waitForReadyRead
andQSerialPort::waitForBytesWritten
you have to take into account (if you're not using the asynchronous API).Kind regards.
-
@kshegunov
thank you very much for your reply . the robotic arm which i need to control has 6 stepper motors . It accept 8 bit data in which first bit is for backward action and second bit for forward action and remaining are for engine numbers.
for example if one stepper motor has to go forward direction we can make bit data as 00000110. Could you please write me program line for this. -
Hi
This might be useful
http://stackoverflow.com/questions/47981/how-do-you-set-clear-and-toggle-a-single-bit-in-c-cThere is info for each bit operation.
-
@AnilReddy
To add to @mrjj also the QBitArray class might be useful in your case.