LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

i can't read data from serial port

i want to read data from serial port using rs232,but the instrument require a command to be received prior to sending data.i use the example as "serial communication",but it does't work.i don't know how to write a command to the instrument.using Microsoft VB,the command is "COMM1.OUTPUT=CHR$(129)+CHR$(129)+CHR$(67)+CHR$(0)+CHR$(232)+CHR$(3)+CHR$(44)+CHR$(4),how to write in LabVIEW?
thanks for your reply!
0 Kudos
Message 1 of 8
(3,325 Views)
Hi,
to build up the data, you can convert the numbers (129, 129, 67, 0 etc), into their character equivalent, and then transmit that.

Hope this helps - are you using serial .vi's or VISA?
Really the matter is getting the string you want to output in the first place.

Here's an example in screenshot using the serial compatability vi's.

Hope this helps

S.
// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 2 of 8
(3,325 Views)
Hello,

I've had a similar problem and the technical support of National Instruments send me a solution called "serial line control". But than annother problem occuried an internal error, while trying to run this Vi.
If you like, I'll send it to you und you can test ist yourself und maybe you are able to handle the internal error problem.

Greetings Ruth.
0 Kudos
Message 3 of 8
(3,325 Views)
Try to attched VI - I use it to test my serial instruments. Type the following into the "String to write" control (without the quotes): "\129\129\67\0\232\3\44\4"

cheers,
Christopher

Christopher G. Relf
Certified LabVIEW Developer

Christopher.Relf@mBox.com.au
International Voicemail & Fax: +61 2 8080 8132
Australian Voicemail & Fax: (02) 8080 8132

---
EULA
1) This is a private email, and although the views expressed within it may not be purely my own, unless specifically referenced I do not suggest they are necessarily associated with anyone else including, but not limited to, my employer(s).
2) This email has NOT been scanned for virii - attached file(s), if any, are provided as is. By copying, detaching and/or opening attached files,
you agree to indemnify the sender of such responsibility.
3) Because e-mail can be altered electronically, the integrity of this communication cannot be guaranteed.




Copyright © 2004-2023 Christopher G. Relf. Some Rights Reserved. This posting is licensed under a Creative Commons Attribution 2.5 License.
0 Kudos
Message 4 of 8
(3,325 Views)
Thank you!
the example you given can be opened in version6.1,my version is 6.0,i can't use it.
0 Kudos
Message 5 of 8
(3,325 Views)
ok!you can send it to me! My E-mail:lxueqiang@yeah.net.
0 Kudos
Message 6 of 8
(3,325 Views)
thank you!
i am using VISA.
0 Kudos
Message 7 of 8
(3,325 Views)
and I type the command"\129\129\67\0\232\3\44\4",it still wrong,why?
0 Kudos
Message 8 of 8
(3,325 Views)