06-30-2014 02:54 AM
Correction:
http://forums.ni.com/t5/LabVIEW/Adding-SOT-and-CR-to-a-message/m-p/2902364#M841577
06-30-2014 07:28 AM
Hello,
I need another help help with the corrections needed for the attached vi to get 500 samples in 1 second..
As the Microcontroller is sampling at 500Hz that means 500 samples in a second and message format sent from microcontroller is 22bytes.
can someone help me with this
thanks.
06-30-2014 07:51 AM
Is it 6 samples per message?
At 9600 Baud rate, you are only going to get about 48.5 messages per second. At 6 samples per message, that comes to 145.5 Samples per second.
If you can increase your Baud Rate to 115200, then that is ~582 messages per second. That comes out to 3490 samples per second.
07-01-2014 08:46 AM
Hi Crossrulz,
Sorry, I didn’t explain you this clearly.
Each received data of 22 bytes has 18 bytes (if first 2 bytes and last 2 bytes are skipped) each 3bytes representing a sample of a channel so the 18bytes will be having 6 channels samples.
The microcontroller is sampling at 500Hz so I need to get 500 samples in 1 second to get the continuous signal plot of each channel.
My understanding:
Each time microcontroller will send 22 bytes (0x01 0x02 <18 bytes of information data> 0x03 0x0D).
If 115200 baud rate is used then 115200/8(bits) =14400 bytes. Total number of times a set of 22 bytes can be received in 1 second is 14400/22bytes=654.
Each 22 bytes set is containing a 1 sample of a channel so we can get 654 samples of a channel in 1 second.
Can I know how the current vi should be changed to get all the samples in a second that were sent from microcontroller using a rate of 500Hz so that I can see the continuous signal plot of a channel.
thanks.
07-01-2014 09:45 AM
Change your Baud Rate to 115200. It is currently set to the default of 9600. You also have to make sure the microcontroller is set to 115200.
07-02-2014 09:05 AM - edited 07-02-2014 09:15 AM
Hi crossrulz,
I changed the vi a bit as per my requirements and changed the baud rate to 115200 in labview (also in microcontroller) but only receiving 1 sample after some seconds.
Can you please let me know how (what changes are to be made to the attached vi) to get all samples in a second and plot them so that I can see the real time signal( I want to plot voltage obtained from each sample).
Thanks.
07-02-2014 09:51 AM - edited 07-02-2014 09:55 AM
Looking back at the his post #5 and #14, the time out error is coming from the VISA Write. Not from the VISA Read. I do not think I have ever gotten a time out error from a VISA Write for RS232 (GPIB yes, but not RS232)
Could there be a problem with his com port?
Are you using the RS232 control lines and does your microcontroller use them. (CTS, DCD, RTS, DSR, DTR etc)
http://en.wikipedia.org/wiki/RS-232_RTS/CTS#RTS.2FCTS_handshaking
I do not know what would cause a VISA WRITE to time out. I could not reproduce the error.
We know his comport works in loop back from his post #1.
He has the timeout set 10 msec (not 10 sec), but even a time out 0 ms would still not cause a VISA Write timeout error.
07-02-2014 10:02 AM
07-02-2014 10:04 AM - edited 07-02-2014 10:10 AM
Does it use a termination character?
Re-read message #10 from crossrulz and message #15 from johnsold
07-02-2014 10:10 AM - edited 07-02-2014 10:10 AM
@Omar:Yes,I am using termination charcter 'D' as crossrulz suggested.