LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LV5.1 serial vi conversion to VISA

Solved!
Go to solution

The question: is there a simple routine or utility that will allow me to update serial port vi's written in LV 5.1 to the current version of LV? 

 

We have been using LabView 5.1 serial vi's (not VISA) to pass requests and data between an instrument and PC. The serial communication vi's were simple to use and were used extensively in several legacy programs that have continued to evolve (and be used) over the last 6 years (probably not the best code).

 

I would like to update to a current version of Labview and in my initial trials (using an 8.2 version) was able to open the old 5.1 VI's with only minimal errors. However, none of the serial communications sub vi's function. Changing the serial vi's in one subroutine to the VISA versions of the Serial Write / Read / Bytes at Port / etc along with the appropriate rewiring works but to do this for all the occurrences of these serial vi's leaves me pretty cold to the idea of "upgrading".

 

I've looked through the boards but haven't found anything that seems to address my need. Any help would be greatly appreciated.

0 Kudos
Message 1 of 7
(3,348 Views)
For quite a few versions, LabVIEW has included functions of the same name but using VISA internally so the update should be automatic. Open the serial functions on your 8.2 installation and verify that they are actually using VISA. Also, report what, if any error codes you are seeing.
0 Kudos
Message 2 of 7
(3,340 Views)

First, thanks for the fast reply.

 

When I open the old LV version (5.1) with 8.2, I get the error message shown in the attachment.  The portion related to the the serial port communications is shown below.

G:\Labview\CA_r5 v1e2 Read\CA5-v1e2 Read.llb\Serial Port Init.vi
    - data bits uses data range coercion, which now only applies to data entry; values will not be coerced when passed to subVIs.  To coerce passed values,  use the In Range and Coerce function.
G:\Labview\CA_r5 v1e2 Read\CA5-v1e2 Read.llb\Serial Port Reset.vi
    - data bits uses data range coercion, which now only applies to data entry; values will not be coerced when passed to subVIs.  To coerce passed values,  use the In Range and Coerce function.
G:\Labview\CA_r5 v1e2 Read\CA5-v1e2 Read.vi
    - Port Number uses data range coercion, which now only applies to data entry; values will not be coerced when passed to subVIs.  To coerce passed values,  use the In Range and Coerce function.

 

When I look at the vi after opening it in LV8.2, the block diagrams for all the serial functions look like the one I used in the original 5.1 version (i.e. not one of the VISA calls).  These same vi's are not available in any of the pallets I see in the 8.2 version.

 

The first error I get is an "error 37 @ Serial Port Initialize: Device not found.     --  I am trying to make a call to Com1 which apparently is found? 

 

For the rewired VISA version mentioned above, the device apparently needs to be called out as "asrl1:inst"   (found using the VISA "Find Resource" vi).

 

Hope I haven't confused everything here.

0 Kudos
Message 3 of 7
(3,332 Views)
Solution
Accepted by Todd@Photonics

First, those are warnings and not errors. Second, if you do not see VISA functions in LabVIEW 8.2, then what could be happening is that someone made the mistake of creating an llb and saving vi.lib functions into the llb. If the location of the serial functions are in an llb, you really, really want to delete them from the llb (along with all other vi.lib functions). Saving vi.lib functions in an llb just makes the upgrade process very hard. You should also really, really think about abandoning llb's altogether. They serve no useful purpose anymore and should only be used for distribution of code. A corrupt VI in an llb will corrupt the entire llb. An llb does not work with source code control. Use folders of separate VIs or the new lvlib.

 

Below is the block diagram of the Open Serial Driver. And yes, VISA uses a different way to select ports. the 'ASRL1::INSTR' is the more formal way to use com1 but normally, people use the VISA alias of 'Com1'. This is much better than the old way where Com1 was port '0'.

Message 4 of 7
(3,328 Views)
Guilty of putting vi's together into libraries, it seemed to work well for me previously.  It will take a while to sort these out (unless you have a simple way to drag and drop these out of the library) but I'll assume that you have given me a solution (and homework for the weekend).  Thanks
0 Kudos
Message 5 of 7
(3,324 Views)
LabVIEW 8.x has the llb manager (under Tools) that you can use to convert an llb to a folder of VIs. Earlier versions had a similar tool that at the moment, my memory cannot recall the exact name. Other than that, I don't know of an easy way to identify which functions in a llb were originally from vi.lib. One reason to adopt a standard naming convention for subVIs. For example, I will use the top level VI name as a prefix for the subVIs I create.
0 Kudos
Message 6 of 7
(3,302 Views)

Thanks

Replaced the serial vi's with the LV vi's from the serial.llb and _sersup.llb.  The application then opened in 8.2 w/o any serious problems.

 

Thanks again

0 Kudos
Message 7 of 7
(3,262 Views)