LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial communication works on one machine - not on the next

I have a LabVIEW *.exe provided to me by a subcontractor.  He appears to be communicating with the serial port of the Windows XP computer as a VISA resource.  On one computer, the communication interface works fine.  On the second, it does not appear to be opening the com port.  These are identical Dell computers from the factory with only one serial port.  On the working machine, I can monitor the opening of the port using PortMon.  At the same point in the startup of the *.exe on the "dead" machine, there is no activity on PortMon.  The Com port (COM1) tests out just fine with HyperTerminal and PortMon, so I really do not suspect a hardware problem.  I am not fluent in LabVIEW, but I suspect that there is something wrong with the way the LabVIEW Com port driver is interfacing with Windows.  Is there anything I can change in Windows that would fix the problem?  I do not have the LabVIEW source code.  Thanks in advance for any help.
0 Kudos
Message 1 of 10
(3,271 Views)
Do you have the VISA drivers installed on the second PC?
0 Kudos
Message 2 of 10
(3,270 Views)
Yes
0 Kudos
Message 3 of 10
(3,268 Views)
Does the program geenrate any errors at all, or does it just "not work?"  Other items to check is to make sure the VISA alias for the COM port is the same, as well as the COM port numbers.

It is also possible that something else is causing a problem and the program never attempts to open the COM port because of the other issue.  Do you have source code from this contractor?  Someone may be able to help you if they can understand how the program is supposed to work.
0 Kudos
Message 4 of 10
(3,265 Views)
The program does not generate any errors - it just doesn't work.  How do I check the VISA aliases?  On both computers, the port shows up as COM1 in XP System Information.  I will attempt to get the source code, but I'm not sure they will release it.
0 Kudos
Message 5 of 10
(3,258 Views)
In a bind,

One difference that could exist between the computers is that while your original machine might have 'full' NI-VISA development support installed, the new machine may just have the runtime. If your program uses 'COM1' as the name of the resource to be accessed, it won't work on the new machine, because 'COM1' from LV's perspective is just an alias for a VISA resource, whose actual VISA resource name is 'ASRL1::INSTR'.

So, if it is true that the new machine just has the runtime, then you have two potential solutions.
1. Even though you don't have the source code, if your program has a front panel that let's you set the resource name, use ASRL1::INSTR instead of COM1.
2. If that is not possible, install full NI-VISA on the new machine, use MAX (that will be installed when full NI-VISA is installed) to confirm that the ASRL1::INSTR resource indeed has an alias COM1.

Please let me know if either of these solutions seem useful in your case. If your machine already had full NI-VISA installed, then please open MAX and verify that the port has alias COM1 and you can communicate to it from MAX and post your results here.

Regards,
Pankaj
0 Kudos
Message 6 of 10
(3,251 Views)
Assuming Measurement and Automation explorer is installed, open it and navigate to My System->Device and Interfaces->Serial & Parallel.

You should see a list of ports.  If you click on a port, the right-hand pane should display at the top next to the icon resembling a cable ARSL1:INSTR.  See what the VISA Alias is.  Make sure this matches the VISA Alias on the PC which works.




Message Edited by Matthew Kelton on 02-18-2008 05:53 PM
0 Kudos
Message 7 of 10
(3,243 Views)
You can also look for a file called C:\Documents and Settings\All Users\Application Data\National Instruments\NIvisa\visaconf.ini.  If you look down near the bottom of the file, you should see a section called ASRL-RSRC-ALIAS and entries along the line of:

Name1 = "ASRL1::INSTR"
Enabled1 = 1
Static1 = 0
SystemName1 = "COM1"
BaudRate1 = 9600
DataBits1 = 8
Parity1 = 0
StopBits1 = 10
FlowCtrl1 = 0

You will probably see a few entries.  Look for NameX to be ASRL1::INSTR.  Then find the section ALIASES (should be the next section). 

[ALIASES]
Alias0 = "'LPT1','ASRL10::INSTR'"
Alias1 = "'COM1','ASRL1::INSTR'"

Find AliasX, where X mataches the number of the NameX you found.  It's value will be something like "'Alias1','Alias2',...,'AliasN'".  Make sure the entries between the 2 PCs match.

Make sure you backup the file before you make the changes.


0 Kudos
Message 8 of 10
(3,240 Views)

Hi IaB,

      I'm wondering how the EXE knows which COM port to use - does the GUI allow you to choose?  If not, then I'd expect the user could choose, somehow, maybe via an INI file-parameter, or (heaven-forbid) a registry setting.

Do you have the application-builder?  If so, you could build a "quick-and-dirty" COM1 port-tester.  Then you'd know what the program was trying to do - and if the VISA stuff was working...

Cheers!

 

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 9 of 10
(3,231 Views)
I went back to the job site today.  I noticed that there was a VISA error in MAX on the computer that was not working.  I tried to open up the NI-VISA program and it gave me an error.  I downloaded and reinstalled NI-VISA.  I opened MAX back up and everything was happy.  Including me! 
 
Thanks to all who posted.  Your tips got me headed in the right direction and it was downhill from there.
0 Kudos
Message 10 of 10
(3,199 Views)