Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

microcontroller interfacing with serial port using labview

Hello shelby,can u help me.I have used bytes at port property node and waveform chart as recommended by u.I am
getting warning errors of 1073807252,1073807339,1073676294 and 1073807252.The delay in the plotting of graph
is 16seconds.This delay is maintained continuously.The number of bytes comming at serial port is 4096 bytes as shown by property node.As told by you the delay in reading the hardware data,can u suggest a way to increase the speed of data reading from the RS 232 in labview?

Details of hardware:

I am using instrumentation amplifier module to amplify emg signals connected to microcontroller & ADC
module.The data is collected through RS-232.  MAX 232 IC facilitates this.There is no hardware control.If I use
software control,the signal data is gradually becomming zero.Thank you.

 

I am posting the code.In this code I am using equiripple lowpass filter to filter emg signals in 0 to 500Hz.Can u suggest any other filter. Thank you

0 Kudos
Message 31 of 39
(2,168 Views)

Hi,

 

From looking at your VI, you are only reading 200 bytes of data at a time.  You should wire the output of the "Bytes at Port" property node to the "byte count" input on the "VISA Read".  This will ensure that all available data is being read during each iteration of the loop.  Also, you should make sure to propegate your error wire through the Express VI's that you are using.  Try these suggestions and see if it helps.  The errors you are getting are the result of not handling all of the available data at the serial port, before moving on to the next loop.

Shelby S
National Instruments
Applications Engineer
0 Kudos
Message 32 of 39
(2,153 Views)

Hi, why have you put a 500ms delay in between the write and read operations?. Does the MCU take 500ms to gather up all the data and send it?. Also what Shelby meant by using the bytes at port was to wire it to the Read VISA. Now if you are getting a 16 s delay and after seeing your vi. Have you tried a serial monitor to test that the MCU sends the bytes atonce? because this doesnot look like a LabVIEW problem, the only delay causing element is the 500ms wait function. Try using a serial monitor and check how much time does the MCU take in sending the data.

 

 

PS: I have wired the bytes at port like the way it should.

 

EDIT: Shelby beat me to it.

LabVIEW 8.2,8.6,2009...still learning 😛
0 Kudos
Message 33 of 39
(2,152 Views)

Shelby, Thank you for your valuable suggestions.I am getting the Emg signals in labview with no delay.But due to some hardware error I guess,I am getting only negative peak of the Emg signals.As ADC 808 has 255 levels,the acquired signal is below the 255 levels and the display only negative half.

Is there any provision in labview to get the full Emg signals,so that no loss of information can occur?Can I get the full waveform in Labview by manipulating the software part rather than the hardware part?

I am posting the labview graph.In the graph called waveform,there are 255 levels in y-axis and time in the x-axis.Now I am using waveform chart.The result is same as examined.For the time being I am posting this.Thank you.

0 Kudos
Message 34 of 39
(2,127 Views)

When reading from the serial port, you will be reading everything that is available.  I don't know what you mean by saying that only the negetive portion of the signal is showing up.  It could be something that you have to handle when processing the data that is being read.  Unfortunately, I am not familiar with EMG signals, or their structure.  As it stands, your program is getting all of the data, there just may be a problem with how you are handling it. 

Shelby S
National Instruments
Applications Engineer
0 Kudos
Message 35 of 39
(2,099 Views)

Hi all,

 

Back again!

 

Has anyone developed an instrument driver for the siemens tc35 gsm. I developed one using the basic serial and write and was able to poll txt messages using string to write and read - In that i used AT commands, which are used on Hyperterminal. But i want to use the messages to view it graphically. Can someone please help me with this? This is what my user inteface looks like including the block diagram in the attachment below.

 

 

Regards,

 

Hamid Q.

0 Kudos
Message 36 of 39
(2,064 Views)

Hi, if you can post it in 8.6 i could definitely have a look at it.

LabVIEW 8.2,8.6,2009...still learning 😛
0 Kudos
Message 37 of 39
(2,055 Views)

How do you convert it to 8.6?

 

regards,

 

Hamid Q

0 Kudos
Message 38 of 39
(2,050 Views)

Hi,

 

We do not have a device driver specific to your device, but it appears you are on the right track.  What do you mean you would like to view the information graphically?  What type of data are you expecting to be returned from the device?  Also, to save from a higher version of LV, such as 2010, down to version 8.6, simple select File->Save For Previous Version, then select 8.6.

Shelby S
National Instruments
Applications Engineer
0 Kudos
Message 39 of 39
(2,022 Views)