Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

RS232 Communication

Can some one tell me how to write program for a RS 232 Command.
Commands are as follows.
SA00GO125.0,SA00V2.25,SA00MA125.0
 
how to send this string to RS232 using Labview.
after every command there will be reply
SB---for busy status of micro
SK ---for ACK once the Command received Correctly.
some command have reply after SK
Joe
Using Ver. 8.0
0 Kudos
Message 1 of 7
(4,106 Views)

First, check the communication with the device with either MAX (Measurement &Automation Explorer) or Hyperterminal. This will verify the serial com parameters (baud rate, etc.) and that you're using the correct type of serial cable. Then look at the shipping examples for serial communication. The Basic Serial Write and Read and the Advanced SErial Write and Read differ mainly in how the terminalation character is sent at the end of each write. In the basic example, the termination character is included in the "string to write" control. The example uses a CR/LF (the \r\n). The advanced example shows how to use a VISA Property node to set a termination character. In this case, it's a LF). Your code should be pretty simple. You write the text using a VISA Write. Then, you could wait until VISA Bytes at Serial Port returns a non-zero amount and then keep reading until VISA Bytes at Serial Port returns a zero count.

There an awful lot of other examples (and questions) posted on serial communication. I answered one yesterday. A search of both this and the LabVIEW forum would help.

Message 2 of 7
(4,085 Views)
all the commands are in String Constant Form.
Will its accept the command string as it is ? like SA00GO125.5
can you mail me some examples??
Joe
Using Ver. 8.0
0 Kudos
Message 3 of 7
(4,069 Views)
Yes, all you have to do is pass your strings to VISA Write just like the shipping examples I mentioned.
0 Kudos
Message 4 of 7
(4,034 Views)

Its not working .

The instrument which is receiving these command is runnig in an 8 bit processor, may be because of that its need a delay between each charecter.( by experiment its found that it is 60mS for Boud Rate of 9600).

Can you suggest some method to overcome this issue?? do you need me to mail you the vi, you can mail to my user ID (joly@rediffmail.com )

hope someone can help me to resolve this issue.....!!!!

 

Joe
Using Ver. 8.0
0 Kudos
Message 5 of 7
(4,013 Views)
Send each character with a single VISA Write!
To do so, insert a ´String to byte array´ node into the wire from your string control to the VISA Write node.  Create a For loop around VISA Write. Notice that the byte array is autioindexed at the for loop border. This corrsponds to pseudocode like "For each character write char". There is one thing left; you need to insert a ´build array´ and a ´byte array to string´ node into the wire between the inner for loop border and VISA Write.
This delayes each character at about 1 ms. If this is still not enough, put a Wait_ms node inside the above mentioned for loop.

HTH   and Greetings from Germany!<br>-- <br>Uwe
0 Kudos
Message 6 of 7
(4,004 Views)
Here's another way.
0 Kudos
Message 7 of 7
(4,001 Views)