Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

replace old Serial VI's with VISA LabVIEW 2010

I have imported an application I wrote in LabVIEW 7 Express that used the "old" serial VI's that used an Integer I32 for the Port Number, rather than the new VISA Resource name.

When I loaded it into LabVIEW 2010 I did not get any broken arrows, but the Serial interface would not communicate with my instrument.

 

So my questions are:

1) If I want to build an application executable for a Windows 7 PC using LabVIEW 2010, MUST I replace all the old Serial VI's with their VISA equivalents?

 

2) I remember when upgrading to a new version of Vision, NI had included an "upgrader" app. that automatically changed some old IMAQ Control to it's new equivalent - is there some tool like this for converting the old serial VI's to VISA?

 

Chris

0 Kudos
Message 1 of 7
(3,902 Views)

The replacement is automatic assuming you have not done something silly like save to an llb with vi.lib functions included. Just open one of the serial functions once you've loaded it in 2010. You should see VISA functions.

0 Kudos
Message 2 of 7
(3,900 Views)

Hi Dennis,

Oh yeah you're right.  Well I don't get what the problem is then.

 

If I use the "new" VISA Resource Name of COM12 it works, but if I use the "old" serial VI's and use the Port Number 11, I get the error -1073807343, which means:

 

VISA:  (Hex 0xBFFF0011) Insufficient location information or the device or resource is not present in the system.

 

Looking into the Open Serial Driver.vi I see it converts the I32 Port Number into a VISA Resource name of "ASRL12::INSTR" (see attached image),

but I'm guessing I have to include an alias string or something that says COM12 = ASRL12::INSTR is that right?

 

 

 Chris

0 Kudos
Message 3 of 7
(3,895 Views)
Com12 is an alias for ASRL12. Check to see how it's defined in MAX.
0 Kudos
Message 4 of 7
(3,893 Views)

Oh! COM12 is defined as ASRL14::INSTR in MAX.

 

If I set the Port Number to 13 it worked fine great!

 

OK so how can I use the VISA Resource Name Control and select COM12, but then convert that into an I32 integer as the Port Number of 13 so it will be compatible with all the old serial VI's?

 

I thought maybe I could use something like the TypeCast VI, but when I tried converting COM12 to an I32 I got the value 1129270577 instead of 13.

 

Chris

0 Kudos
Message 5 of 7
(3,890 Views)
I'm not sure how you are passing the com port from function to function. I don't have LabVIEW on my phone so I can't look at the conversion functions right now. You could treat the resource name as a string, get the numeric part and just subtract, I think.
0 Kudos
Message 6 of 7
(3,888 Views)

Thanks Dennis that did the job.

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