06-26-2014 10:01 PM
Hi friends,
I have try to send hex data to the transmitter which have PIC microcontroller via usb serial port.
It has 9600baud rate, 8 bits, 1 stopbit, noparity.
the protocol is data, data, data, check sum. When the data is right, the green led in the device will blink once.
I have been able send it to the device using C++ to the device, and using realterm as well.
but when I try using labview, the device didnot blink at all.
I have check the data and displayed the value using virtual port to real term, send it with labview and c++ the value is the same. but why labview cannot send the data?
is there any setting do I have to set?
Solved! Go to Solution.
06-27-2014 05:56 AM
Hi limavolt,
closing the serial port just after writing data into the VISA send buffer is a NO-GO!
Using VISAWrite you only transfer data into a send buffer, but you are not sending those data immediatly over the COM port. Closing the COM port will also stop any sending of the data. Using 9600baud you need ~1ms to send a byte but you close the port within microseconds after VISAWrite…
Did you check the example VIs coming with LabVIEW? Did you try your task with the "Basic Serial Read and Write" example?
06-27-2014 07:31 AM - edited 06-27-2014 07:31 AM
As GerdW stated, you need to wait to allow your data to be sent before closing down your serial port.
And since you are using all default settings for your serial port, you can get rid of the controls for the serial port settings.
I would recommend something like this.
06-29-2014 07:40 PM
Thank you,
I never think about the delay before.. and It work...