From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

multiple serial port initialisation problem

Solved!
Go to solution

Good Morning All

 

I have attached a vi which is giving me a problem that I can't solve, and would appreciate any help.

 

The vi is supposed to intialise up to 7 serial ports (only using 5 at the moment), and I'm assuming this is a plausible way to do the initialisation (could be wrong). The serial ports are connected to a pc via a usb hub. The windows XP o/s does recognise the ports according to the device manager.

 

The problem is that when the vi is run the following error is reported as shown in the attached word document.

 

I have compared the port settings in the device manager properties for each port to the vi settings and they match. What more can I do?

 

If somebody has a setup with mutliple serial ports could they try the vi and see if it works for them?

 

Thanks and best regards

Ray

 

 

 

 

 

Download All
0 Kudos
Message 1 of 6
(3,945 Views)
Solution
Accepted by topic author rayclout

It has nothing to do with multiple serial ports.  It has to do with an invalid setting you are trying to use to configure any one of the serial ports.

 

Look at the information in the error message.  Argument 4 of the property node in Configure Serial Port VI is the Stop Bits setting.  I see a coercion dot going into that VI, so that tells me the datatype you are wiring in doesn't quite match.

 

You have an array of I32 values, and your values consist of 1's.  Disconnect that array and right click on the terminal of Configure Serial Port VI and pick Create Constant.  You'll see you get a ring data type.  It is a U16.  But if you look at the items in there, you'll see that stop bits 1.0 has a value of 10.  1.5 has a value of 15, 2.0 has a value of 20.  So the value of 1 has no meaning to that property node and you get an error.  You should be wiring in a value of 10.

 

Delete that array.  Create an array of the ring constants.  Turn it into a control, and choose the correct ring value for each element of your array.

 

You have several other coercion dots.  They may not be causing you problems, but I would consider disconnecting them, creating a constant of the correct datatype, and using that in the array you wire to the Configure subVI.

 

I modified your VI and attached it.  See if it works for you.

Message 2 of 6
(3,930 Views)

As a side note, instead of having a bunch of arrays it is easier if you have a single array that contains a cluster of all the initialization parameters. I also attached the VI in LabVIEW 8.2.

 

 

 

Initialize Ports.png

=====================
LabVIEW 2012


0 Kudos
Message 3 of 6
(3,923 Views)

Thanks Ravens Fan

That worked a treat......and I learnt more about the errors associated with the Visa vi.

 

Steve

Thanks for taking the effort to show me that solution. I'm going to use Ravens solution at this time for expediency sake, but I do like what you have done

 

I've attached my reworked vi.

Thanks again guys

 

regards

Ray

0 Kudos
Message 4 of 6
(3,916 Views)

Glad you got it working. My comment on using a cluster is more appropriate if you are passing multiple configurations to a VI. Since you made most of them constants it isn't such a big deal. I was just thinking about the connector pane. You wouldn't want it to end up looking like the VISA Configure Serial Port VI would you Smiley Very Happy

=====================
LabVIEW 2012


0 Kudos
Message 5 of 6
(3,912 Views)

Ravens Fan

My apologies.....I completely missed your attachment....but hey....I don't want to get lazy....and the exercise in repairing my own work will do me more good than not.

 

Regards

Ray

0 Kudos
Message 6 of 6
(3,909 Views)