Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Controller Com1 does not work under program control. Buffer set in device mngr

I am using VB.net and RS232 drivers that access the Kernel32.dll on my NI PXI controller running windows XP.
 
Using proven code the Comport.Write routine fails.  I had to go the Device Manager under advance comport setting for com1 and Uncheck the "Use FIFO buffers (requires 16550 compatible UART) check box.
 
The software began to work after changing the hardware setting. 
 
Question, Does the NI pxi controllers use Non 16550 compatible UARTs?  Have you seen this problem before?
 
Scot Hudson
850-251-4784
 
0 Kudos
Message 1 of 8
(4,677 Views)

Hi Scot,

Some of our controllers use 16550 compatible COM ports, but I cannot say whether or not all of them do.  Could you tell us which model controller you are using?  Or, if you search NI.com for you controller and go to the user manual and specifications page, you can do a search for 16550 and you should find the specs for each peripheral on that controller.

Scott G.
AE Specialist
National Instruments
0 Kudos
Message 2 of 8
(4,659 Views)
Scott,
Thanks for the info,  Here is an update from my end.
 
Setting the Windows Buffer in device manager did not work permanently.   I can get Hyperterminal to work but my proven software does not complete a write transaction using a kernel32.dll call.  By proven I mean the same software worked on a standalone PC.
 
I am using a 232/TTL converter and when I connect the device which is externally powered my software will not transmit.  I can get it to transmit using hyperterm.
 
I made a jumper to only bring out pins 2,3, and 5 to the converter but the problem persists. 
Today I found another forum entry with a similar problem:  http://forums.ni.com/ni/board/message?board.id=270&message.id=2289&requireLogin=False
 
I found the P/N of my controller and looked up on Page 3-1 of the user manual and found it is a 16550 compatible UART.
 
I will try one more thing which is use the PXI 5V bus to power my converter. 
 
Do you have any other suggestions?
 
0 Kudos
Message 3 of 8
(4,634 Views)
Hey scot,
 
I am going to need a little bit more detail about your application before I can really help.  When you said in your first post that the write function failed, did it give you an error code or an explanation.  Also, what kind of commands are you doing in hyperterminal compared to your commands in VB.net.  Are you making the same commands? 
 
Scott G.
AE Specialist
National Instruments
0 Kudos
Message 4 of 8
(4,606 Views)
 
 
RE: When you said in your first post that the write function failed, did it give you an error code or an explanation. 
No, The Kernel32.dll write command came back with no bytes sent.  No errors were evident however, I probably could have at that point queried the UART status some how. 
 
RE:Also, what kind of commands are you doing in hyperterminal compared to your commands in VB.net.  Are you making the same commands? 
Hyperterm does all the setup automatically so I do not know what setup/timeout/status info happens between hyperterm and the UART.  Maybe there is a reset after an error is detected by the uart or something like that.
 
I used a USB /RS232 device temporarily and it works fine with my code.  I will have to try to repeat using the Controllers com port and spend more time troubleshooting.
 
Thanks,
Scot Hudson
0 Kudos
Message 5 of 8
(4,596 Views)
Have you tried the loopback test yet?  There are instructions to do so here:
 
Also, what kind of software are you using to program?  Have you tried using the NI-Serial driver?
Scott G.
AE Specialist
National Instruments
0 Kudos
Message 6 of 8
(4,566 Views)
Scott,
 
Yes I tried the loopback which works fine if I use Hyperterm.
 
My problem was the transmission never happened (so it would not loopback.)
 
I would like to try the ni serial drivers.  Where would I find them?
 
Thanks,
Scot
0 Kudos
Message 7 of 8
(4,561 Views)
 

Hey Scot,

To communicate through your serial port on your controller, you will be using the VISA driver.  You can find the driver here:  https://www.ni.com/en/support/downloads/drivers/download.ni-visa.html

If you download the full VISA driver, you can use the VISA test panel to try a loopback.  If you have LabVIEW installed, there is a built-in loopback program that is the same as using VISA test panel, but it is more user friendly.  

Scott G.
AE Specialist
National Instruments
0 Kudos
Message 8 of 8
(4,551 Views)