LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to read written string

Hello everybody,
I have a Problem with a VI to communicate with a Sensor via RS 232.
If I try to send the command string via windows hyper terminal eveything works. I get the right
answer strings back and the sensor works. If I try to communicate to the sensor via labviw it seems
that the sensor doesn´t get the string like I send it because it gives me an error String back which means
the command wasn´t right. Now I want to see what exactly LABVIEW sends to the Sensor - but I do not have
a Serial Wire to connect my PC to another to check. So if anybody knows how I can check this in another
way this would be great.

Richard
0 Kudos
Message 1 of 14
(3,763 Views)
Try this loop back test...http://digital.ni.com/public.nsf/allkb/E22DA85E97818DE78625678C0069BFC9#L

There are some other helpful debugging suggestions in that link too. I would check the termination character settings first.

If you don't have any other way to short pin 2 to 3, you can gently push an IDC jumper on across them. Loopback test should then work.
I don't think this will help though, it is really just for checking the hardware and that is rarely the problem. I'm guessing you want to send it in LabVIEW and read it in Hyper terminal? If you had 2 ports you could send it out one in LabVIEW and receive it in the other with Hyper Terminal. But you mentioned you don't have a cable, so I guess that isn't an option. If you did have the cable you would probably find out it was the termination character anyway.

Message Edited by Troy Kujawski on 05-29-2007 11:32 AM

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
0 Kudos
Message 2 of 14
(3,744 Views)
First of all to see what LV is sending out the serial port, all you have to do is out a probe on the string going to the Serial (or VISA) write. Next, if Hyper Terminal is working and LV isn't, make sure all the setup parameters are set the same. In addition, if the sensor requires a command terminator, make sure the LV version is using the right one. The default line terminator for the Windows version of LV is a line-feed, whereas many instruments that utilize a command terminator use a carriage-return - as does Hyper Terminal...

You can be assured that the problem is with your LV code.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 14
(3,734 Views)
Hallo everybody and thanks for the quick answers.

Today I checked LV with Free Serial Port Monitor. It shows that the Sensor is getting the right String.

Now I don´t know where to look else. I checked all the things you said - but maybee I´m blind because
of searching too long for the failure.

Well here is all I have about the Sensor Interface






And here an Example Command with answer:



I wrote a short Test VI which I attach here - so maybee somone find something. 🙂

Thanks
Richard

Message Edited by S_TituS_G on 05-29-2007 03:16 AM

0 Kudos
Message 4 of 14
(3,723 Views)
Are yu sure you are talking ot the right port?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 5 of 14
(3,701 Views)
Yes I´m Sure it´s the right Port. I get right answers in Hyperterminal and Error Message-Strings from the Sensor in Labview.
Wouldn´t be so if I speak to the wrong Port.

Cu, Richard
0 Kudos
Message 6 of 14
(3,698 Views)
One thing to try is to send a termination character with the command. The VISA Configure Serial Port Termination Character Enable is only for receiving. Look at the shipping examples. The basic one sets the string control to '\' Codes Display and uses the \n. The advanced example uses a VISA property node to set the write termination character.
0 Kudos
Message 7 of 14
(3,690 Views)
"One thing to try is to send a termination character with the command. The VISA Configure Serial Port Termination Character Enable is only for receiving. Look at the shipping examples. The basic one sets the string control to '\' Codes Display and uses the \n. The advanced example uses a VISA property node to set the write termination character."

The Termination Character is "." and is send with every Command String. In Hyper Terminal is everthing set that no additional character is send with the string.
And it works. In LAbview the Same settings and I send the Point at the and of the CommandString like I do with Hyper Terminal - but it doesn´t work.

Richard
0 Kudos
Message 8 of 14
(3,677 Views)

In hyperterminal, you are also sending a CR and LF when you hit the enter key.

I don't know what the 'Free Serial Port Monitor' is. I use a utility called portmon. That works well for comparing what hyperterminal is sending with what LabVIEW is sending.

0 Kudos
Message 9 of 14
(3,672 Views)

"In hyperterminal, you are also sending a CR and LF when you hit the enter key.

I don't know what the 'Free Serial Port Monitor' is. I use a utility called portmon. That works well for comparing what hyperterminal is sending with what LabVIEW is sending."


I  don´t hit enter key. 🙂 But I will try that tool and will post the new Results.
Thanks so far.
Richard
0 Kudos
Message 10 of 14
(3,666 Views)