LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RS232 command writing using LV 7.0

Hi,

I need to write some code using LV 7.0 to interface with RS232 port, pls help to send me some sample code base on below requirements. I am not fimilar with RS232 interface programming. How to write and read back thru RS232 ?

 

"Send the following RS232 command : 00FE5481<CR>

This will run a test which writes data to each location in the EEPROM and reads it back. After about 10 seconds. An error flag will be set while the test is in progress and cleared when it is complete. A second error flag will be set if there are any errors in the data read.

This can be checked by sending a Request Status : 00EE01<CR>.

0 Kudos
Message 1 of 5
(3,097 Views)

You will want to take a look at the following example, and other examples in this LLB: 

examples\instr\smplserl.llb\Basic Serial Write and Read.vi

-Khalid

0 Kudos
Message 2 of 5
(3,086 Views)
If you are using LabVIEW 7.0, you will want to look at the example titled "LabVIEW <-> Serial.vi," which is found in the llb mentioned above, or in the LabVIEW Example Finder at Hardware Input and Output >> Serial >> LabVIEW <-> Serial.vi.

This example is similar to the previously Mentioned Basic Serial Read & Write, but is installed with LabVIEW 7.0.  You will need to have the NI-VISA driver installed prior to executing either of these examples.

Message Edited by JasonS on 01-23-2006 01:38 PM

0 Kudos
Message 3 of 5
(3,073 Views)
you mean if I want to send a command 00FE5481, at the serial.vi (String to Write), just input "00FE5481" and run ?
0 Kudos
Message 4 of 5
(3,063 Views)
The default text mode for the "String to Write" field will be ascii text, so if you enter 00FE5481, it will actually output all eight ascii characters, just as you type it.  If you would like to to output the number you mentioned as a binary data, you will need to first right-click on the the string control and select "Hex Display."  This will cause the string control to convert your hexadecimal string into byte values which will then be sent to the VISA Write VI.  In this example, your 00FE5481 would translate into a 4 byte string of integer values.

I hope this helps,

Jason S.
Applications Engineer
National Instruments

0 Kudos
Message 5 of 5
(3,058 Views)