Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

LABVIEW interface with OOPIC microcontroller

Hiya,
I have problem received data from OOPIC microcontroller (www.oopic.com)to LABVIEW.But, I had tried on hyper terminal and it's work fine. Please advice as well do I need to use any associated files when communicate OOPIC with labview?
0 Kudos
Message 1 of 6
(3,860 Views)
Hi,

It really doesn't matter to what you are communicating with (oopic, multimeter, scope, etc). RS-232 is a protocol data allows you to send data back and forth between two devices.

Since you are able to communicate with the device using Hyperterminal that means that the cabling and serial setting are correct. What are the serial settings?. Are you configuring these setting in your VI?.

The other thing to be aware of is to include the appropriate termination character in the messages you send. Do you press Enter in Hyperterminal to execute the command?. Are you sending the linefeed character in LabVIEW (Enter)?.

What LabVIEW version are you using?. Are you using the VISA VIs or the serial compatibility VIs?. We recommend using the VISA
Vis.

Finally, Do you get any error messages?.

Let me know if you have any questions.

DiegoF
National Instruments.
Message 2 of 6
(3,860 Views)
Dear DiegoF,

Thanks for your reply.YES, I have set everything in LV Serial Port Initiazation.I no need to press any keys, basically when I turn my hyper Terminal on, the characters will automatically appeared.I dont understand what you mean by LineFeed character cos I am new to LV plus I am using LV version 5.1 which I cant find VI for LineFeed.Oh yeah, by the way, I set my VISA thr 'instrument wizard' and when i press identify device, the error message appear. The messages is 'There was an error sending this string. The VISA error code returned was :- 1073807339.
Error:-1073807739 occurred at VISA read.Possible reasons:- VISA(HEX :0xBFFF0015)Timeout expired before operation completed.I try to configure my serial port thr MAX but when i pressed 'add new
device or interface', I cant see serial port. I dont know why? I only can see few devices i.e PXI,RDA,SCXI and VXI. Please advice and help!
0 Kudos
Message 3 of 6
(3,860 Views)
Hi,

A timeout error in the read usually means that the command sent to the instrument was not correct, so the instrument does not respond and the timeout expires.

In serial communication it is common to define a termination character which indicates the end of a message or command. If the device does not receives a termination character, even if you sent the right command, does not detect a complete command. Usually the linefeed character is used as the termination characer. The linefeed character is the ASCII code that represents the "Enter" key.

I assume that in Hyperterminal you type the command and then press enter and that is when the device start processing the command. The enter sends the linefeed character to the device. Yo
u need to add that character to the message your are sending from LabVIEW.

Use the string constants and the concatenate string VIs to attach the line feed to the message you are sending.

I assumed that the device takes a line feed as the termination because it is a common choice, but it can be anything. Review the documentation of the device.

DiegoF
National Instruments.
0 Kudos
Message 4 of 6
(3,860 Views)
Thanks for your advice. I managed to hooked up my OOPIC with LV.By the way, I have question to ask i.e how am I going to display integer numbers(bytes) i.e 0 - 255 and strings simultaneously and independently. As I need to use those numbers to plot chart as well display some strings and those numbers on string table. I tried to connect serial port read VI with strip chart VI through bundle cluster VI but it seems can not connect(able to display strings only).What should I need to do, please advice.


Thank You."
0 Kudos
Message 5 of 6
(3,860 Views)
Hi,

This is also device specific. The serial port returns a string. More than a string, this is a byte array of whatever the serial port receives. It is convenient to represent the data as a string since most of the time the data sent is ASCII.

You need to parse and format the string data. Parsing means getting the information you are looking for. You need to know how the device sends you the data and look for common elements. Formating means taking the ASCII data and passing it to numeric format. This depends on whether the device sends data in binary or ASCII format.

Here are some links Keyword Search: Parse String VI.

The important thing is having good documentation on how the device formats and packages the data send to the PC. This will allow you to decide what you can do with the data.

This is more of a programming issue. you might get more answers in the LabVIEW forum for parsing and formating questions.

DiegoF
National Instruments,

Message Edited by Molly K on 02-18-2005 11:07 PM

0 Kudos
Message 6 of 6
(3,861 Views)