Jump to content
germ

Serial port problem: Error -1073807194 when configuring serial port

Recommended Posts

I have previously written an LV program to communicate with a US Digital QSB-D encoder (http://www.usdigital.com/products/interfaces/pc/usb/qsb) via a virtual COM port accessed through USB. The computer has a newly isntalled C: drive. After re-installing LV (2009 SP1) I got the "Hardware resource not available" error. Re-installing NI-VISA got rid of that error.

However, my previous program does not work. I get the following error when calling the "VISA Configure Serial Port (instr).vi": code -1073807194, "property note (arg 8) in VISA Configure Serial Port (Instr).vi->...".

How can I find out what's "arg 8"? There's no clear sort order to the arguments of that VI that I can see.

Anyhow, the device can be setup to output CR, LF, or nothing as the "end of response" character. It is currently setup to "nothing". If I use the "Simple serial communication" example, in which, infuriatingly, the "terminator" character terminal is NOT connected and the "user terminator character" is hard-wired to False, then the error happens ONCE, but when I try again I can issue and read a command ONCE. After that, communication is blocked (no data are returned when issuing the same command).

There is some software that comes with the device, but it seems to reset the device to the above-mentioned state on quitting (very annoying).

Any suggestions before I go back for another day of fiddling with serial ports?

Thanks.

Share this post


Link to post
Share on other sites

The error comes not from the VI itself, but from the property node inside the VI. The arguments in the property node go from top to bottom (i.e. the top argument is argument 1). You can count down to 8 to see what's the property that's returning the error (although I don't know if that will help you. USB to serial adapters are notorious for having problems and it's possible you might need to reinstall its driver or get another one).

Share this post


Link to post
Share on other sites

Thanks Yair...but what's "top to bottom"? The terminals are arranged around all edges of the Configure Serial Port VI icon. There's no "top to bottom" order that I can discern.

Anyway, it seems that arg8 is the Termination character, which I set to ASCII 13. I will experiment here and report on the solution. Since the native software that came with the device CAN communicate just fine, it means the serial port is working.

Share this post


Link to post
Share on other sites

There's a property node within the Configure Serial Port VI. Can you view the block diagram?

Share this post


Link to post
Share on other sites

Like asbo said, you need to open the VI. Looking at it now, I can see that arg 8 is flow control.

Share this post


Link to post
Share on other sites

Like asbo said, you need to open the VI. Looking at it now, I can see that arg 8 is flow control.

Well, that's a basic VISA VI. Can't open it.

Took another stab at it today. Didn't have much time, and didn't get any further. I noticed that the example VIs have both a Basic and Advanced serial port. The Advanced wires the Terminator character, but then has a loop that tries to read the serial port many times.

Anyway, it all only works the FIRST time I run a simple command. After that, everything is locked when I send the same command. No "bytes at the port".

Share this post


Link to post
Share on other sites

Well, that's a basic VISA VI. Can't open it.

It opens like any other VI for me. I placed it on the BD of a new VI, Ctrl + double clicked it, and got its BD. Arg 8 does indeed appear to be flow control.

More than anything, it sounds like you're not configuring your port correctly. "[E]verything is locked" is a little ambiguous - LabVIEW freezes? The VI stops reacting to user input? The VI stops reading data from the device but is otherwise responsive? And what do you mean by a simply command - do complicated commands fail?

It looks like the device has a particular message format, I would verify you're sending those commands correctly, including the right termination character. If you think you have everything correct, post your code (which you probably should have done in the first place). No one has your device on-hand, so we can only offer general advice.

Share this post


Link to post
Share on other sites

It opens like any other VI for me. I placed it on the BD of a new VI, Ctrl + double clicked it, and got its BD. Arg 8 does indeed appear to be flow control.

OK, I will try to open it today.

More than anything, it sounds like you're not configuring your port correctly. "[E]verything is locked" is a little ambiguous - LabVIEW freezes? The VI stops reacting to user input? The VI stops reading data from the device but is otherwise responsive? And what do you mean by a simply command - do complicated commands fail?

No freeze. The VI works, but after issuing the same command there is no further reply from the device (zero "bytes at port"). The VISA Read then times out if I use the Advanced Serial example.

It looks like the device has a particular message format, I would verify you're sending those commands correctly, including the right termination character. If you think you have everything correct, post your code (which you probably should have done in the first place). No one has your device on-hand, so we can only offer general advice.

The funny thing is that this used to work correctly about a year ago.... so yes, I am sending the right commands. Regarding the termination character, according to the device documentation, it is set to "no termination character". The software included with the device should allow to change that, but it appears not to work. That is, if I change the "End of reply" character, it doesn't stick when I exit that software.

Share this post


Link to post
Share on other sites

Update: I now have it working....on another computer. And of course it is possible to open the VISA Configure Serial Port VI, sorry for having missed that.

Either:

The Terminator character was set incorrectly (to LF while the device expects none)

or:

An additional USB hub or two on the other computer prevented this from working.

I will be able to check only later this week.

One question I still have: This device can use one or two characters termination, but the VISA serial seems to only accept one. How would I set it up to use CR/LF? Is this possible?

Share this post


Link to post
Share on other sites

USB hubs are something to look out for - too many or certain brands or unpowered hubs can introduce weird problems into your instrumentation. It's best to get your devices as close to your PC as possible.

An NI article addressing your issue - Termination Characters in NI-VISA: Instruments Using Multiple Termination Characters

Share this post


Link to post
Share on other sites

Final update: It works now. It must have been the terminator character, which was enabled when the device does not expect any.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.