LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

close serial driver (Port 17)

Hi,

I have a PXI rack that is running with approx 28 RS232 Comm ports.

I need to set DTR low on COM Port 22 (Labview Port 21). I can manage this using the Serial Visa commands. This is not the proble as it achieves what I want. However, I then need to close this serial port.

On another machine (with less serial ports) I can do this using 'Close Serial Driver' vi. But on the machine with 28 RS232 ports it reports Error 37, with anything higher then Port 16 i.e 17 onwards.

How can I get Close Serial Driver to control Port 21 ??
0 Kudos
Message 1 of 17
(4,028 Views)
P.S I have no trouble communicating to Port 20 and 21 using the standard Serial Vi's i.e Read/Write/Init.
0 Kudos
Message 2 of 17
(4,020 Views)
What version of LabVIEW are you using? Close Serial Driver is an obsolute function that originally used a driver called serpdrv. Are you mixing VISA functions with serpdrv functions or are you using the replacement functions for Close, Serial Port Write, Serial Port Read? The replacement functions use VISA but you should just use the regular VISA Read, Write, etc. instead and mixing VISA with serpdrv functions is a mistake. If all of your code is VISA, then just calling VISA Close should be enough to release it.
0 Kudos
Message 3 of 17
(4,016 Views)
Labview Version 6.1 is being used.

The Close Serial Driver seems to work for Ports 0 to 16.
this can be monitored by viewing the open serial driver vi (may not be the right name as i am at home now, so do not have access to the labview files).

if you run serial init the serial open vi toggles on, then running Close Serial Driver and it goes off.

Serial init seems to work for Port 21 as no error is logged. but serial close alway gives error 37 (for Ports 17 - 28).

What I need to do with port 21 is as follows :

1. Power Off Equipment under test, which is connected to Port 21
2. 'Assert' Port 21 DTR
3. Power On Equipment under test, which is connected to Port 21
4. Send 'cld' to Port 21, and read out the response. I need to set DTR in order to force the equipment into a certain mode.

At present I am using VISA 'Modem line settings' to set the DTR, then the standard Serial Read & Write Vi's that come with Labview to do the rest.
I did find that I had to 'Close' the after setting DTR, in order to use the standard Serial Read & Write Vi's. But this was on a PC using only 4 RS232 ports, and it worked fine.

However, as mentioned above I am now using a machine with alot more Serial ports. The only ones I can use are Ports 20 - 28. Serial Close only seems to work on Ports 0 - 17 out of 28 available.
0 Kudos
Message 4 of 17
(4,009 Views)
You should not be using any of those old serial functions. They are obsolete and no longer supported. Use only functions on the Instrument I/O>Serial palette. Using anything from the Serial Compatability palette is just asking for trouble. These were created in the original release of LabVIEW and I wouldn't be a bit surprised if they don't support ports greater than 16. They aren't even included in newer versions of LabVIEW. Using a VISA Write instead of Serial Port Write is much simpler. For one thing, you do away with the nonsense of com port 1 is LabVIEW port 0. For a VISA write to com port 1, you have a VISA Resource Name that says Com1. For another thing, as I mentioned, NI is now only supporting VISA.
0 Kudos
Message 5 of 17
(4,001 Views)
Apologies if this is a false lead (discussions mixing Visa and old serpdrv get me confused), but is this a case where you have to go to the labview.ini file and define things in the line

serialDevices="COM1;COM2;COM3;COM4;COM5; etc. etc.

Much better discussed in the following link:

http://forums.ni.com/ni/board/message?board.id=170&message.id=5455
=====================================================
Fading out. " ... J. Arthur Rank on gong."
0 Kudos
Message 6 of 17
(3,879 Views)
If I shouldn't be using these things, what should I use to set DTR, Open, Close, Read and Write to Port 21
0 Kudos
Message 7 of 17
(3,986 Views)
Hi Dennis, just a point - I have LVRT 7.0 and 7.1 and in both the serial compatibility VIs are installed in VI.lib\Instr\Serial.LLB. LV 7.0 even has a subpalette for them inside the Fieldpoint palette. I may have for them to be installed specifically or they may be installed only with the RT version, but at least for some of the newer versions, they are still installed.

___________________
Try to take over the world!
0 Kudos
Message 8 of 17
(3,978 Views)
Yeah, I know. The difference is that the low level functions in 7.0 and 7.1 are based on VISA and not serpdrv. Serpdrv was still shipped with 6.1. There's no real problem with using any of the functions in 7.0 or 7.1. They add a little bit of overhead is all like translating a port number defined as a numeric into a VISA resource name.
0 Kudos
Message 9 of 17
(3,859 Views)
You configure a port using VISA Configure Serial Port. You write to it using VISA Write. You read from it using VISA Read. All of the functions are on the Instrument I/O>Serial palette. You open a port using VISA Open. You close a port using VISA Close. You configure the DTR line using a VISA property node. All of these functions are on the Instrument I/O>VISA>VISA Advanced palette. It's not absolutley neccessary to do a VISA Open and Close but if you want to have another application use a port wheile LabVIEW is still running, you will need to do the close.
0 Kudos
Message 10 of 17
(3,969 Views)