Jump to content

Here's an easy serial one for ya...


Bryan

Recommended Posts

This is in LV8 BTW. It seemed like a simple enough task to do, but it doesn't work how I envisioned. I haven't beat my head over this too much as I have other things going on, but maybe you guys can tell me what I'm missing.

We have a computer that has it's serial settings applied by a completely different application (non LV or NI). What I want to do is read those serial settings into LabVIEW for use in one of our verification applications. Sounds simple enough, right?

When I look at say, the COM1 settings under device manager, I see certain settings. When I try to read those settings into LabVIEW using the NI VISA resource name and property node, I get the typical default values (9600,8,N,1). Then, I'll open MAX and it will show a port settings conflict.

I'm not a VISA guru by any means and this is the only way I currently know of to access a serial port in LabVIEW and it's always worked fine for me, but I've never used it in this manner before. Is it possible to see the "Windows" settings from NI VISA to read into LabVIEW, or do I have to look at a different route?

For those curious, our LabVIEW application runs a hardware verification on the system and checks for communication over the serial ports. The other application that's supposed to run on the system sets the values, which are different per system (and we have 60+ systems to check). Whenever we wrote our verification application,we weren't told what the settings were SUPPOSED to be, so our application has always used the defaults just to check for communication. But, when we run our application, it changes the settings in VISA and seems to be affecting the windows settings to the point where when we finish our verification and start the other application, it generates errors. At least, I THINK that this is what's causing the errors.

I just figured it better (and the easiest way to remedy the problem) to just read in what the other application set the com port settings to, then use that for our verification so that we don't see the problem anymore.

Maybe this is something easy and I'm missing something simple. I've been working 8pm to 6am for the past couple of weeks and my brain isn't running at peak performance.

Link to comment

I just tried using the command line approach and the values returned to me don't match the configuration in device manager. i.e. Device Manager = 9600,8,n,1. command line = 1200,7,e,1.

I only have one com port on my current machine, so I'm sure I'm accessing the correct one.

Link to comment

QUOTE(Bryan @ May 16 2007, 01:33 PM)

I just tried using the command line approach and the values returned to me don't match the configuration in device manager. i.e. Device Manager = 9600,8,n,1. command line = 1200,7,e,1.

I only have one com port on my current machine, so I'm sure I'm accessing the correct one.

Device Manager shows you the default Windows setup of the port.

If this is what you want, I'm shure you can find these values in the registry somewhere.

The command line shows you the current settings of the port ie. what setting were used the last time the port was accessed by an application.

I just re-read your first post, and I may have misunderstood what you wanted to do - I thought you wanted to see what parameters some other piece of software used for accesing the port.

-Mikkel :)

Link to comment

So, if I understand you correctly, if the other application sets the serial settings and accesses the port, the command line method will then contain the values used/set by the application? Interesting. I'll have to give it a try.

UPDATE: You're right! Now the command line returns the correct values. All I need to do is write a function to parse out all of the information.

Thanks!

Link to comment

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.