04-03-2013 09:40 AM
Hi everyone,
I have a problem with communication with an RS232 device with VISA. PC and device are connected with a third-party USB-to-serial converter. The RS232 device is controller of a temperature chamber and I would like to send and receive commands in order to control the chamber. First I used a basic I/O VI with VISA blocks (create, write and read). Although I send the same command each run, the controller sometimes responds correctly, sometimes returns a command error or gives no response (when controller does not respond the link LED does not blink).
I have tried to send commands with VISA test panel. Almost every command is responded correcty but some command errors, but all command have been received by the chamber. Then I checked almost every attribute tracked in NI I/O Trace with property node (from resource name to end modes) and changed some of them which are not equal, but VI does not run like Test Panel.
I have used the program given in the link below, which uses .NET for communication, then communication was successful without any problem.
http://www.labviewportal.eu/viewtopic.php?f=18&t=472
Any help would be appreciated to solve this problem.
Thanks,
04-04-2013 12:57 PM
Hi bencizdim,
Can you give me a little more information on the USB-Serial Converter. The program that you used avoided the use of VISA. I have in the past seen unsupported USB-Serial Converters that have had similar behavior. Also, what is the rate that you are sending I/O from your controller? Is this behavior new or has it always been like this?
04-05-2013 02:50 AM
Hi Ryan-AE,
Thanks for your reply. This is "Prolific USB-to-Serial Comm Port" with drivers provided by the manufacturer. Serial port config: baud rate=9600, bits=8, parity=none, stop bits=1, flow control=none. I could not say anything about the history of device since this is the first time that I have used an USB-to-serial converter.
Interestingly, I have tried to use Instrument I/O Assistant then it responds to all commands without error up to now -but I don't like to work with Express VI's. I think there should be a very basic mistake when configuring serial port in the program (fyi, the program that does not work properly is "basic serial write and read.vi" in examples.)
04-05-2013 08:56 AM
Do you think you could put your code up so I can take a look at it? I understand and agree that using an express VI limits what you can control.
04-05-2013 12:18 PM
You have said that you can get the Instrument Assistant vi to work for your application but you do not want to use express vi's. You can right click on the working Instrument assistant vi and open the front panel. That will convert it to a regular vi that you can edit and rename for your particular needs.
04-07-2013 03:23 AM
Here is the block diagram of the program.
ps. I had a chance to use another computer with serial port on motherboard, then it works fine (like test panel via converter, with few command errors)
04-07-2013 03:25 AM
@GovBob wrote:
You have said that you can get the Instrument Assistant vi to work for your application but you do not want to use express vi's. You can right click on the working Instrument assistant vi and open the front panel. That will convert it to a regular vi that you can edit and rename for your particular needs.
Thanks, I'll look at it.
04-08-2013 08:33 AM
Hi bencizdim,
We'll it looks like you are working with an the basic example for serial read and write from LabVIEW. Have you had any success with converting the Instrument I/O Assistant into its basic components? I like that idea. If you are still having problems can you discribe the instrument command error that you are receiving? Also the code that you are using that includes the express VI, can you send me what that set of code looks like? Is it the same as the example + the express VI or was anything else changed?
04-09-2013 03:48 AM
I have converted the ExpressVI to SubVI then block diagram given in attachments. This VI works exactly as the ExpressVI.
I have listed the differences in the new VI stands out from the VISA write/read VI:
Then I modified the Basic serial and write.vi with these (by “copy-paste”ing) and in order to search for the effect of each change I put them in Diagram Disable structures. These are my experiences:
- Enabling termination character, connecting VISA session in for read before write, defining timeout, even adding reading loop does not make any difference, i.e. problem still remains.
- Removing configure serial block then adding the same control for VISA session makes most of the commands are sent but reasonable amount of them was not send - loop iterates until timeout. This is a new experience since recognized commands are significantly increased, but performance is not acceptable.
After modification the code looks like the created VI but I could not understand why it does not run like the source. I think it’s better not to use USB-serial converter for this application.
04-09-2013 04:27 PM
That's interesting, I wish I could give you more information about what you have found. Unfortunately when using third party hardware it makes it more difficult to predict how a set up with behave. Will you be able to use th Instrument I/O assistant? How quickly are you trying to read and or write? The speed can effect the reliablilty, especially when using a USB to GPIB converter.