LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Max to configure a serial port

Solved!
Go to solution

Hello,

 

   The Labview code works on some computers but not others. When I get copy over the library and install Labview runtime engine. I assume that it should work on a newer computer.  The code is done with Labview 7.1 on Windows XP pro, it uses the following VI for com ports

 

  1. Serial Port Init
  2. Serial Port Write
  3. Bytes at Serial Port
  4. Serial Port Read

  So it does not use VISA. I can communicate with the serial device using Max, hyperterm, and Labview 7.1 (using VISA calls). But when I try to use the Labview 7.1 code that utilizes the 4 Sub-vi's mentioned above the code cannot even initialize the port. The error output from the Serial Port init has a value of 37 (decimal) so I cannot even init the port 

Regards,


Kaspar
0 Kudos
Message 11 of 24
(1,163 Views)

Kaspar wrote:

Hello,

 

   The Labview code works on some computers but not others. When I get copy over the library and install Labview runtime engine. I assume that it should work on a newer computer.  The code is done with Labview 7.1 on Windows XP pro, it uses the following VI for com ports

 

  1. Serial Port Init
  2. Serial Port Write
  3. Bytes at Serial Port
  4. Serial Port Read

  So it does not use VISA.


Unless someone messed around with the serial libraries that ship with LabVIEW 7.1 (such as replacing serial.llb and _sersup.llb with those from an earlier version of LabVIEW), those VIs are using VISA.

 

Here is what the Serial Port Init VI looks like:

 

And the  Open Serial Driver looks like this:

 

 

See? VISA. 

Message Edited by smercurio_fc on 04-14-2010 01:42 PM
Download All
0 Kudos
Message 12 of 24
(1,157 Views)

Thanks for the response. I will look at the libraries to see if the date and/or size is different.....

Regards,


Kaspar
0 Kudos
Message 13 of 24
(1,149 Views)

Hello,

 

 

  The serial libraries are the same. So I decided to look into the Sub-vi's that are used for the serial port, the ones I am using do not use VISA. There are numerous comments in the code and Windows and Sparc workstations.  Should I post the init vi and all of it sub-vi's?

Regards,


Kaspar
0 Kudos
Message 14 of 24
(1,139 Views)

Hello,

 

 

  How about we try something simple, just init the serial port and assume that a zero return code indicates success and the 37 (positive number) indicates a error "device not available". So here is the init vi and a calling vi for testing out the init.

 

Regards,


Kaspar
Download All
0 Kudos
Message 15 of 24
(1,129 Views)
You are loading the Serial Port Init (and the other VIs) from a location other than the LabVIEW vi.lib directory. You are dealing with an LLB. They appear to be loading from a directory called "W:\EMI_view\EMI\Susceptibility\Susceptibility_top_level.llb". Whoever created it also saved the serial port VIs from the old version. Thus, those are the ones that are being loaded, not the ones that ship with LabVIEW 7.1. You need to remove those standard VIs from the library and allow them to be loaded from the standard vi.lib folder.
0 Kudos
Message 16 of 24
(1,127 Views)

Hello,

 

   Thanks for getting back to me. I will have to get the library issues cleared up. not quite sure why the standard NI libraries were not used, but I guess I will find out!

Regards,


Kaspar
0 Kudos
Message 17 of 24
(1,115 Views)

Hello,

 

   I have looked into this some more and the cause of the problem is that a old vi "Open Device" is no longer supported by NI and the "general consenus" is that I should convert the code I inherited to use VISA. Well I have several systems that already work with the current code, I am just getting into problems when I try to have more computers run the same code.

  So I am leaning towards trying to understand how to get the existing code working that uses the "old serial port" drivers. So if anyone knows what libs and/or drivers need to be put on the new systems, please let me know. I will starting looking around today for any drivers and/or libraries that are on the existing systems that need to be copied over to the new systems.

Regards,


Kaspar
0 Kudos
Message 18 of 24
(1,100 Views)

There is a method for using the "old serial port" VIs. It is not supported (meaning don't go crying to NI if it doesn't work), and requires you to change existing libraries in the LabVIEW installation. This means you have to do this for each computer.

 

This is what you do:

  1. Copy the serial.llb library from LabVIEW 6.x to the vi.lib\Instr directory of LabVIEW 7.1.
  2. Copy the _sersup.llb library from LabVIEW 6.x to the vi.lib\Instr directory of LabVIEW 7.1.
  3. Copy the serpdrv file from LabVIEW 6.x to the LabVIEW 7.1 directory.
My own opinion is, as always, to rewrite the code in VISA. I think this is just going to cause more headaches for you, but it's your call.
0 Kudos
Message 19 of 24
(1,091 Views)

Hello,

 

   Thank you for your help and advice. I support a lab that tests every product our company makes and I need to increase test capacity quickly, right now I do not have the time to modify the code and test it to make sure that the new code still produces the same results.

Regards,


Kaspar
0 Kudos
Message 20 of 24
(1,078 Views)