Instrument Control (GPIB, Serial, VISA, IVI)

Showing results for 
Search instead for 
Did you mean: 

microcontroller interfacing with serial port using labview

Heres the link to the cr10x datalogger manual


Thats what i thought when i was searching online, you use a MAX232 to convert the logic levels. So is it still possible to use the gsm for communications somewhere between the datalogger and remote PC? I'm still not clear about this. I'm thinking in my head just now to attach a micro or usart to the datalogger serial, which i believe uses CMOS voltage levels then somehow attach a gsm to the micros/usart port then send messages using txt which would it still be in 5v logic format? if so, then the information received by the modem at the remote PC, would best use the MAX232 to convert this to rs 232?


Does this makes sense, if not i would greatful if you could correct me here. I'm still looking into the ethernet connection at the moment.



0 Kudos
Message 21 of 39

Hi, the DB9 pin port in the CR10x has different pin outs than the ordinary port. as it says in section 6-5 that you should use SC32A to interface the CR10x to the PC, than you can communicate with the CR10x with the serial port configured as Asynchronous. All written on page 81 of the datasheet. Do it and see what happens. 


PS: There is also talk of an RF Modem.. bet if you study about it, you can use it for your Ethernet problem

LabVIEW 8.2,8.6,2009...still learning 😛
0 Kudos
Message 22 of 39

This is an Awesome post .. thanks alot coz so far it helped alot...

I have few more questions and please excuse me, i'm a newbie with LabVIEW


what I am trying to do is programming an mcu that can be recognized by LabVIEW.


1. If i wanted to connect the MCU to LabVIEW serially using *VISA, would that be similar to

connecting an MCU to HyperTerminal? (both physically and in software??)

2. if they're different, What does the data look like which LabVIEW expects to receive from the MCU.

I mean is there some sort of protocol should be followed?


*VISA i mean by that using VISA Commands like *IDN? and my MCU should respond to that by sending back a device name I gave to it.


am i missing something here?


Thanks everybody,


0 Kudos
Message 23 of 39

Hi, i will answer your questions in the series that they are asked:


An MCU is not 'recognized' by LabVIEW(atleast not if you are doing PICs, 8051s, AVRs).


1. Well. The hyper terminal is a routine/software that talks to the serial port, when you use VISAs to talk to the serial port than obviously the hyper terminal wont be able to do it. You will need to make the software part in LabVIEW(using VISAs as you want it), use appropriate hardware(Line converters etc) and ofcourse program the MCU with the serial routine. 


2. Data sent serially to labview is interpreted as a string, One can use various functions to convert them in t numbers or manipulate them. 


About your last question, LabVIEW doesnt 'see' your MCU, it only talks to the serial port, for all you know you could be using any RS-232 device. Read through this. In the second link an example has also been given.



LabVIEW 8.2,8.6,2009...still learning 😛
0 Kudos
Message 24 of 39

Brilliant ! .. thanks again for the quick response..

I'm going through with what you provided.


0 Kudos
Message 25 of 39

Hello sir,I have established serial connection with 8051 microcontroller using VISA.And I want to plot the acquired Emg signal on a graph in Labview.

The problem is I am not able to get continuous waveform of the acquired Emg signal.There is a considerable delay throughout the signal acquisition.The real time signal plotting is not possible continuously.Baud rate I am using is 57600,no parity,one stop bit.The connection is asynchronous,serial instruction used for interfacing is ASRL.The used port is validated and recognised by Pc.Help me.Thank u.

0 Kudos
Message 26 of 39



When you are doing serial communications like this, you will only be able to plot data as fast as it is returned from the device it is reading from.  In the case of serial, there may be some delay when waiting for a response from a device.  How do you have you connection setup, and how are you reading the data at the serial port?  If you think you are not reading all of the data currently available at the port, try using the "Bytes at Port" property node output, as an input to your serial read.  This will ensure that all available data at the port is read.


Another suggestion would be to try using a waveform chart, instead of a waveform graph.  Using a chart should avoid any gaps in data.

Shelby S
National Instruments
Applications Engineer
0 Kudos
Message 27 of 39

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.

0 Kudos
Message 28 of 39

You are getting a delay of 16 secondsSmiley Surprised in plotting the data? Is that after the MCU sends data to the serial port? or is that after the emg signal measurement has started?. What kind of ADC are you using and what is the sampling rate?. I dont think serial can give you more speed than what you are using. About your VI can you post it? 16 seconds i too much!!

LabVIEW 8.2,8.6,2009...still learning 😛
0 Kudos
Message 29 of 39

Hello shelby,can u answer to my yesterday's post.Can any NI engineer give me a possible solution?Thank you

0 Kudos
Message 30 of 39